-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 "IS TRUE/FALSE" syntax #3159
Comments
Looks like there is sqlparser support: https://docs.rs/sqlparser/latest/sqlparser/ast/enum.Expr.html#variant.IsTrue Added in So this should be a fairly straightforward exercise -- note that Since we already have similar semantics for IS <expr> as is not distinct from <expr> as 'IS <expr. Here is what postgres does psql (14.4)
Type "help" for help.
alamb=# select null = null;
?column?
----------
(1 row)
alamb=# select null IS null;
?column?
----------
t
(1 row)
alamb=# select null IS DISTINCT FROM null;
?column?
----------
f
(1 row)
alamb=# select null IS NOT DISTINCT FROM null;
?column?
----------
t
(1 row) |
Thanks for the response! I'll start working on this. |
@sarahyurick here is an example of doing something similar for let fun = BuiltinScalarFunction::MakeArray;
// follow postgres convention and name result "array"
Ok(Expr::ScalarFunction { fun, args }.alias("array")) So in other words you can probably do something like (untested): Ok(binary_expr(left, Operator::IsNotDistinctFrom, right).alias("...")) |
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
A similar issue regarding "IS NOT TRUE/FALSE" syntax has already been opened (#2265), but it doesn't look like there is support for the "IS TRUE/FALSE" syntax either.
Describe the solution you'd like
Enum datafusion::logical_plan::Expr should include functionality for IsTrue and IsFalse.
Describe alternatives you've considered
None.
Additional context
None.
The text was updated successfully, but these errors were encountered: