kasakrisz commented on code in PR #6986:
URL: https://github.com/apache/hive/pull/6986#discussion_r4783613409
##########
iceberg/iceberg-handler/src/test/results/positive/mv_iceberg_orc10.q.out:
##########
@@ -0,0 +1,450 @@
+PREHOOK: query: drop materialized view if exists mat1
+PREHOOK: type: DROP_MATERIALIZED_VIEW
+POSTHOOK: query: drop materialized view if exists mat1
+POSTHOOK: type: DROP_MATERIALIZED_VIEW
+PREHOOK: query: drop table if exists t1
+PREHOOK: type: DROPTABLE
+PREHOOK: Output: database:default
+POSTHOOK: query: drop table if exists t1
+POSTHOOK: type: DROPTABLE
+POSTHOOK: Output: database:default
+PREHOOK: query: drop table if exists t2
+PREHOOK: type: DROPTABLE
+PREHOOK: Output: database:default
+POSTHOOK: query: drop table if exists t2
+POSTHOOK: type: DROPTABLE
+POSTHOOK: Output: database:default
+PREHOOK: query: create table t1 (a int, b string, c int) stored as orc
tblproperties ('transactional'='true')
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@t1
+POSTHOOK: query: create table t1 (a int, b string, c int) stored as orc
tblproperties ('transactional'='true')
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@t1
+PREHOOK: query: create table t2 (d int, e string, f int) stored as orc
tblproperties ('transactional'='true')
+PREHOOK: type: CREATETABLE
+PREHOOK: Output: database:default
+PREHOOK: Output: default@t2
+POSTHOOK: query: create table t2 (d int, e string, f int) stored as orc
tblproperties ('transactional'='true')
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@t2
+PREHOOK: query: insert into t1 values (1, 'one', 50), (2, 'two', 51), (3,
'three', 52), (4, 'four', 53), (5, 'five', 54)
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+PREHOOK: Output: default@t1
+POSTHOOK: query: insert into t1 values (1, 'one', 50), (2, 'two', 51), (3,
'three', 52), (4, 'four', 53), (5, 'five', 54)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+POSTHOOK: Output: default@t1
+POSTHOOK: Lineage: t1.a SCRIPT []
+POSTHOOK: Lineage: t1.b SCRIPT []
+POSTHOOK: Lineage: t1.c SCRIPT []
+PREHOOK: query: insert into t2 values (1, 'x', 10), (2, 'x', 20), (2, 'y',
21), (4, 'x', 40), (4, 'y', 41), (5, 'x', 50)
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+PREHOOK: Output: default@t2
+POSTHOOK: query: insert into t2 values (1, 'x', 10), (2, 'x', 20), (2, 'y',
21), (4, 'x', 40), (4, 'y', 41), (5, 'x', 50)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+POSTHOOK: Output: default@t2
+POSTHOOK: Lineage: t2.d SCRIPT []
+POSTHOOK: Lineage: t2.e SCRIPT []
+POSTHOOK: Lineage: t2.f SCRIPT []
+PREHOOK: query: create materialized view mat1 stored by iceberg stored as orc
tblproperties ('format-version'='3') as
+select t1.b, sum(t2.f), count(*)
+from t1 join t2 on t1.a = t2.d
+where t1.c > 50
+group by t1.b
+PREHOOK: type: CREATE_MATERIALIZED_VIEW
+PREHOOK: Input: default@t1
+PREHOOK: Input: default@t2
+PREHOOK: Output: database:default
+PREHOOK: Output: default@mat1
+PREHOOK: Output: hdfs://### HDFS PATH ###
+POSTHOOK: query: create materialized view mat1 stored by iceberg stored as orc
tblproperties ('format-version'='3') as
+select t1.b, sum(t2.f), count(*)
+from t1 join t2 on t1.a = t2.d
+where t1.c > 50
+group by t1.b
+POSTHOOK: type: CREATE_MATERIALIZED_VIEW
+POSTHOOK: Input: default@t1
+POSTHOOK: Input: default@t2
+POSTHOOK: Output: database:default
+POSTHOOK: Output: default@mat1
+POSTHOOK: Output: hdfs://### HDFS PATH ###
+POSTHOOK: Lineage: mat1._c1 EXPRESSION [(t2)t2.FieldSchema(name:f, type:int,
comment:null), ]
+POSTHOOK: Lineage: mat1._c2 EXPRESSION [(t1)t1.null, (t2)t2.null, ]
+POSTHOOK: Lineage: mat1.b SIMPLE [(t1)t1.FieldSchema(name:b, type:string,
comment:null), ]
+PREHOOK: query: insert into t1 values (6, 'six', 55)
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+PREHOOK: Output: default@t1
+POSTHOOK: query: insert into t1 values (6, 'six', 55)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+POSTHOOK: Output: default@t1
+POSTHOOK: Lineage: t1.a SCRIPT []
+POSTHOOK: Lineage: t1.b SCRIPT []
+POSTHOOK: Lineage: t1.c SCRIPT []
+PREHOOK: query: insert into t2 values (6, 'x', 60), (5, 'y', 51)
+PREHOOK: type: QUERY
+PREHOOK: Input: _dummy_database@_dummy_table
+PREHOOK: Output: default@t2
+POSTHOOK: query: insert into t2 values (6, 'x', 60), (5, 'y', 51)
+POSTHOOK: type: QUERY
+POSTHOOK: Input: _dummy_database@_dummy_table
+POSTHOOK: Output: default@t2
+POSTHOOK: Lineage: t2.d SCRIPT []
+POSTHOOK: Lineage: t2.e SCRIPT []
+POSTHOOK: Lineage: t2.f SCRIPT []
+PREHOOK: query: delete from t1 where a = 4
+PREHOOK: type: QUERY
+PREHOOK: Input: default@t1
+PREHOOK: Output: default@t1
+POSTHOOK: query: delete from t1 where a = 4
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@t1
+POSTHOOK: Output: default@t1
+PREHOOK: query: delete from t2 where d = 2 and e = 'y'
+PREHOOK: type: QUERY
+PREHOOK: Input: default@t2
+PREHOOK: Output: default@t2
+POSTHOOK: query: delete from t2 where d = 2 and e = 'y'
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@t2
+POSTHOOK: Output: default@t2
+PREHOOK: query: explain
+alter materialized view mat1 rebuild
+PREHOOK: type: ALTER_MATERIALIZED_VIEW_REBUILD
+PREHOOK: Input: default@mat1
+PREHOOK: Input: default@t1
+PREHOOK: Input: default@t2
+PREHOOK: Output: default@mat1
+PREHOOK: Output: default@mat1
+POSTHOOK: query: explain
+alter materialized view mat1 rebuild
+POSTHOOK: type: ALTER_MATERIALIZED_VIEW_REBUILD
+POSTHOOK: Input: default@mat1
+POSTHOOK: Input: default@t1
+POSTHOOK: Input: default@t2
+POSTHOOK: Output: default@mat1
+POSTHOOK: Output: default@mat1
+STAGE DEPENDENCIES:
+ Stage-3 is a root stage
+ Stage-4 depends on stages: Stage-3
+ Stage-0 depends on stages: Stage-4
+ Stage-5 depends on stages: Stage-0
+ Stage-6 depends on stages: Stage-5
+
+STAGE PLANS:
+ Stage: Stage-3
+ Tez
+#### A masked pattern was here ####
+ Edges:
+ Reducer 2 <- Map 1 (SIMPLE_EDGE), Reducer 8 (SIMPLE_EDGE)
+ Reducer 3 <- Reducer 2 (CUSTOM_SIMPLE_EDGE)
+ Reducer 4 <- Reducer 2 (CUSTOM_SIMPLE_EDGE)
+ Reducer 5 <- Reducer 2 (CUSTOM_SIMPLE_EDGE)
+ Reducer 7 <- Map 6 (SIMPLE_EDGE), Map 9 (SIMPLE_EDGE)
+ Reducer 8 <- Reducer 7 (SIMPLE_EDGE)
+#### A masked pattern was here ####
+ Vertices:
+ Map 1
+ Map Operator Tree:
+ TableScan
+ alias: default.mat1
+ Statistics: Num rows: 3 Data size: 312 Basic stats: COMPLETE
Column stats: COMPLETE
+ Select Operator
+ expressions: b (type: string), _c1 (type: bigint), _c2
(type: bigint), true (type: boolean), PARTITION__SPEC__ID (type: int),
PARTITION__HASH (type: bigint), FILE__PATH (type: string), ROW__POSITION (type:
bigint)
+ outputColumnNames: _col0, _col1, _col2, _col3, _col4,
_col5, _col6, _col7
+ Statistics: Num rows: 3 Data size: 936 Basic stats:
COMPLETE Column stats: COMPLETE
+ Reduce Output Operator
+ key expressions: _col0 (type: string)
+ null sort order: z
+ sort order: +
+ Map-reduce partition columns: _col0 (type: string)
+ Statistics: Num rows: 3 Data size: 936 Basic stats:
COMPLETE Column stats: COMPLETE
+ value expressions: _col1 (type: bigint), _col2 (type:
bigint), _col3 (type: boolean), _col4 (type: int), _col5 (type: bigint), _col6
(type: string), _col7 (type: bigint)
+ Execution mode: vectorized
+ Map 6
+ Map Operator Tree:
+ TableScan
+ alias: t1
+ filterExpr: ((c > 50) and a is not null) (type: boolean)
+ properties:
+ acid.fetch.deleted.rows TRUE
+ Statistics: Num rows: 5 Data size: 480 Basic stats: COMPLETE
Column stats: COMPLETE
+ Filter Operator
+ predicate: ((c > 50) and a is not null) (type: boolean)
+ Statistics: Num rows: 5 Data size: 480 Basic stats:
COMPLETE Column stats: COMPLETE
+ Select Operator
+ expressions: a (type: int), b (type: string), ROW__ID
(type: struct<writeid:bigint,bucketid:int,rowid:bigint>), (ROW__IS__DELETED and
(ROW__ID.writeid > 1L)) (type: boolean), ((ROW__ID.writeid > 1L) and (not
ROW__IS__DELETED)) (type: boolean)
+ outputColumnNames: _col0, _col1, _col2, _col3, _col4
+ Statistics: Num rows: 5 Data size: 880 Basic stats:
COMPLETE Column stats: COMPLETE
+ Reduce Output Operator
+ key expressions: _col0 (type: int)
+ null sort order: z
+ sort order: +
+ Map-reduce partition columns: _col0 (type: int)
+ Statistics: Num rows: 5 Data size: 880 Basic stats:
COMPLETE Column stats: COMPLETE
+ value expressions: _col1 (type: string), _col2 (type:
struct<writeid:bigint,bucketid:int,rowid:bigint>), _col3 (type: boolean), _col4
(type: boolean)
+ Execution mode: vectorized
+ Map 9
+ Map Operator Tree:
+ TableScan
+ alias: t2
+ filterExpr: d is not null (type: boolean)
+ properties:
+ acid.fetch.deleted.rows TRUE
+ Statistics: Num rows: 7 Data size: 56 Basic stats: COMPLETE
Column stats: COMPLETE
+ Filter Operator
+ predicate: d is not null (type: boolean)
+ Statistics: Num rows: 7 Data size: 56 Basic stats:
COMPLETE Column stats: COMPLETE
+ Select Operator
+ expressions: d (type: int), f (type: int), ROW__ID
(type: struct<writeid:bigint,bucketid:int,rowid:bigint>), (ROW__IS__DELETED and
(ROW__ID.writeid > 1L)) (type: boolean), ((ROW__ID.writeid > 1L) and (not
ROW__IS__DELETED)) (type: boolean)
+ outputColumnNames: _col0, _col1, _col2, _col3, _col4
+ Statistics: Num rows: 7 Data size: 644 Basic stats:
COMPLETE Column stats: COMPLETE
+ Reduce Output Operator
+ key expressions: _col0 (type: int)
+ null sort order: z
+ sort order: +
+ Map-reduce partition columns: _col0 (type: int)
+ Statistics: Num rows: 7 Data size: 644 Basic stats:
COMPLETE Column stats: COMPLETE
+ value expressions: _col1 (type: int), _col2 (type:
struct<writeid:bigint,bucketid:int,rowid:bigint>), _col3 (type: boolean), _col4
(type: boolean)
+ Execution mode: vectorized
+ Reducer 2
+ Reduce Operator Tree:
+ Merge Join Operator
+ condition map:
+ Right Outer Join 0 to 1
+ keys:
+ 0 _col0 (type: string)
+ 1 _col0 (type: string)
+ nullSafes: [true]
+ outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5,
_col6, _col7, _col8, _col9, _col10
+ Statistics: Num rows: 2 Data size: 832 Basic stats: COMPLETE
Column stats: COMPLETE
+ Filter Operator
+ predicate: ((_col3 and ((_col2 is null and (_col10 > 0L)) or
((_col10 + _col2) > 0))) or (_col3 and ((_col2 is null and (_col10 = 0L)) or
((_col10 + _col2) = 0)))) (type: boolean)
+ Statistics: Num rows: 2 Data size: 832 Basic stats: COMPLETE
Column stats: COMPLETE
+ Select Operator
+ expressions: _col4 (type: int), _col5 (type: bigint),
_col6 (type: string), _col7 (type: bigint), _col0 (type: string), _col1 (type:
bigint), _col2 (type: bigint)
Review Comment:
When I submitted this PR #6925 /
[HIVE-30113](https://issues.apache.org/jira/browse/HIVE-30113) was not merged.
I regenerated the golden file `mv_iceberg_orc10.q.out` and now only the
virtual columns are projected.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]