Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove termtree dependency #11416

Merged
merged 3 commits into from
Jul 13, 2024
Merged

Conversation

Kev1n8
Copy link
Contributor

@Kev1n8 Kev1n8 commented Jul 11, 2024

Which issue does this PR close?

Closes #11389

Rationale for this change

What changes are included in this PR?

Remove uses of termtree::tree in heap.rs. Directly generate the string instead.

Are these changes tested?

Are there any user-facing changes?

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @Kev1n8 -- this is a very nice contribution 🙏

I started the CI -- and once that passes I think this PR could be merged.

I had a few questions / suggestions but nothing major.

Thanks again!

) {
if let Some(Some(hi)) = self.heap.get(idx) {
let connector = if idx != 0 {
if is_tail {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@@ -361,9 +385,9 @@ impl<VAL: ValueType> HeapItem<VAL> {
impl<VAL: ValueType> Debug for HeapItem<VAL> {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
f.write_str("bucket=")?;
self.map_idx.fmt(f)?;
Debug::fmt(&self.map_idx, f)?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this change needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so. If it's not changed, the compiler will fail and report fmt being ambiguous

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense -- thank you

datafusion/physical-plan/src/aggregates/topk/heap.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again @Kev1n8

FYI @avantgardnerio

@alamb alamb merged commit a43cf79 into apache:main Jul 13, 2024
25 checks passed
@alamb
Copy link
Contributor

alamb commented Jul 13, 2024

Thanks again

findepi pushed a commit to findepi/datafusion that referenced this pull request Jul 16, 2024
* remove termtree dependency

* impl Display for TopKHeap, replace uses of tree_print in tests

* use to_string instead of format!
xinlifoobar pushed a commit to xinlifoobar/datafusion that referenced this pull request Jul 17, 2024
* remove termtree dependency

* impl Display for TopKHeap, replace uses of tree_print in tests

* use to_string instead of format!
xinlifoobar pushed a commit to xinlifoobar/datafusion that referenced this pull request Jul 18, 2024
* remove termtree dependency

* impl Display for TopKHeap, replace uses of tree_print in tests

* use to_string instead of format!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove the uses of termtree dependency
2 participants