Skip to content

[VL] Respect caseSensitiveAnalysis in IcebergScanTransformer metadata-column handling - #12726

Open
sabbasani wants to merge 4 commits into
apache:mainfrom
sabbasani:case-sensitive-iceberg-fix
Open

[VL] Respect caseSensitiveAnalysis in IcebergScanTransformer metadata-column handling#12726
sabbasani wants to merge 4 commits into
apache:mainfrom
sabbasani:case-sensitive-iceberg-fix

Conversation

@sabbasani

@sabbasani sabbasani commented Aug 7, 2026

Copy link
Copy Markdown

This PR fixes case-sensitive column-name handling in IcebergScanTransformer.

IcebergScanTransformer used unconditional .toLowerCase(Locale.ROOT) when handling schema and input-file-related metadata column names. This does not respect Spark's spark.sql.caseSensitive configuration and can cause mixed-case user columns to collide with metadata-related column names when spark.sql.caseSensitive=true.

This PR replaces the unconditional lowercasing with the existing canonical helper:

ConverterUtils.normalizeColName

normalizeColName respects SQLConf.get.caseSensitiveAnalysis:

when spark.sql.caseSensitive=true, the original column casing is preserved;
when spark.sql.caseSensitive=false, column names continue to be lowercased as before.

What changes are proposed in this pull request?

How was this patch tested?

Added regression coverage for both the general case-sensitive execution path and the Iceberg-specific path.

FallbackSuite

Tests cover:

case-sensitive top-level column access with native execution;
native aggregation with GROUP BY;
native join execution;
default case-insensitive behavior remaining unchanged.

Results:

FallbackSuite
21 tests
21 passed
0 failed
0 errors

The tests compare Gluten results against vanilla Spark and also verify that native Gluten/Velox transformer nodes are present.

VeloxIcebergSuite

Added coverage for:

Iceberg scan with spark.sql.caseSensitive=true;
input_file_name() with case-sensitive mode enabled;
a mixed-case data column such as Input_File_Name not being confused with metadata-related columns;
case-sensitive metadata-column handling.

Results:

VeloxIcebergSuite
19 tests
19 passed
0 failed
0 errors

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

Yes, AI assistance.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown

Run Gluten Clickhouse CI on x86

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