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

feat: Between expr to sql string #9803

Merged
merged 4 commits into from
Mar 26, 2024
Merged

Conversation

sebastian2296
Copy link
Contributor

Which issue does this PR close?

This PR adds support to convert Between Expr to SQL string #9726

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 26, 2024
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.

Thank you for the contribution @sebastian2296. Once CI passes this PR looks good to me

@@ -711,6 +724,15 @@ mod tests {
Expr::IsUnknown(Box::new((col("a") + col("b")).gt(lit(4)))),
r#"(("a" + "b") > 4) IS UNKNOWN"#,
),
(
Expr::Between(Between {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you could write this more concisely using https://docs.rs/datafusion/latest/datafusion/logical_expr/enum.Expr.html#method.between

so like betwen(col("a:"), lit(1), lit(7))

@alamb
Copy link
Contributor

alamb commented Mar 26, 2024

Hi @sebastian2296 -- I think you need to run cargo fmt locally and commit that change to get the CI to pass. Thank you for sticking with it

@alamb
Copy link
Contributor

alamb commented Mar 26, 2024

Beautiful -- thank you @sebastian2296

@alamb alamb merged commit 39f4aaf into apache:main Mar 26, 2024
23 checks passed
Lordworms pushed a commit to Lordworms/arrow-datafusion that referenced this pull request Apr 1, 2024
* feat: Between expr to sql string

* fix: use between logical expr

* fix: format using fmt

* fix: remove redundant field name
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.

2 participants