Skip to content

Conversation

@srielau
Copy link
Contributor

@srielau srielau commented Oct 28, 2025

What changes were proposed in this pull request?

We propose expanding the IDENTIFIER() clause which turns a string into a qualified identifier to all places identifeers can appear. The current clause is severely limited in where it can go because it accepts constant expressions, including session variables.
Due to that the existing clause reuqires tricky code to incrementally analyze its argumnets and then execute sectiosn of parser code at a later point.
By contrast the generalized IDENTIFIER clause only allows string literals which van be processed in the visitor methods.
Due to teh reowrk of paramermarkers and string coalescing thsi allows for constructs such as:

SELECT * FROM IDENTIFIER(:cat '.' :schema '.' :table)

it even allows:

SELECT 'hello' AS IDENTIFIER(:alias);

This is really all identifier() needs. We may be able to deprecate and de-support the existing too complex identifier() implementation.

Why are the changes needed?

IDENTIFIER() is a popular feature, but it can only be used in very specific, hard to reason about places.
The new implementation preserved 99% of teh fucntion while expanding its use to everywhere.

Does this PR introduce any user-facing change?

Yes, it's a new feature

How was this patch tested?

expanded Parameters and idnetifier-clause testsuites.

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

Yes, Clause Sonnet 4.5

@github-actions github-actions bot added the SQL label Oct 28, 2025
@dongjoon-hyun dongjoon-hyun marked this pull request as draft October 28, 2025 18:26
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.

1 participant