Zoltan Borok-Nagy has posted comments on this change. ( http://gerrit.cloudera.org:8080/23922 )
Change subject: IMPALA-9059: Add UNPIVOT clause ...................................................................... Patch Set 2: (7 comments) http://gerrit.cloudera.org:8080/#/c/23922/2//COMMIT_MSG Commit Message: http://gerrit.cloudera.org:8080/#/c/23922/2//COMMIT_MSG@14 PS2, Line 14: An example here could help understanding this operator. http://gerrit.cloudera.org:8080/#/c/23922/2//COMMIT_MSG@24 PS2, Line 24: - Added E2E tests in `test_unpivot_clause.py`. Please also add tests where there are column-masking/row-filtering rules on the UNPIVOT columns. http://gerrit.cloudera.org:8080/#/c/23922/2/be/src/exec/unpivot-node.cc File be/src/exec/unpivot-node.cc: http://gerrit.cloudera.org:8080/#/c/23922/2/be/src/exec/unpivot-node.cc@175 PS2, Line 175: GetNext Before calling GetNext I think we should pass resource ownership to the output row batch. Probably we should have a method similar to PartitionedHashJoinNode::NextProbeRowBatchFromChild: https://github.com/apache/impala/blob/master/be/src/exec/partitioned-hash-join-node.cc#L396-L422 http://gerrit.cloudera.org:8080/#/c/23922/2/fe/src/main/java/org/apache/impala/analysis/UnpivotTableRef.java File fe/src/main/java/org/apache/impala/analysis/UnpivotTableRef.java: http://gerrit.cloudera.org:8080/#/c/23922/2/fe/src/main/java/org/apache/impala/analysis/UnpivotTableRef.java@45 PS2, Line 45: puting nit: putting http://gerrit.cloudera.org:8080/#/c/23922/2/fe/src/main/java/org/apache/impala/analysis/UnpivotTableRef.java@99 PS2, Line 99: if (dataColumnType == null) { : dataColumnType = field.getType(); : } else if (!dataColumnType.equals(field.getType())) { You could use Type.getAssignmentCompatibleType(t1, t2) to determine dataColumnType. This way you could unpivot columns with different but compatible types (e.g. INT, BIGINT) http://gerrit.cloudera.org:8080/#/c/23922/2/fe/src/main/java/org/apache/impala/planner/UnpivotNode.java File fe/src/main/java/org/apache/impala/planner/UnpivotNode.java: http://gerrit.cloudera.org:8080/#/c/23922/2/fe/src/main/java/org/apache/impala/planner/UnpivotNode.java@98 PS2, Line 98: computeStats computeStats() need to be overridden to set cardinality. http://gerrit.cloudera.org:8080/#/c/23922/2/fe/src/main/java/org/apache/impala/planner/UnpivotNode.java@114 PS2, Line 114: ; semi-colon is redundant. -- To view, visit http://gerrit.cloudera.org:8080/23922 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I10e9d0a1bd70de02c7998afca274b895055d9b6a Gerrit-Change-Number: 23922 Gerrit-PatchSet: 2 Gerrit-Owner: Xuebin Su <[email protected]> Gerrit-Reviewer: Daniel Vanko <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Zoltan Borok-Nagy <[email protected]> Gerrit-Comment-Date: Thu, 05 Feb 2026 15:58:15 +0000 Gerrit-HasComments: Yes
