Steve Carlin has submitted this change and it was merged. ( 
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
Reviewed-on: http://gerrit.cloudera.org:8080/22541
Tested-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
Reviewed-by: Steve Carlin <scar...@cloudera.com>
---
M 
java/calcite-planner/src/main/java/org/apache/impala/calcite/coercenodes/CoerceOperandShuttle.java
1 file changed, 7 insertions(+), 0 deletions(-)

Approvals:
  Impala Public Jenkins: Verified
  Steve Carlin: Looks good to me, approved

--
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: merged
Gerrit-Change-Id: Ib9f44e3d5a7623a20d9841541bb496c1dee32d1e
Gerrit-Change-Number: 22541
Gerrit-PatchSet: 3
Gerrit-Owner: Steve Carlin <scar...@cloudera.com>
Gerrit-Reviewer: Aman Sinha <amsi...@cloudera.com>
Gerrit-Reviewer: Fang-Yu Rao <fangyu....@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <joemcdonn...@cloudera.com>
Gerrit-Reviewer: Michael Smith <michael.sm...@cloudera.com>
Gerrit-Reviewer: Steve Carlin <scar...@cloudera.com>

Reply via email to