Michael Smith has posted comments on this change. ( http://gerrit.cloudera.org:8080/18001 )
Change subject: IMPALA-10086: SqlCastException when comparing char with varchar ...................................................................... Patch Set 2: (1 comment) http://gerrit.cloudera.org:8080/#/c/18001/2/fe/src/main/java/org/apache/impala/analysis/Expr.java File fe/src/main/java/org/apache/impala/analysis/Expr.java: http://gerrit.cloudera.org:8080/#/c/18001/2/fe/src/main/java/org/apache/impala/analysis/Expr.java@1565 PS2, Line 1565: public final Expr castTo(Type targetType, TypeCompatibility compatibility) Changing this function doesn't seem to be sufficient. The following test causes a DCHECK fail and later a crash in LLVM trying to instantiate a string of length -1 select * from functional.chars_tiny where vc = cast('c' as char(1)); That case seems to be indistinguishable from others like select * from functional.chars_tiny where vc = cs; select * from functional.chars_tiny where cs = vc; at this point. Without any changes, they all report > SqlCastException: targetType=VARCHAR(*) type=VARCHAR(6) I can't produce any cases where CHAR and VARCHAR return a match, which seems like it might be related. -- To view, visit http://gerrit.cloudera.org:8080/18001 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3cd331ae1b6afb778a88080efd38900694539a89 Gerrit-Change-Number: 18001 Gerrit-PatchSet: 2 Gerrit-Owner: Bruno Pusztahazi <bpusztah...@cloudera.com> Gerrit-Reviewer: Daniel Becker <daniel.bec...@cloudera.com> Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com> Gerrit-Reviewer: Michael Smith <michael.sm...@cloudera.com> Gerrit-Comment-Date: Fri, 25 Aug 2023 20:59:21 +0000 Gerrit-HasComments: Yes