[
https://issues.apache.org/jira/browse/IMPALA-14660?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Arnab Karmakar resolved IMPALA-14660.
-------------------------------------
Resolution: Fixed
> Incorrect Parameter Validation in IcebergPartitionExpr
> ------------------------------------------------------
>
> Key: IMPALA-14660
> URL: https://issues.apache.org/jira/browse/IMPALA-14660
> Project: IMPALA
> Issue Type: Bug
> Components: Frontend
> Reporter: Arnab Karmakar
> Assignee: Arnab Karmakar
> Priority: Major
> Fix For: Impala 5.0.0
>
>
> *Bug Location:*
> [https://github.com/apache/impala/blob/e2b0a027b7a9c5ccb127ca318f273ea1f18f127c/fe/src/main/java/org/apache/impala/analysis/IcebergPartitionExpr.java#L61]
>
> *The Issue:* Line 61 contains an impossible condition that can never be true:
> {code:java}
> if (params.size() > 2 && params.size() < 1) {
> throw new AnalysisException("Invalid partition predicate: " +
> callExpr.toSql());
> }
> {code}
> *Impact:*
> When a partition transform like {{truncate(4, date_string_col, 4)}} is passed
> with 3 arguments:
> * The validation fails to catch the error
> * The code proceeds to read only the first two parameters (lines 71-72)
> * *The third parameter is silently ignored.*
> Two test cases in
> {{[AnalyzeDDLTest.java|https://github.com/apache/impala/blob/master/fe/src/test/java/org/apache/impala/analysis/AnalyzeDDLTest.java]}}
> have incorrect syntax
> {code:java}
> AnalyzesOk(evolution + "(truncate(4,date_string_col,4) = '1231')");
> AnalyzesOk(icebergEvolution + " partition (truncate(4,date_string_col,4) =
> '1231')");
> {code}
> Both should be:
> {code:java}
> truncate(4, date_string_col) // Only 2 arguments{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)