Peter Rozsa has uploaded a new patch set (#3). ( 
http://gerrit.cloudera.org:8080/20184 )

Change subject: IMPALA-10173: (Addendum) Fix substitution for unsafe 
expressions, column-level compatibility check
......................................................................

IMPALA-10173: (Addendum) Fix substitution for unsafe expressions, column-level 
compatibility check

This change fixes the expression substitution with an unsafely casted
expression; after this change the CastExrp contains the level of
compatibility which was used to create the expression, therefore
substitutions can recreate the expression as is. Before this change, the
information regarding compatibility level was not present at the
substitution part and cases where the root type must be preserved, the
unsafely casted expressions got casted with regular compatibility,
causing IllegalStateException. For example: 'select "1", "1" union
select 1, "1"'

The patch also fixes the column-level compatibility check in set
operations; after this change compatibility level is set to the regular
level initially for every column check, it will allow cases where
one column contains unsafely casted constant values and another one
contains non-constant expressions with regular casts in one set
operation. For example: 'select "1", 1 union select 1, int_col from
unsafe_insert'

Tests:
 - test case added to insert-unsafe.test

Change-Id: I39d13f177482f74ec39570118adab609444c6929
---
M fe/src/main/java/org/apache/impala/analysis/Analyzer.java
M fe/src/main/java/org/apache/impala/analysis/BoolLiteral.java
M fe/src/main/java/org/apache/impala/analysis/CastExpr.java
M fe/src/main/java/org/apache/impala/analysis/DateLiteral.java
M fe/src/main/java/org/apache/impala/analysis/Expr.java
M fe/src/main/java/org/apache/impala/analysis/NullLiteral.java
M fe/src/main/java/org/apache/impala/analysis/NumericLiteral.java
M fe/src/main/java/org/apache/impala/analysis/SlotRef.java
M fe/src/main/java/org/apache/impala/analysis/StringLiteral.java
M fe/src/main/java/org/apache/impala/analysis/TimestampLiteral.java
M fe/src/test/java/org/apache/impala/analysis/NumericLiteralTest.java
M testdata/workloads/functional-query/queries/QueryTest/insert-unsafe.test
12 files changed, 98 insertions(+), 55 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/84/20184/3
-- 
To view, visit http://gerrit.cloudera.org:8080/20184
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I39d13f177482f74ec39570118adab609444c6929
Gerrit-Change-Number: 20184
Gerrit-PatchSet: 3
Gerrit-Owner: Peter Rozsa <[email protected]>
Gerrit-Reviewer: Daniel Becker <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Peter Rozsa <[email protected]>

Reply via email to