diff --git ql/src/java/org/apache/hadoop/hive/ql/plan/TableScanDesc.java ql/src/java/org/apache/hadoop/hive/ql/plan/TableScanDesc.java index 2cb0935..a97c448 100644 --- ql/src/java/org/apache/hadoop/hive/ql/plan/TableScanDesc.java +++ ql/src/java/org/apache/hadoop/hive/ql/plan/TableScanDesc.java @@ -218,6 +218,17 @@ public void setNeededColumns(List neededColumns) { return neededColumns; } + @Explain(displayName = "Nested column paths") + public List getPrunedNeededColumnPaths() { + List result = new ArrayList<>(); + for (String p : neededNestedColumnPaths) { + if (p.indexOf('.') >= 0) { + result.add(p); + } + } + return result; + } + public void setReferencedColumns(List referencedColumns) { this.referencedColumns = referencedColumns; } diff --git ql/src/test/results/clientpositive/nested_column_pruning.q.out ql/src/test/results/clientpositive/nested_column_pruning.q.out index 5b6a8a2..1b4298b 100644 --- ql/src/test/results/clientpositive/nested_column_pruning.q.out +++ ql/src/test/results/clientpositive/nested_column_pruning.q.out @@ -155,6 +155,7 @@ STAGE PLANS: Map Operator Tree: TableScan alias: nested_tbl_1 + Nested column paths: s1.f1 Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: s1.f1 (type: boolean) @@ -197,6 +198,7 @@ STAGE PLANS: Map Operator Tree: TableScan alias: nested_tbl_1 + Nested column paths: s1.f1, s1.f2 Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: s1.f1 (type: boolean), s1.f2 (type: string) @@ -241,6 +243,7 @@ STAGE PLANS: Map Operator Tree: TableScan alias: nested_tbl_1 + Nested column paths: s1.f3 Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: s1.f3 (type: struct), s1.f3.f4 (type: int) @@ -285,6 +288,7 @@ STAGE PLANS: Map Operator Tree: TableScan alias: nested_tbl_1 + Nested column paths: s1.f3.f5 Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: s1.f3.f5 (type: double) @@ -329,6 +333,7 @@ STAGE PLANS: Map Operator Tree: TableScan alias: nested_tbl_1 + Nested column paths: s1.f3.f4, s2.f8.f9 Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: s1.f3.f4 (type: int), s2.f8.f9 (type: boolean) @@ -375,6 +380,7 @@ STAGE PLANS: Map Operator Tree: TableScan alias: nested_tbl_1 + Nested column paths: s1.f2, s1.f1 Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE Filter Operator predicate: (s1.f1 = false) (type: boolean) @@ -420,6 +426,7 @@ STAGE PLANS: Map Operator Tree: TableScan alias: nested_tbl_1 + Nested column paths: s1.f3.f5, s1.f3.f4 Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE Filter Operator predicate: (s1.f3.f4 = 4) (type: boolean) @@ -465,6 +472,7 @@ STAGE PLANS: Map Operator Tree: TableScan alias: nested_tbl_1 + Nested column paths: s1.f2, s2.f8 Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE Filter Operator predicate: ((s1.f2 = 'foo') and (size(s2.f8.f10) > 1) and (s2.f8.f11['key1'] = true)) (type: boolean) @@ -518,6 +526,7 @@ STAGE PLANS: Map Operator Tree: TableScan alias: nested_tbl_1 + Nested column paths: s2.f8.f10 Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE Lateral View Forward Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE @@ -659,6 +668,7 @@ STAGE PLANS: Map Operator Tree: TableScan alias: nested_tbl_1 + Nested column paths: s2.f8.f10, s1.f3.f4 Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: (s2.f8.f10[1] pmod s1.f3.f4) (type: int) @@ -705,6 +715,7 @@ STAGE PLANS: Map Operator Tree: TableScan alias: nested_tbl_1 + Nested column paths: s1.f3.f5, s1.f3.f4 Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: s1 (type: struct,f6:int>) @@ -766,6 +777,7 @@ STAGE PLANS: Map Operator Tree: TableScan alias: nested_tbl_1 + Nested column paths: s1.f3 Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: s1 (type: struct,f6:int>) @@ -828,6 +840,7 @@ STAGE PLANS: Map Operator Tree: TableScan alias: nested_tbl_1 + Nested column paths: s1.f3 Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE Select Operator expressions: s1 (type: struct,f6:int>) @@ -932,6 +945,7 @@ STAGE PLANS: value expressions: s1 (type: struct,f6:int>) TableScan alias: t2 + Nested column paths: s1.f6 Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE Filter Operator predicate: (s1.f6 is not null and (s2.f8.f9 = false)) (type: boolean) @@ -1018,6 +1032,7 @@ STAGE PLANS: value expressions: s1 (type: struct,f6:int>) TableScan alias: t2 + Nested column paths: s1.f6 Statistics: Num rows: 1 Data size: 4 Basic stats: COMPLETE Column stats: NONE Filter Operator predicate: (s1.f6 is not null and (s2.f8.f9 = true)) (type: boolean)