Arnab Karmakar created IMPALA-14660:
---------------------------------------

             Summary: 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
             Fix For: Impala 5.0.0


*Bug Location:* 
[https://github.com/apache/impala/blob/master/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

Line 380:

{{AnalyzesOk(evolution + "(truncate(4,date_string_col,4) = '1231')");}}

Line 4445:

{{AnalyzesOk(icebergEvolution + " partition (truncate(4,date_string_col,4) = 
'1231')");}}

Both should be:

{{{}truncate(4, date_string_col)  // Only 2 arguments{}}}{*}{*}

 



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

Reply via email to