You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SPARK-53523][SQL] Named parameters respect spark.sql.caseSensitive
### What changes were proposed in this pull request?
As the title.
### Why are the changes needed?
The issue was originally found during
- apache/iceberg#13106
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.
Closes#52269 from pan3793/SPARK-53523.
Authored-by: Cheng Pan <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
0 commit comments