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

feat: Enable min/max for boolean type #165

Merged
merged 2 commits into from
Mar 5, 2024
Merged

Conversation

huaxingao
Copy link
Contributor

Which issue does this PR close?

Closes #.

Rationale for this change

Enable min/max for BooleanType. This is also for bool_and and bool_or since Spark maps bool_and to min and bool_or to max.

What changes are included in this PR?

How are these changes tested?

new test

@huaxingao huaxingao closed this Mar 4, 2024
@huaxingao huaxingao reopened this Mar 4, 2024
sql(s"insert into $table values(true, 3)")
// Spark maps BOOL_AND to MIN and BOOL_OR to MAX
checkSparkAnswerAndNumOfAggregates(
s"SELECT MIN(a), MIN(b), BOOL_AND(a), BOOL_OR(a) FROM $table",
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
s"SELECT MIN(a), MIN(b), BOOL_AND(a), BOOL_OR(a) FROM $table",
s"SELECT MIN(a), MAX(b), BOOL_AND(a), BOOL_OR(a) FROM $table",

@sunchao sunchao merged commit 852b8cf into apache:main Mar 5, 2024
19 checks passed
@sunchao
Copy link
Member

sunchao commented Mar 5, 2024

Merged, thanks

@huaxingao
Copy link
Contributor Author

Thanks

@huaxingao huaxingao deleted the bool_aggregate branch March 5, 2024 01:06
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.

3 participants