Aleksandr Efimov created IMPALA-15339:
-----------------------------------------
Summary: Calcite planner: RexLiteralConverter has no case for REAL
or BINARY
Key: IMPALA-15339
URL: https://issues.apache.org/jira/browse/IMPALA-15339
Project: IMPALA
Issue Type: Sub-task
Components: Frontend
Reporter: Aleksandr Efimov
{code}
set planner=calcite;
select cast(1.5 as real);
AnalysisException: java.lang.IllegalStateException: Unsupported RexLiteral:
DOUBLE
select x'616263';
AnalysisException: java.lang.IllegalStateException: Unsupported RexLiteral:
BINARY
{code}
The first is ordinary Impala SQL - the original planner answers 1.5. Both types
are
mapped in both directions by ImpalaTypeConverter and the row type is derived
before
this point, so the plan stops where the literal has to become an Impala
expression.
The message names DOUBLE for a REAL literal because it prints the literal's own
type
name rather than the type the switch is on, so it points at a case that is
present.
Behind the BINARY case is the double conversion of IMPALA-15338, in a second
type.
Calcite folds a projection of constants into a VALUES row, and ImpalaValuesRel
re-creates each literal from its text - which bytes that are not valid UTF-8 do
not
have: "non-utf8 string: unhex(\"FF00FE\")".
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]