Steve Carlin has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/22541


Change subject: IMPALA-13796: Calcite planner: Improper casting for char on 
join condition
......................................................................

IMPALA-13796: Calcite planner: Improper casting for char on join condition

For the following query:

SELECT COUNT(*) from orders t1 LEFT OUTER JOIN orders t2
ON cast(t1.o_comment as char(120)) = cast(t2.o_comment as char(120));

The join condition uses the Function "=(CHAR,CHAR)".  The function
defined within Impala uses a wildcard for the length of the char (-1).

Previous to the fix, the code detected that the char(120) needed casting,
would cast it to a char(1), and this produced erroneous results.

The fix is to make sure we don't cast from a char(x) to a char(-1).

Change-Id: Ib9f44e3d5a7623a20d9841541bb496c1dee32d1e
---
M 
java/calcite-planner/src/main/java/org/apache/impala/calcite/coercenodes/CoerceOperandShuttle.java
1 file changed, 7 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/41/22541/1
--
To view, visit http://gerrit.cloudera.org:8080/22541
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib9f44e3d5a7623a20d9841541bb496c1dee32d1e
Gerrit-Change-Number: 22541
Gerrit-PatchSet: 1
Gerrit-Owner: Steve Carlin <[email protected]>
Gerrit-Reviewer: Aman Sinha <[email protected]>
Gerrit-Reviewer: Fang-Yu Rao <[email protected]>
Gerrit-Reviewer: Joe McDonnell <[email protected]>
Gerrit-Reviewer: Michael Smith <[email protected]>

Reply via email to