This is an automated email from the ASF dual-hosted git repository.

dbecker pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit edd5ff6e2a43ec38115eb6e5125f996e63b3cfec
Author: Daniel Vanko <[email protected]>
AuthorDate: Thu Aug 21 21:17:17 2025 +0200

    IMPALA-14290: Make Iceberg partitioning column names case insensitive
    
    When creating or altering partitions of Iceberg tables, Impala only
    accepts column names if they are in lowercase and throws
    ImpalaRuntimeException otherwise.
    
    This patch allows the usage of other cases as well in PARTITION SPEC
    clauses. IcebergPartitionField converts field names to lower case in its
    constructor, similar to ColumnDef and PartitionKeyValue.
    
    Testing:
     * ran existing tests
     * add new test with mixed letter case columns
    
    Change-Id: I4080a6b7468fff940435e2e780322d4ba1f0de49
    Reviewed-on: http://gerrit.cloudera.org:8080/23334
    Reviewed-by: Daniel Becker <[email protected]>
    Tested-by: Impala Public Jenkins <[email protected]>
---
 .../impala/analysis/IcebergPartitionField.java     |  4 +--
 .../iceberg-column-case-sensitivity-issue.test     | 34 ++++++++++++++++++++++
 2 files changed, 36 insertions(+), 2 deletions(-)

diff --git 
a/fe/src/main/java/org/apache/impala/analysis/IcebergPartitionField.java 
b/fe/src/main/java/org/apache/impala/analysis/IcebergPartitionField.java
index 4ccd53ae0..441727ec2 100644
--- a/fe/src/main/java/org/apache/impala/analysis/IcebergPartitionField.java
+++ b/fe/src/main/java/org/apache/impala/analysis/IcebergPartitionField.java
@@ -54,8 +54,8 @@ public class IcebergPartitionField extends StmtNode {
     Preconditions.checkState(type.isScalarType());
     sourceId_ = sourceId;
     fieldId_ = fieldId;
-    origFieldName_ = origFieldName;
-    fieldName_ = fieldName;
+    origFieldName_ = origFieldName.toLowerCase();
+    fieldName_ = fieldName.toLowerCase();
     transform_ = transform;
     type_ = (ScalarType)type;
   }
diff --git 
a/testdata/workloads/functional-query/queries/QueryTest/iceberg-column-case-sensitivity-issue.test
 
b/testdata/workloads/functional-query/queries/QueryTest/iceberg-column-case-sensitivity-issue.test
index a1907b1ac..3e0dd0d00 100644
--- 
a/testdata/workloads/functional-query/queries/QueryTest/iceberg-column-case-sensitivity-issue.test
+++ 
b/testdata/workloads/functional-query/queries/QueryTest/iceberg-column-case-sensitivity-issue.test
@@ -18,3 +18,37 @@ STRING, STRING
 ---- RUNTIME_PROFILE
 aggregation(SUM, NumRowGroups): 1
 ====
+---- QUERY
+# IMPALA-14290: check partition columns case insensitivity
+CREATE TABLE partition_case_insensitive ( START_TIME TIMESTAMP, End_Time 
TIMESTAMP )
+PARTITIONED BY SPEC (DAY(START_TIME), MONTH(enD_tIMe))
+STORED AS ICEBERG;
+---- RESULTS
+'Table has been created.'
+====
+---- QUERY
+ALTER TABLE partition_case_insensitive SET PARTITION SPEC (MONTH(start_TIME), 
DAY(end_time));
+---- RESULTS
+'Updated partition spec.'
+====
+---- QUERY
+INSERT INTO partition_case_insensitive VALUES ("2023-11-27 00:00:00", 
"2024-08-12 00:00:00");
+ALTER TABLE partition_case_insensitive DROP PARTITION (MONTH(sTARt_timE) = 
"2023-11");
+---- RESULTS
+'Dropped 1 partition(s)'
+====
+---- QUERY
+INSERT INTO partition_case_insensitive VALUES ("2023-12-27 00:00:00", 
"2024-08-12 00:00:00");
+INSERT INTO partition_case_insensitive VALUES ("2023-12-25 00:00:00", 
"2024-08-12 00:00:00");
+INSERT INTO partition_case_insensitive VALUES ("2023-12-25 00:00:00", 
"2024-07-12 00:00:00");
+INSERT INTO partition_case_insensitive VALUES ("2023-11-27 00:00:00", 
"2024-07-12 00:00:00");
+SHOW PARTITIONS partition_case_insensitive;
+---- LABELS
+Partition, Number Of Rows, Number Of Files
+---- RESULTS
+'{"start_time_day":null,"end_time_month":null,"start_time_month":"646","end_time_day":"19916"}',1,1
+'{"start_time_day":null,"end_time_month":null,"start_time_month":"647","end_time_day":"19916"}',1,1
+'{"start_time_day":null,"end_time_month":null,"start_time_month":"647","end_time_day":"19947"}',2,2
+---- TYPES
+STRING, BIGINT, BIGINT
+====

Reply via email to