Damir Sabirzyanov created IMPALA-14088:
------------------------------------------

             Summary: Incorrect partitions order when INSERT INTO partitioned 
Iceberg table with column list specified
                 Key: IMPALA-14088
                 URL: https://issues.apache.org/jira/browse/IMPALA-14088
             Project: IMPALA
          Issue Type: Bug
          Components: Frontend
    Affects Versions: Impala 4.4.1, Impala 4.5.0, Impala 4.3.0
            Reporter: Damir Sabirzyanov


Test Case (reproduced in versions 4.3.0, 4.4.1, 4.5.0):
{code:java}
-- The main point is that the order of the table fields does not match the 
order of
-- the fields in the partition specs
CREATE TABLE IF NOT EXISTS partitions_order (
id int,
name string,
dt date
)
PARTITIONED BY SPEC (DAY(dt), identity(id))
STORED AS ICEBERG;

-- If you specify a column list in an INSERT expression, an error occurs
INSERT INTO partitions_order (id, name, dt) VALUES (1, 'text1', '2025-01-01'); 
{code}
 

Error Message (stderr):
{code:java}
E0522 10:02:05.357957 76037 client-request-state.cc:1682] 
af416daccccdd644:9752814d00000000] ERROR Finalizing DML: 
ImpalaRuntimeException: Text '1' could not be parsed at index 0
CAUSED BY: DateTimeParseException: Text '1' could not be parsed at index 0 
{code}

Possible source of error: 
[https://github.com/apache/impala/blob/master/fe/src/main/java/org/apache/impala/analysis/InsertStmt.java#L1008]

This is where partitions are reordered relative to the table column list. 
According to the test case above, the following data permutation occurs when 
inserting data: dt -> id, id -> dt



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to