Daniel Becker has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/19190


Change subject: IMPALA-11692: Struct slot memory sharing involving select * not 
working properly
......................................................................

IMPALA-11692: Struct slot memory sharing involving select * not working properly

With EXPAND_COMPLEX_TYPES=1, if there are structs coming from the star
expansion and members of the structs are also given explicitly, slot
memory sharing does not work in some cases:

explain select * from functional_orc_def.complextypes_nested_structs;
row-size=64B

explain select *, outer_struct.inner_struct1 from
functional_orc_def.complextypes_nested_structs;
row-size=80B

The row size should be the same in both cases as
outer_struct.inner_struct1 is part of outer_struct which is included in
the star.

This change modifies how star select list items are analysed. First,
before 'SelectAnalyzer.analyzeSelectClause()' is called, all star items
are expanded to paths which are stored in the 'starExpandedPaths_' map.
The function 'SelectAnalyzer.registerStructSlotRefPathsWithAnalyzer()',
which makes struct slot memory sharing possible, takes these star
expanded paths into account. Then in
'SelectAnalyzer.analyzeSelectClause()' the paths expanded from the star
items are retrieved and and normal analysis takes place.

Testing:
 - Added the test function
   PlannerTest.testStructFieldSlotSharedWithStructFromStarExpansion()
   that verifies that struct slot memory sharing takes place.

Change-Id: I346c2808c1aa5e77e3cdf3593f7f48ac96516c00
---
M fe/src/main/java/org/apache/impala/analysis/SelectStmt.java
M fe/src/test/java/org/apache/impala/planner/PlannerTest.java
2 files changed, 181 insertions(+), 77 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/90/19190/1
--
To view, visit http://gerrit.cloudera.org:8080/19190
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I346c2808c1aa5e77e3cdf3593f7f48ac96516c00
Gerrit-Change-Number: 19190
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Becker <[email protected]>
Gerrit-Reviewer: Csaba Ringhofer <[email protected]>
Gerrit-Reviewer: Peter Rozsa <[email protected]>

Reply via email to