You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "Aleksandr Efimov (Jira)" <ji...@apache.org> on 2026/09/19 17:10:00 UTC
[jira] [Closed] (IMPALA-15301) Calcite planner: export Impala's explicit cast as a Substrait cast
[ https://issues.apache.org/jira/browse/IMPALA-15301?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Aleksandr Efimov closed IMPALA-15301.
-------------------------------------
> Calcite planner: export Impala's explicit cast as a Substrait cast
> ------------------------------------------------------------------
>
> Key: IMPALA-15301
> URL: https://issues.apache.org/jira/browse/IMPALA-15301
> Project: IMPALA
> Issue Type: Sub-task
> Components: Frontend
> Reporter: Aleksandr Efimov
> Assignee: Aleksandr Efimov
> Priority: Major
>
> ImpalaOperatorTable rewrites cast into an operator of its own, named EXPLICIT_CAST and carrying SqlKind.OTHER, to keep Calcite from folding it. The converter Isthmus already has for SqlKind.CAST therefore never sees it, and every explicit cast stops the export. Over the TPC-DS queries that carry Calcite goldens this is what blocks seven of them.
> Add a call converter that emits a Substrait Cast, the same way IMPALA-15298 handles IF.
> The failure behaviour is the closest of the two Substrait offers rather than an exact match, and this is worth stating plainly. Measured against a running Impala: casting an unparseable string returns NULL, and an integer that does not fit wraps round silently, so 99999999999 cast to int comes back as 1215752191. Impala never raises. RETURN_NULL states the first half. There is no Substrait failure behaviour for the second, so a consumer would produce NULL where Impala produces the wrapped value.
> Almost every EXPLICIT_CAST in a plan is one the planner inserted to line types up, where nothing overflows. A narrowing cast a user wrote is a real difference, and the alternative is not exporting any plan that contains a cast at all.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org