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

fix: incorrect result on Comet multiple column distinct count #268

Merged
merged 2 commits into from
Apr 15, 2024

Conversation

viirya
Copy link
Member

@viirya viirya commented Apr 15, 2024

Which issue does this PR close?

Closes #267.

Rationale for this change

What changes are included in this PR?

How are these changes tested?

Comment on lines 1097 to 1105
let mut children = vec![];
for child in expr.children.iter() {
children.push(self.create_expr(child, schema.clone())?);
}
Ok(Arc::new(Count::new_with_multiple_exprs(
children,
"count",
DataType::Int64,
)))
Copy link
Member Author

Choose a reason for hiding this comment

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

Count could take multiple children, but we used one child only.

@viirya
Copy link
Member Author

viirya commented Apr 15, 2024

cc @huaxingao @sunchao

@viirya
Copy link
Member Author

viirya commented Apr 15, 2024

cc @andygrove

Copy link
Contributor

@huaxingao huaxingao left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the fix.

@viirya viirya merged commit c1a2746 into apache:main Apr 15, 2024
28 checks passed
@viirya
Copy link
Member Author

viirya commented Apr 15, 2024

Merged. Thanks.

@viirya viirya deleted the fix_distinct_count branch April 15, 2024 22:46
himadripal pushed a commit to himadripal/datafusion-comet that referenced this pull request Sep 7, 2024
…#268)

* fix: incorrect result on Comet multiple column distinct count

* Update core/src/execution/datafusion/planner.rs

Co-authored-by: Andy Grove <[email protected]>

---------

Co-authored-by: Andy Grove <[email protected]>
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.

Different behavior of distinct count on null inputs
3 participants