-
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
Minor: Improve documentation in sql_to_plan example #10582
Conversation
Ok(()) | ||
} | ||
|
||
/// DataFusion can convert expressions to SQL, using column name escaping | ||
/// PostgreSQL style. | ||
fn simple_expr_to_sql_demo() -> Result<()> { | ||
let expr = col("a").lt(lit(5)).or(col("a").eq(lit(8))); | ||
let ast = expr_to_sql(&expr)?; | ||
let sql = format!("{}", ast); | ||
let sql = expr_to_sql(&expr)?.to_string(); |
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.
I think it makes it easier to use this example if we don't have to worry about the intermediate ast
as much, so I combined it into a single statement
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.
I don't remember why I had to do it, that totally makes sense
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.
Looks good, thank you!
Ok(()) | ||
} | ||
|
||
/// DataFusion can convert expressions to SQL, using column name escaping | ||
/// PostgreSQL style. | ||
fn simple_expr_to_sql_demo() -> Result<()> { | ||
let expr = col("a").lt(lit(5)).or(col("a").eq(lit(8))); | ||
let ast = expr_to_sql(&expr)?; | ||
let sql = format!("{}", ast); | ||
let sql = expr_to_sql(&expr)?.to_string(); |
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.
I don't remember why I had to do it, that totally makes sense
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.
Looks good, thank you!
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?
Follow on to #10558 from @xinlifoobar (🙏 ) and @edmondop
Rationale for this change
I noticed a few potential improvements to the sql_to_plan examples
What changes are included in this PR?
Are these changes tested?
Existing CI
Are there any user-facing changes?