Paul Rogers created IMPALA-7998:
-----------------------------------
Summary: Inconsistent cast rules in CastExpr, Type, BE
Key: IMPALA-7998
URL: https://issues.apache.org/jira/browse/IMPALA-7998
Project: IMPALA
Issue Type: Bug
Components: Frontend
Affects Versions: Impala 3.1.0
Reporter: Paul Rogers
Impala has two independent ways to specify the matrix of valid casts:
{{legalCast(fromType, toType)}}.
One way is used in the {{Expr.castTo()}} method that consults the
{{Type.getAssignmentCompatibleType()}} method in the Type class. This refers to
a compatibilityMatrix defined in that class. In that class, for example
(BOOLEAN, TIMESTAMP) is not a valid conversion, nor is (BOOLEAN, VARCHAR).
Whereas in {{CastExpr.initBuiltins()}}, there is a an exclusion labeled
“Disable casting from string to boolean”.
However, if we actual invoke the BE to do constant folding, then {{CAST(TRUE AS
STRING)}} is legal.
Seems we need to review these three separate sets of rules to ensure that they
are consistent.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)