You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@impala.apache.org by "Aleksandr Efimov (Code Review)" <ge...@cloudera.org> on 2026/08/25 22:54:39 UTC
[Impala-ASF-CR] IMPALA-15298: Export Impala's IF as a Substrait IfThen
Aleksandr Efimov has uploaded this change for review. ( http://gerrit.cloudera.org:8080/24743
Change subject: IMPALA-15298: Export Impala's IF as a Substrait IfThen
......................................................................
IMPALA-15298: Export Impala's IF as a Substrait IfThen
IMPALA-15297 mapped the Impala operators that stand in for functions
Substrait already has, which took the harness corpus from twenty of
twenty-four shapes to twenty-three. The one left is EXCEPT.
Substrait models a conditional as the IfThen expression rather than as
a function, so IF has no name for a signature to map to and needs a
call converter instead. Isthmus does the same for Calcite's CASE, which
is why a CASE in the query already exports while an IF does not.
IF is not only what a user writes. ImpalaMinusToDistinctRule builds one
while rewriting EXCEPT, so a query that never mentions IF still ends up
carrying one, and that is what stops the EXCEPT shape.
Isthmus takes converters for functions through its builder but
assembles the call converters in a method, so this goes in by extending
ConverterProvider and overriding getCallConverters. The converter is
put ahead of the scalar one, which is last and would otherwise fail the
call before this one sees it.
The null handling needs no special care: Impala returns the else branch
when the condition is null, and a null condition is not true, so
Substrait takes the else clause too.
With this the whole corpus exports.
Testing, in a local cluster on Linux, the three classes in one run:
- SubstraitPlanExporterTest: 14 tests, 0 failures, 0 errors. The two
added ones check that a written IF comes out as an IF_THEN
expression rather than a call, and that the EXCEPT shape exports
- CalciteOptimizerTest and CalciteSubstraitCompatibilityTest, neither
of which this patch touches: 11 and 4 tests, 0 failures
- Withholding the converter fails both added tests, so neither is
vacuous
- A probe over the harness corpus reports 24 of 24 with this patch and
23 of 24 without it
- git diff --check
Change-Id: I631f81cdfc002d3918d05ea936bcfbfcd54da03e
Assisted-by: Claude Opus 5 (Anthropic)
---
M java/calcite-planner/src/test/java/org/apache/impala/calcite/service/SubstraitOperatorMappings.java
M java/calcite-planner/src/test/java/org/apache/impala/calcite/service/SubstraitPlanExporterTest.java
2 files changed, 91 insertions(+), 5 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/43/24743/1
--
To view, visit http://gerrit.cloudera.org:8080/24743
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I631f81cdfc002d3918d05ea936bcfbfcd54da03e
Gerrit-Change-Number: 24743
Gerrit-PatchSet: 1
Gerrit-Owner: Aleksandr Efimov <dz...@gmail.com>
[Impala-ASF-CR] IMPALA-15298: Export Impala's IF as a Substrait IfThen
Posted by "Impala Public Jenkins (Code Review)" <ge...@cloudera.org>.
Impala Public Jenkins has posted comments on this change. ( http://gerrit.cloudera.org:8080/24743 )
Change subject: IMPALA-15298: Export Impala's IF as a Substrait IfThen
......................................................................
Patch Set 1:
Build Successful
https://jenkins.impala.io/job/gerrit-code-review-checks/23785/ : Initial code review checks passed. Use gerrit-verify-dryrun-external or gerrit-verify-dryrun to run full precommit tests.
--
To view, visit http://gerrit.cloudera.org:8080/24743
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I631f81cdfc002d3918d05ea936bcfbfcd54da03e
Gerrit-Change-Number: 24743
Gerrit-PatchSet: 1
Gerrit-Owner: Aleksandr Efimov <dz...@gmail.com>
Gerrit-Reviewer: Aleksandr Efimov <dz...@gmail.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Steve Carlin <sc...@cloudera.com>
Gerrit-Comment-Date: Tue, 25 Aug 2026 23:14:32 +0000
Gerrit-HasComments: No
[Impala-ASF-CR] IMPALA-15298: Export Impala's IF as a Substrait IfThen
Posted by "Aleksandr Efimov (Code Review)" <ge...@cloudera.org>.
Aleksandr Efimov has abandoned this change. ( http://gerrit.cloudera.org:8080/24743 )
Change subject: IMPALA-15298: Export Impala's IF as a Substrait IfThen
......................................................................
Abandoned
Folded into change 24741 before review. The series was cut as the work was found, one change per finding, which came to thirteen; regrouped by subject into four so that a reviewer reads the mechanism once and the applications after it. No content is dropped: this change and its commit message both live on in 24741.
--
To view, visit http://gerrit.cloudera.org:8080/24743
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: abandon
Gerrit-Change-Id: I631f81cdfc002d3918d05ea936bcfbfcd54da03e
Gerrit-Change-Number: 24743
Gerrit-PatchSet: 5
Gerrit-Owner: Aleksandr Efimov <dz...@gmail.com>
Gerrit-Reviewer: Aleksandr Efimov <dz...@gmail.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Joe McDonnell <jo...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Steve Carlin <sc...@cloudera.com>