-
Notifications
You must be signed in to change notification settings - Fork 28.8k
[SPARK-53523][SQL] Named parameters respect spark.sql.caseSensitive
#52269
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
Conversation
NamedParameter respects spark.sql.caseSensitivespark.sql.caseSensitive
spark.sql.caseSensitivespark.sql.caseSensitive
|
cc @dtenedor |
|
cc @srielau, is this by design that named parameters are always case sensitive? |
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.
+1 from my side. Thank you, @pan3793 .
cc @yaooqinn , @LuciferYang , too.
|
Thank you, @pan3793 and @LuciferYang . Merged to master for Apache Spark 4.1.0. |
|
LGTM. Shall we add a validation in function definition to make sure the parameter names are unique case insensitiely? like how we validate column names in CREATE TABLE. |
@cloud-fan I think it's already there. (correct me if I'm wrong) |
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.
Some late comment, be nice to add end to end test to ProcdureSuite.
+1 in any case, thanks for looking at it.
| functionName: String) : Seq[Expression] = { | ||
| NamedParametersSupport.defaultRearrange(expectedSignature, providedArguments, functionName) | ||
| functionName: String, | ||
| resolver: Resolver) : Seq[Expression] = { |
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.
nit: fix the javadoc to add the new args (in this and 'defaultRearrange')
What changes were proposed in this pull request?
As the title.
Why are the changes needed?
The issue was originally found during
I don't see any special reason that named parameters should always be case sensitive. (correct me if I'm wrong)
I tested PostgreSQL, and the named parameters are case-insensitive by default.
Does this PR introduce any user-facing change?
Yes, named parameters used by functions, procedures now respect
spark.sql.caseSensitive, instead of always performing case sensitive.How was this patch tested?
Added UT.
Was this patch authored or co-authored using generative AI tooling?
No.