feat: Add Spark SQL parser dialect config#22529
Conversation
There was a problem hiding this comment.
@kumarUjjawal
Looks good overall. I have one small suggestion to strengthen test coverage.
|
|
||
| // Spark function + Spark dialect parsing | ||
| let result = ctx | ||
| .sql("SELECT sha2('abc', 256)") |
There was a problem hiding this comment.
Nice addition. This test shows that Spark functions are registered, but SELECT sha2('abc', 256) also parses under the generic dialect, so it does not quite exercise the new Spark-dialect path.
Could we make the query use Spark-specific (or Spark-sensitive) syntax, or add a second assertion that would fail under Dialect::Generic? That would help ensure the test covers the full invariant: Spark functions are registered and Spark SQL parsing is active in the same session.
There was a problem hiding this comment.
Thanks you @kosiew I have updated the test.
|
Thank you for opening this pull request! Reviewer note: cargo-semver-checks reported the current version number is not SemVer-compatible with the changes in this pull request (compared against the base branch). Details |
Which issue does this PR close?
Rationale for this change
This lets users combine Spark-compatible functions with Spark SQL parsing when they choose the dialect.
What changes are included in this PR?
Sparkto the SQL parser dialect config enum.sparkandsparksqlas dialect config values.with_spark_features()config-neutral.Are these changes tested?
Yes
Are there any user-facing changes?
Users can now set
datafusion.sql_parser.dialecttosparkorsparksql.