Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
create external table ice_t (id int) stored by iceberg;
insert into ice_t values (1), (2), (3), (4);
explain extended select * from default.ice_t.snapshots;;
select `ice_t.snapshots`.operation from default.ice_t.snapshots;
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
PREHOOK: query: create external table ice_t (id int) stored by iceberg
PREHOOK: type: CREATETABLE
PREHOOK: Output: database:default
PREHOOK: Output: default@ice_t
POSTHOOK: query: create external table ice_t (id int) stored by iceberg
POSTHOOK: type: CREATETABLE
POSTHOOK: Output: database:default
POSTHOOK: Output: default@ice_t
PREHOOK: query: insert into ice_t values (1), (2), (3), (4)
PREHOOK: type: QUERY
PREHOOK: Input: _dummy_database@_dummy_table
PREHOOK: Output: default@ice_t
POSTHOOK: query: insert into ice_t values (1), (2), (3), (4)
POSTHOOK: type: QUERY
POSTHOOK: Input: _dummy_database@_dummy_table
POSTHOOK: Output: default@ice_t
PREHOOK: query: explain extended select * from default.ice_t.snapshots
PREHOOK: type: QUERY
PREHOOK: Input: default@ice_t
PREHOOK: Output: hdfs://### HDFS PATH ###
POSTHOOK: query: explain extended select * from default.ice_t.snapshots
POSTHOOK: type: QUERY
POSTHOOK: Input: default@ice_t
POSTHOOK: Output: hdfs://### HDFS PATH ###
OPTIMIZED SQL: SELECT `committed_at` AS `ice_t.snapshots.committed_at`, `snapshot_id` AS `ice_t.snapshots.snapshot_id`, `parent_id` AS `ice_t.snapshots.parent_id`, `operation` AS `ice_t.snapshots.operation`, `manifest_list` AS `ice_t.snapshots.manifest_list`, `summary` AS `ice_t.snapshots.summary`
FROM `default`.`ice_t`
STAGE DEPENDENCIES:
Stage-0 is a root stage

STAGE PLANS:
Stage: Stage-0
Fetch Operator
limit: -1
Processor Tree:
TableScan
alias: ice_t.snapshots
GatherStats: false
Select Operator
expressions: committed_at (type: timestamp with local time zone), snapshot_id (type: bigint), parent_id (type: bigint), operation (type: string), manifest_list (type: string), summary (type: map<string,string>)
outputColumnNames: _col0, _col1, _col2, _col3, _col4, _col5
ListSink

PREHOOK: query: select `ice_t.snapshots`.operation from default.ice_t.snapshots
PREHOOK: type: QUERY
PREHOOK: Input: default@ice_t
PREHOOK: Output: hdfs://### HDFS PATH ###
POSTHOOK: query: select `ice_t.snapshots`.operation from default.ice_t.snapshots
POSTHOOK: type: QUERY
POSTHOOK: Input: default@ice_t
POSTHOOK: Output: hdfs://### HDFS PATH ###
append
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ STAGE PLANS:
Map 1
Map Operator Tree:
TableScan
alias: ice_orc
alias: ice_orc.tag_v1
Snapshot ref: tag_v1
Statistics: Num rows: 4 Data size: 792 Basic stats: COMPLETE Column stats: COMPLETE
Select Operator
Expand Down Expand Up @@ -427,7 +427,7 @@ STAGE PLANS:
Map 1
Map Operator Tree:
TableScan
alias: ice_orc
alias: ice_orc.tag_v2
Snapshot ref: tag_v2
Statistics: Num rows: 8 Data size: 3136 Basic stats: COMPLETE Column stats: NONE
Select Operator
Expand Down Expand Up @@ -470,7 +470,7 @@ STAGE PLANS:
Map 1
Map Operator Tree:
TableScan
alias: ice_orc
alias: ice_orc.tag_v3
Snapshot ref: tag_v3
Statistics: Num rows: 11 Data size: 4312 Basic stats: COMPLETE Column stats: NONE
Select Operator
Expand Down Expand Up @@ -513,7 +513,7 @@ STAGE PLANS:
Map 1
Map Operator Tree:
TableScan
alias: ice_orc
alias: ice_orc.tag_v4
Snapshot ref: tag_v4
Statistics: Num rows: 9 Data size: 3528 Basic stats: COMPLETE Column stats: NONE
Select Operator
Expand Down Expand Up @@ -598,7 +598,7 @@ STAGE PLANS:
Map 1
Map Operator Tree:
TableScan
alias: ice_orc
alias: ice_orc.tag_v1
filterExpr: company_id is not null (type: boolean)
Snapshot ref: tag_v1
Statistics: Num rows: 3 Data size: 594 Basic stats: COMPLETE Column stats: COMPLETE
Expand Down Expand Up @@ -645,7 +645,7 @@ STAGE PLANS:
Map 1
Map Operator Tree:
TableScan
alias: ice_orc
alias: ice_orc.tag_v2
filterExpr: company_id is not null (type: boolean)
Snapshot ref: tag_v2
Statistics: Num rows: 8 Data size: 3136 Basic stats: COMPLETE Column stats: NONE
Expand Down Expand Up @@ -692,7 +692,7 @@ STAGE PLANS:
Map 1
Map Operator Tree:
TableScan
alias: ice_orc
alias: ice_orc.tag_v3
filterExpr: company_id is not null (type: boolean)
Snapshot ref: tag_v3
Statistics: Num rows: 11 Data size: 4312 Basic stats: COMPLETE Column stats: NONE
Expand Down Expand Up @@ -739,7 +739,7 @@ STAGE PLANS:
Map 1
Map Operator Tree:
TableScan
alias: ice_orc
alias: ice_orc.tag_v4
filterExpr: company_id is not null (type: boolean)
Snapshot ref: tag_v4
Statistics: Num rows: 9 Data size: 3528 Basic stats: COMPLETE Column stats: NONE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ STAGE PLANS:
Map 1
Map Operator Tree:
TableScan
alias: tbl_ice_puffin_time_travel
alias: tbl_ice_puffin_time_travel.tag_checkpoint
Snapshot ref: tag_checkpoint
Statistics: Num rows: 2 Data size: 190 Basic stats: COMPLETE Column stats: COMPLETE
Select Operator
Expand Down Expand Up @@ -211,7 +211,7 @@ STAGE PLANS:
Map 1
Map Operator Tree:
TableScan
alias: tbl_ice_puffin_time_travel
alias: tbl_ice_puffin_time_travel.tag_checkpoint
Snapshot ref: tag_checkpoint
Statistics: Num rows: 2 Data size: 190 Basic stats: COMPLETE Column stats: COMPLETE
Select Operator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,11 @@ POSTHOOK: Input: default@ice_branch_metadata_delete
PREHOOK: query: delete from default.ice_branch_metadata_delete.branch_test01 where a = 1
PREHOOK: type: QUERY
PREHOOK: Input: default@ice_branch_metadata_delete@branch_test01
PREHOOK: Output: hdfs://### HDFS PATH ###
PREHOOK: Output: default@ice_branch_metadata_delete@branch_test01
POSTHOOK: query: delete from default.ice_branch_metadata_delete.branch_test01 where a = 1
POSTHOOK: type: QUERY
POSTHOOK: Input: default@ice_branch_metadata_delete@branch_test01
POSTHOOK: Output: hdfs://### HDFS PATH ###
POSTHOOK: Output: default@ice_branch_metadata_delete@branch_test01
PREHOOK: query: select * from default.ice_branch_metadata_delete.branch_test01
PREHOOK: type: QUERY
PREHOOK: Input: default@ice_branch_metadata_delete@branch_test01
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ STAGE PLANS:
limit: -1
Processor Tree:
TableScan
alias: ice01
alias: ice01.tag_test1
Snapshot ref: tag_test1
Select Operator
expressions: a (type: int), b (type: string), c (type: int)
Expand Down Expand Up @@ -75,7 +75,7 @@ STAGE PLANS:
Map 1
Map Operator Tree:
TableScan
alias: ice01
alias: ice01.tag_test1
Snapshot ref: tag_test1
Statistics: Num rows: 3 Data size: 285 Basic stats: COMPLETE Column stats: COMPLETE
Select Operator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ STAGE PLANS:
limit: -1
Processor Tree:
TableScan
alias: ice01
alias: ice01.branch_test1
Snapshot ref: branch_test1
Select Operator
expressions: a (type: int), b (type: string), c (type: int)
Expand Down Expand Up @@ -231,7 +231,7 @@ STAGE PLANS:
Map 1
Map Operator Tree:
TableScan
alias: ice01
alias: ice01.branch_test1
filterExpr: (a = 22) (type: boolean)
Snapshot ref: branch_test1
Statistics: Num rows: 5 Data size: 960 Basic stats: COMPLETE Column stats: NONE
Expand Down Expand Up @@ -313,7 +313,7 @@ STAGE PLANS:
Map 1
Map Operator Tree:
TableScan
alias: ice01
alias: ice01.branch_test1
filterExpr: (c = 66) (type: boolean)
Snapshot ref: branch_test1
Statistics: Num rows: 4 Data size: 768 Basic stats: COMPLETE Column stats: NONE
Expand Down Expand Up @@ -448,7 +448,7 @@ STAGE PLANS:
Map 4
Map Operator Tree:
TableScan
alias: ice01
alias: ice01.branch_test1
filterExpr: a is not null (type: boolean)
Snapshot ref: branch_test1
Statistics: Num rows: 4 Data size: 768 Basic stats: COMPLETE Column stats: NONE
Expand Down Expand Up @@ -638,7 +638,7 @@ POSTHOOK: Input: default@source01
POSTHOOK: Output: default@ice01@branch_test1
POSTHOOK: Output: default@ice01@branch_test1
POSTHOOK: Output: default@merge_tmp_table
POSTHOOK: Lineage: merge_tmp_table.val EXPRESSION [(ice01)ice01.null, ]
POSTHOOK: Lineage: merge_tmp_table.val EXPRESSION [(ice01)ice01.branch_test1.null, ]
PREHOOK: query: select * from default.ice01.branch_test1
PREHOOK: type: QUERY
PREHOOK: Input: default@ice01@branch_test1
Expand Down Expand Up @@ -793,7 +793,7 @@ STAGE PLANS:
Map 1
Map Operator Tree:
TableScan
alias: ice01
alias: ice01.branch_test1
Snapshot ref: branch_test1
Statistics: Num rows: 1 Data size: 192 Basic stats: COMPLETE Column stats: NONE
Select Operator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -548,13 +548,14 @@ public static String getUnescapedUnqualifiedTableName(ASTNode node) throws Seman
assert node.getChildCount() <= 3;
assert node.getType() == HiveParser.TOK_TABNAME;

if (node.getChildCount() == 2 || node.getChildCount() == 3) {
if (node.getChildCount() == 2) {
node = (ASTNode) node.getChild(1);
return getUnescapedName(node);
}

String tableName = getUnescapedName(node);
if (node.getChildCount() == 3) {
tableName = tableName + "." + node.getChild(2);
tableName = getUnescapedName((ASTNode) node.getChild(1)) + "." + node.getChild(2);
}
return tableName;
}
Expand Down
Loading