Skip to content

Conversation

pan3793
Copy link
Member

@pan3793 pan3793 commented Sep 8, 2025

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.

psql (17.6 (Debian 17.6-1.pgdg13+1))
Type "help" for help.

postgres=# CREATE FUNCTION concat_lower_or_upper(a text, b text, uppercase boolean DEFAULT false)
RETURNS text
AS
$$
 SELECT CASE
        WHEN $3 THEN UPPER($1 || ' ' || $2)
        ELSE LOWER($1 || ' ' || $2)
        END;
$$
LANGUAGE SQL IMMUTABLE STRICT;
CREATE FUNCTION
postgres=# SELECT concat_lower_or_upper('Hello', 'World', true);
 concat_lower_or_upper
-----------------------
 HELLO WORLD
(1 row)

postgres=# SELECT concat_lower_or_upper(a => 'Hello', b => 'World');
 concat_lower_or_upper
-----------------------
 hello world
(1 row)

postgres=# SELECT concat_lower_or_upper(A => 'Hello', b => 'World');
 concat_lower_or_upper
-----------------------
 hello world
(1 row)

postgres=#

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.

@pan3793
Copy link
Member Author

pan3793 commented Sep 8, 2025

@pan3793 pan3793 changed the title [SPARK-53523][SQL] NamedParameter respects spark.sql.caseSensitive [SPARK-53523][SQL] Named parameters respects spark.sql.caseSensitive Sep 8, 2025
@pan3793 pan3793 changed the title [SPARK-53523][SQL] Named parameters respects spark.sql.caseSensitive [SPARK-53523][SQL] Named parameters respect spark.sql.caseSensitive Sep 8, 2025
@pan3793
Copy link
Member Author

pan3793 commented Sep 9, 2025

cc @dtenedor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant