Steve Carlin has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/21335 )

Change subject: IMPALA-13022: Added infrastructure for implicit casting of 
functions
......................................................................


Patch Set 18:

(1 comment)

http://gerrit.cloudera.org:8080/#/c/21335/18/java/calcite-planner/src/main/java/org/apache/impala/calcite/functions/ImplicitTypeChecker.java
File 
java/calcite-planner/src/main/java/org/apache/impala/calcite/functions/ImplicitTypeChecker.java:

http://gerrit.cloudera.org:8080/#/c/21335/18/java/calcite-planner/src/main/java/org/apache/impala/calcite/functions/ImplicitTypeChecker.java@42
PS18, Line 42:   private static Set<Pair<SqlTypeName, SqlTypeName>> 
SUPPORTED_IMPLICIT_CASTS =
> I'm assuming this is implementing the same thing as Impala's default compat
I started writing some unit test code that calls
RelDataType fromRelDataType = ImpalaTypeConverter.getRelDataType(fromType);
RelDataType toRelDataType = ImpalaTypeConverter.getRelDataType(toType);
            ImplicitTypeChecker.supportsImplicitCasting(fromRelDataType, 
toRelDataType);


ScalarType.getAssignmentCompatibleType(
            fromType, toType, TypeCompatibility.STRICT);

...and then compares the two values for supportsImplicitCasting with 
Type.INVALID_TYPE


This is not giving me what I would have hoped...

Impala is returning a valid type when downcasting, e.g. from SMALLINT to 
TINYINT.  I suppose we can keep that wouldn't affect the Calcite code in a 
negative way, but that seems weird.

On the other side, the previous mentioned FLOAT to DECIMAL is not supported, 
and that is needed for the "+" function.

Not sure how to proceed on this.



--
To view, visit http://gerrit.cloudera.org:8080/21335
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I13a349673f185463276ad7ddb83f0cfc2d73218c
Gerrit-Change-Number: 21335
Gerrit-PatchSet: 18
Gerrit-Owner: Steve Carlin <[email protected]>
Gerrit-Reviewer: Aman Sinha <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Joe McDonnell <[email protected]>
Gerrit-Reviewer: Michael Smith <[email protected]>
Gerrit-Reviewer: Steve Carlin <[email protected]>
Gerrit-Comment-Date: Fri, 20 Sep 2024 17:19:40 +0000
Gerrit-HasComments: Yes

Reply via email to