-
Notifications
You must be signed in to change notification settings - Fork 71
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
Support all boolean operations #719
Support all boolean operations #719
Conversation
Codecov Report
@@ Coverage Diff @@
## datafusion-sql-planner #719 +/- ##
=========================================================
Coverage ? 70.08%
=========================================================
Files ? 73
Lines ? 3624
Branches ? 747
=========================================================
Hits ? 2540
Misses ? 941
Partials ? 143 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
except TypeError: | ||
literal_type = SqlTypeName.NULL | ||
literal_value = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of interest, what type error are we catching here?
@@ -625,7 +625,7 @@ impl PyExpr { | |||
pub fn bool_value(&mut self) -> PyResult<bool> { | |||
match &self.expr { | |||
Expr::Literal(scalar_value) => match scalar_value { | |||
ScalarValue::Boolean(iv) => Ok(iv.unwrap()), | |||
ScalarValue::Boolean(Some(iv)) => Ok(*iv), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@charlesbluca your question is related to the change here - originally, "IS UNKNOWN" would panic here when the value is null. The change here allows us to throw the type error on the next line.
Not sure if we can come up with a case where it wouldn't be Some(true)
, Some(false)
, or None
Hi @charlesbluca @ayushdg @galipremsagar @jdye64 this is ready for review now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Outside of suggestions already made by @charlesbluca the rest looks good to me, will go ahead and approve from my end
With the recent updates to DataFusion and minor Dask SQL changes, "IS TRUE/FALSE" and "IS [NOT] UNKNOWN" are functional.
"IS NOT TRUE" and "IS NOT FALSE" should be functional once apache/datafusion#3252 is merged.
UPDATE: As long as all checks pass, this should be ready to merge.