[
https://issues.apache.org/jira/browse/IMPALA-15301?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Aleksandr Efimov resolved IMPALA-15301.
---------------------------------------
Resolution: Duplicate
Folded into IMPALA-15296 before review. The work was first cut one sub-task per
finding, which came to nine on top of the two the series started with;
regrouped by subject so that a reviewer reads the mechanism once and the
applications after it. Nothing described here is dropped: the code and the
reasoning both live on in IMPALA-15296, and the Gerrit change was abandoned
with the same note.
> 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: [email protected]
For additional commands, e-mail: [email protected]