You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@impala.apache.org by "Arnab Karmakar (Code Review)" <ge...@cloudera.org> on 2025/12/08 04:31:51 UTC

[Impala-ASF-CR] IMPALA-2083: Implement PIVOT operator in CalcitePlanner

Hello Csaba Ringhofer, Steve Carlin, Michael Smith, Impala Public Jenkins, 

I'd like you to reexamine a change. Please visit

    http://gerrit.cloudera.org:8080/23753

to look at the new patch set (#2).

Change subject: IMPALA-2083: Implement PIVOT operator in CalcitePlanner
......................................................................

IMPALA-2083: Implement PIVOT operator in CalcitePlanner

Add support for SQL PIVOT operator following Apache Calcite syntax,
similar to implementations in Apache Druid and Kylin.

Implementation Details:
- Calcite generates PIVOT as aggregates with FILTER clauses
- Transform FILTER clauses to CASE expressions for Impala backend
- Coerce nullable filter columns to NOT NULL as required
- Function resolution with supertype fallback for type coercion

Added documentation in docs/topics/impala_pivot.xml
with syntax and examples.

Testing:
- 19 positive test cases covering SUM, AVG, COUNT, MIN, MAX
- 18 negative test cases documenting error behavior
- Tests use real tables with explicit column selection

Change-Id: I3b0cc669c4edc9aff9b77ea7d40cb6dbb23f33ab
---
A docs/topics/impala_pivot.xml
M java/calcite-planner/src/main/java/org/apache/impala/calcite/coercenodes/CoerceNodes.java
M java/calcite-planner/src/main/java/org/apache/impala/calcite/rel/node/ImpalaAggRel.java
A testdata/workloads/functional-query/queries/QueryTest/pivot.test
M tests/custom_cluster/test_calcite_planner.py
5 files changed, 982 insertions(+), 27 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/53/23753/2
-- 
To view, visit http://gerrit.cloudera.org:8080/23753
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I3b0cc669c4edc9aff9b77ea7d40cb6dbb23f33ab
Gerrit-Change-Number: 23753
Gerrit-PatchSet: 2
Gerrit-Owner: Arnab Karmakar <ar...@gmail.com>
Gerrit-Reviewer: Csaba Ringhofer <cs...@cloudera.com>
Gerrit-Reviewer: Impala Public Jenkins <im...@cloudera.com>
Gerrit-Reviewer: Michael Smith <mi...@cloudera.com>
Gerrit-Reviewer: Steve Carlin <sc...@cloudera.com>