Adam Holley has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/10858


Change subject: IMPALA-7027: Mulitple varchar cast fails with distinct
......................................................................

IMPALA-7027: Mulitple varchar cast fails with distinct

When AggregateInfo removes duplicates of groupingExprs during the
second pass of rewrites, the CastExprs becomes StringLiterals.
Because the localEquals checks only comparase value, which in this case
is "" for both, the second cast expr is removed.  This causes the
second castTo() to fail.  This fix adds a check to StringLiteral.localEquals
to compare the type so that different items will not be removed.

Testing:
- Added test to validate distinct with casts
- Ran all FE tests
- Ran all E2E tests

Change-Id: I2fa5890eaa89787645c7d3d2eef976f54a34e7c0
---
M fe/src/main/java/org/apache/impala/analysis/StringLiteral.java
M fe/src/test/java/org/apache/impala/analysis/ExprRewriterTest.java
2 files changed, 12 insertions(+), 0 deletions(-)



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

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2fa5890eaa89787645c7d3d2eef976f54a34e7c0
Gerrit-Change-Number: 10858
Gerrit-PatchSet: 1
Gerrit-Owner: Adam Holley <ahol...@cloudera.com>

Reply via email to