sabbasani opened a new pull request, #12726:
URL: https://github.com/apache/gluten/pull/12726
<!--
Thank you for submitting a pull request! Here are some tips:
1. For first-time contributors, please read our contributing guide:
https://github.com/apache/gluten/blob/main/CONTRIBUTING.md
2. If necessary, create a GitHub issue for discussion beforehand to avoid
duplicate work.
3. If the PR is specific to a single backend, include [VL] or [CH] in the PR
title to indicate the
Velox or ClickHouse backend, respectively.
4. If the PR is not ready for review, please mark it as a draft.
-->
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?
<!--
Provide a clear and concise description of the changes introduced in this PR.
Ensure the PR description aligns with the code changes, especially after
updates.
If applicable, include "Fixes #<GitHub_Issue_ID>" to automatically close the
corresponding issue
when the PR is merged.
-->
## How was this patch tested?
<!--
Describe how the changes were tested, if applicable.
Include new tests to validate the functionality, if necessary.
For UI-related changes, attach screenshots to demonstrate the updates.
-->
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?
<!--
If generative AI tooling has been used in the process of authoring this
patch, please include the
phrase: 'Generated-by: ' followed by the name of the tool and its version.
If no, write 'No'.
Please refer to the [ASF Generative Tooling
Guidance](https://www.apache.org/legal/generative-tooling.html) for details.
-->
Yes. Generative AI tooling was used to assist with code investigation,
test-case generation, documentation, and review. The changes were manually
reviewed and validated with the relevant Gluten test suites and static checks.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]