Adam Holley has uploaded a new patch set (#4). ( 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 compares value, which in this case is "" for both, the second cast expr is removed. This should be fine because we can cast from a smaller varchar to a larger, however castResultExprs() tries to recast because varchar(100) and varchar(101) are not strictly equal. This fix adds a check to StatementBase.castResultExprs() to not try recasting if the current type length is greater than the target type length. 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/StatementBase.java M fe/src/test/java/org/apache/impala/analysis/ExprRewriterTest.java 2 files changed, 24 insertions(+), 1 deletion(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/58/10858/4 -- 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: newpatchset Gerrit-Change-Id: I2fa5890eaa89787645c7d3d2eef976f54a34e7c0 Gerrit-Change-Number: 10858 Gerrit-PatchSet: 4 Gerrit-Owner: Adam Holley <ahol...@cloudera.com> Gerrit-Reviewer: Adam Holley <ahol...@cloudera.com> Gerrit-Reviewer: Fredy Wijaya <fwij...@cloudera.com>