-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
adding expr to string for IsNotNull IsTrue IsFalse and IsUnkown #9739
Conversation
datafusion/sql/src/unparser/expr.rs
Outdated
(Expr::IsNotNull(Box::new(col("a"))), "\"a\" IS NOT NULL"), | ||
( | ||
Expr::IsTrue(Box::new((col("a") + col("b")).gt(lit(4)))), | ||
"((\"a\" + \"b\") > 4) IS TRUE", |
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.
What about using raw strings? https://doc.rust-lang.org/reference/tokens.html#raw-string-literals
It matches the other tests. :)
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.
Sure
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.
This code looks good to me -- thank you @Lordworms
I think it would be great to implement @yyy1000 's suggestion https://github.com/apache/arrow-datafusion/pull/9739/files#r1535890652 and then we can merge it.
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.
Thanks again @Lordworms and @yyy1000
(Expr::IsNotNull(Box::new(col("a"))), r#""a" IS NOT NULL"#), | ||
( | ||
Expr::IsTrue(Box::new((col("a") + col("b")).gt(lit(4)))), | ||
r#"(("a" + "b") > 4) IS TRUE"#, |
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.
😍
Which issue does this PR close?
Closes #9731
Rationale for this change
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?