[ 
https://issues.apache.org/jira/browse/IMPALA-14927?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18080636#comment-18080636
 ] 

ASF subversion and git services commented on IMPALA-14927:
----------------------------------------------------------

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]>


> Different but compatible types are not supported in the UNPIVOT clause
> ----------------------------------------------------------------------
>
>                 Key: IMPALA-14927
>                 URL: https://issues.apache.org/jira/browse/IMPALA-14927
>             Project: IMPALA
>          Issue Type: Bug
>            Reporter: Xuebin Su
>            Priority: Major
>
> For example, if we run the following query
> {code:java}
> with t1 (a, v1, v2) as (
>     values (1, 2, 3.0)
> )select * from t1 unpivot (
>     c for b in (v1 as 'v1', v2 as 'v2')
> ) as t; {code}
> we will get an error like
> {code:java}
> AnalysisException: Columns in the UNPIVOT clause should have the same type 
> {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]

Reply via email to