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

Revert "feat: Implement the bitwise_not in NotExpr (#5902)" #6599

Merged
merged 1 commit into from
Jun 9, 2023

Conversation

jackwener
Copy link
Member

@jackwener jackwener commented Jun 8, 2023

This reverts commit 87e5adc

Which issue does this PR close?

Closes #6589

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions bot added core Core DataFusion crate physical-expr Physical Expressions sqllogictest SQL Logic Tests (.slt) labels Jun 8, 2023
@@ -911,17 +911,15 @@ SELECT not(true), not(false)
----
false true

query BB
query error DataFusion error: Optimizer rule 'simplify_expressions' failed\ncaused by\nInternal error: NOT 'Literal \{ value: Int64\(1\) \}' can't be evaluated because the expression's type is Int64, not boolean or NULL\. This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker
Copy link
Member Author

Choose a reason for hiding this comment

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

It should fail in type coercion, it's a future ticket.
We should try to cast param. (if fail cast then throw a error)

@jackwener jackwener marked this pull request as ready for review June 8, 2023 11:04
@jackwener
Copy link
Member Author

wait for opinion of @liukun4515 in #6589

@alamb
Copy link
Contributor

alamb commented Jun 8, 2023

cc @RTEnzyme who originally contributed this code.

@alamb
Copy link
Contributor

alamb commented Jun 8, 2023

Also cc @comphead who commented on #5902

Copy link
Contributor

@comphead comphead left a comment

Choose a reason for hiding this comment

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

thanks @jackwener I found the same issue yesterday 🤣

@RTEnzyme
Copy link
Contributor

RTEnzyme commented Jun 9, 2023

I agree that not() should only support boolean types. If we want to implement bitwise_not on integers, we should create a new Expr.

@alamb alamb merged commit eacbdd9 into apache:main Jun 9, 2023
jayzhan211 pushed a commit to jayzhan211/datafusion that referenced this pull request Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate physical-expr Physical Expressions sqllogictest SQL Logic Tests (.slt)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Discuss: don't allow not() param is IntegerType
4 participants