[
https://issues.apache.org/jira/browse/IMPALA-14928?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18080637#comment-18080637
]
ASF subversion and git services commented on IMPALA-14928:
----------------------------------------------------------
Commit 1381810b3c87c5c44b2d44ae1d9f9ae96053711f in impala's branch
refs/heads/master from Xuebin Su
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=1381810b3 ]
IMPALA-9059: Add UNPIVOT clause
This patch adds support for the UNPIVOT clause by creating a new
subclass of `TableRef` called `UnpivotTableRef`. The concepts and an
example are explained in `UnpivotTableRef.java`.
A new keyword `UNPIVOT` is added.
A new type of plan node and a new type of execution node called
`UnpivotNode` are added.
Two new notification methods are added in `TableRef.java` for
`UnpivotTableRef`:
- `notifySlotRefRegistered()` to register the SlotDescriptors in the
TupleDescriptor of the source TableRef and
- `notifySlotsMaterialized()` to mark the SlotDescriptors in the
TupleDescriptor of the source TableRef as materialized.
To support column masking, `Analyzer.resolveTableMask()` is moved and
renamed to `TableRef.applyTableMask()` so that `UnpivotTableRef` can
override it.
Limitations:
- IMPALA-14927: Different but compatible types are not supported in the
UNPIVOT clause
- IMPALA-14928: Multiple UNPIVOT clauses following the same path is not
supported
Testing:
- Added E2E tests in `test_unpivot_clause.py` and
`ranger_column_masking_and_row_filtering.test`.
- Added PlannerTest to ensure the predicates can be pushed down.
- Added AnalyzerTest.
Change-Id: I10e9d0a1bd70de02c7998afca274b895055d9b6a
Reviewed-on: http://gerrit.cloudera.org:8080/23922
Reviewed-by: Impala Public Jenkins <[email protected]>
Reviewed-by: Zoltan Borok-Nagy <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
> Multiple UNPIVOT clauses following the same path is not supported
> -----------------------------------------------------------------
>
> Key: IMPALA-14928
> URL: https://issues.apache.org/jira/browse/IMPALA-14928
> Project: IMPALA
> Issue Type: Bug
> Reporter: Xuebin Su
> Priority: Major
>
> For example, if we run the following query
> {code:java}
> select *
> from functional_parquet.alltypestiny unpivot (
> c for b in (month as 'm')
> ) as t1, functional_parquet.alltypestiny unpivot (
> c for b in (month as 'm')
> ) as t2; {code}
> we will get an error like
> {code:java}
> AnalysisException: Duplicate table alias: 'functional_parquet.alltypestiny'
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]