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

adding expr to string for IsNotNull IsTrue IsFalse and IsUnkown #9739

Merged
merged 3 commits into from
Mar 23, 2024

Conversation

Lordworms
Copy link
Contributor

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?

@github-actions github-actions bot added the sql SQL Planner label Mar 22, 2024
(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",
Copy link
Contributor

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. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure

Copy link
Contributor

@alamb alamb left a 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.

cc @devinjdangelo

Copy link
Contributor

@alamb alamb left a 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"#,
Copy link
Contributor

Choose a reason for hiding this comment

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

😍

@alamb alamb merged commit 1dbec3e into apache:main Mar 23, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sql SQL Planner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

adding Expr->String for IsTrue, IsFalse, IsUnknown
3 participants