Daniel Becker has uploaded a new patch set (#7). (
http://gerrit.cloudera.org:8080/21824 )
Change subject: IMPALA-13373: Analytic query with struct from view fails
......................................................................
IMPALA-13373: Analytic query with struct from view fails
The following fails with a frontend exception:
CREATE TABLE tbl (
s STRUCT<id:STRING,type:STRING, b:BOOLEAN>
) STORED AS PARQUET;
CREATE VIEW view_tbl AS SELECT s FROM tbl;
SELECT MAX(view_tbl.s.type) OVER (PARTITION BY view_tbl.s.id) AS type
FROM view_tbl;
The root cause is that in some places, structs are not handled
recursively when they should be. This change introduces recursive
handling in the following places:
- SlotDescriptor copying constructor
- AnalyticPlanner.createSortInfo()
- SortNode.init()
The last case is about adding structs to smaps, which has already been
done recursively for InlineViewRef. To reuse the code, it has been
extracted into a new class, RecursiveExprSubstitutionMapInserter.
Testing:
- added regression tests in struct-in-select-list.test
Change-Id: I6ecd79ba00396fb557581514462af86f2f450c86
---
M fe/src/main/java/org/apache/impala/analysis/DescriptorTable.java
M fe/src/main/java/org/apache/impala/analysis/InlineViewRef.java
A
fe/src/main/java/org/apache/impala/analysis/RecursiveExprSubstitutionMapInserter.java
M fe/src/main/java/org/apache/impala/analysis/SlotDescriptor.java
M fe/src/main/java/org/apache/impala/analysis/SortInfo.java
M fe/src/main/java/org/apache/impala/analysis/TupleDescriptor.java
M fe/src/main/java/org/apache/impala/planner/AnalyticPlanner.java
M fe/src/main/java/org/apache/impala/planner/SortNode.java
M
testdata/workloads/functional-query/queries/QueryTest/struct-in-select-list.test
9 files changed, 438 insertions(+), 176 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/24/21824/7
--
To view, visit http://gerrit.cloudera.org:8080/21824
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I6ecd79ba00396fb557581514462af86f2f450c86
Gerrit-Change-Number: 21824
Gerrit-PatchSet: 7
Gerrit-Owner: Daniel Becker <[email protected]>
Gerrit-Reviewer: Csaba Ringhofer <[email protected]>
Gerrit-Reviewer: Gabor Kaszab <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Noemi Pap-Takacs <[email protected]>
Gerrit-Reviewer: Peter Rozsa <[email protected]>
Gerrit-Reviewer: Zoltan Borok-Nagy <[email protected]>