Skip to content

Conversation

srielau
Copy link
Contributor

@srielau srielau commented Oct 16, 2025

What changes were proposed in this pull request?

As part of generalizing the usage of parameter markers, we want to also generalize the ability to chain string literals in more places than only expressions.
This allows for fuctionality such as: spark.sql("CREATE TABLE ... LOCATION :root '/subdir'", Map("root" -> "/data")
to turn into:
CREATE TABLE ... LOCATION '/data/subdir'

String coalescing works now nearly everywhere with two cave-ats:

  • typed-literals
    TIMESTAMP :param collides with json path jsonstr:path.
    I think tat's acceptable as most typed literals take strings and allow :: or CAST casting. And of course one can always pass a typed parameter marker
  • property lists allow equal signs to be optional. That means we don't know where the split key and value. OPTIONS however already allowed constants which included coalescing. So precedence clarifies that, in teh absesne of an equal sign only the first string literal is the key. All subsequent literals compose the value.

Why are the changes needed?

Greatly increases the power of parameter markers without having to build heavy expressions and refactoring code

Does this PR introduce any user-facing change?

Yes, it is an additive feature

How was this patch tested?

Written a new set of tests StringLiteralCoalescingSuite

Was this patch authored or co-authored using generative AI tooling?

Claude Sonnet 4.5

@github-actions github-actions bot added the SQL label Oct 16, 2025
Copy link
Contributor

@dtenedor dtenedor left a comment

Choose a reason for hiding this comment

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

Thanks for working on this, it will make the SQL syntax better!

@github-actions github-actions bot removed the DOCS label Oct 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants