Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HIVE-28059: Iceberg REST Catalog #5606

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
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
Expand Up @@ -231,12 +231,12 @@ public void testCreateBranchFromTag() throws IOException, InterruptedException {
// Create a branch based on a tag which doesn't exist will fail.
Assertions.assertThatThrownBy(() -> shell.executeStatement(String.format(
"ALTER TABLE customers CREATE BRANCH %s FOR TAG AS OF %s", branchName2, nonExistTag)))
.isInstanceOf(IllegalArgumentException.class).hasMessageContaining("does not exist");
.isInstanceOf(IllegalArgumentException.class).hasMessageEndingWith("does not exist");

// Create a branch based on a branch will fail.
Assertions.assertThatThrownBy(() -> shell.executeStatement(String.format(
"ALTER TABLE customers CREATE BRANCH %s FOR TAG AS OF %s", branchName2, branchName1)))
.isInstanceOf(IllegalArgumentException.class).hasMessageContaining("does not exist");
.isInstanceOf(IllegalArgumentException.class).hasMessageEndingWith("does not exist");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ public void testCreateTableError() {
"')"))
.isInstanceOf(IllegalArgumentException.class)
.hasMessageStartingWith("Failed to execute Hive query")
.hasMessageContaining("Table location not set");
.hasMessageEndingWith("Table location not set");
}
}

Expand Down Expand Up @@ -775,7 +775,7 @@ public void testCreatePartitionedTableWithPropertiesAndWithColumnSpecification()
"')"))
.isInstanceOf(IllegalArgumentException.class)
.hasMessageStartingWith("Failed to execute Hive query")
.hasMessageContaining(
.hasMessageEndingWith(
"Provide only one of the following: Hive partition transform specification, " +
"or the iceberg.mr.table.partition.spec property");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,26 +65,11 @@ delete from ice_orc where last_name in ('ln1', 'ln9');
delete from ice_orc where last_name in ('ln3', 'ln11');
delete from ice_orc where last_name in ('ln5', 'ln13');

alter table ice_orc set partition spec(team_id);
insert into ice_orc VALUES
('fn17', 'ln17', 1, 10, 100),
('fn18','ln18', 1, 10, 100);
insert into ice_orc VALUES
('fn19','ln19', 2, 11, 100),
('fn20','ln20', 2, 11, 100);
insert into ice_orc VALUES
('fn21','ln21', 3, 12, 100),
('fn22','ln22', 3, 12, 100);
insert into ice_orc VALUES
('fn23','ln23', 4, 13, 100),
('fn24','ln24', 4, 13, 100);


select * from ice_orc;
describe formatted ice_orc;

explain alter table ice_orc COMPACT 'major' and wait where company_id=100 or dept_id in (1,2);
alter table ice_orc COMPACT 'major' and wait where company_id=100 or dept_id in (1,2);
explain alter table ice_orc COMPACT 'major' and wait where team_id=10 or first_name in ('fn3', 'fn11') or last_name in ('ln7', 'ln15');
alter table ice_orc COMPACT 'major' and wait where team_id=10 or first_name in ('fn3', 'fn11') or last_name in ('ln7', 'ln15');

select * from ice_orc;
describe formatted ice_orc;
Expand Down
22 changes: 0 additions & 22 deletions iceberg/iceberg-handler/src/test/queries/positive/iceberg_stats.q
Original file line number Diff line number Diff line change
Expand Up @@ -28,27 +28,5 @@ select count(*) from ice01;
insert overwrite table ice01 select * from ice01;
explain select count(*) from ice01;

-- false means that count(*) query won't use row count stored in HMS
set iceberg.hive.keep.stats=false;

create external table ice03 (id int, key int) Stored by Iceberg stored as ORC
TBLPROPERTIES('format-version'='2');

insert into ice03 values (1,1),(2,1),(3,1),(4,1),(5,1);
-- Iceberg table can utilize fetch task to directly retrieve the row count from iceberg SnapshotSummary
explain select count(*) from ice03;
select count(*) from ice03;

-- delete some values
delete from ice03 where id in (2,4);

explain select count(*) from ice03;
select count(*) from ice03;

-- iow
insert overwrite table ice03 select * from ice03;
explain select count(*) from ice03;

drop table ice01;
drop table ice02;
drop table ice03;
159 changes: 0 additions & 159 deletions iceberg/iceberg-handler/src/test/results/positive/iceberg_stats.q.out
Original file line number Diff line number Diff line change
Expand Up @@ -192,155 +192,6 @@ STAGE PLANS:
Processor Tree:
ListSink

PREHOOK: query: create external table ice03 (id int, key int) Stored by Iceberg stored as ORC
TBLPROPERTIES('format-version'='2')
PREHOOK: type: CREATETABLE
PREHOOK: Output: database:default
PREHOOK: Output: default@ice03
POSTHOOK: query: create external table ice03 (id int, key int) Stored by Iceberg stored as ORC
TBLPROPERTIES('format-version'='2')
POSTHOOK: type: CREATETABLE
POSTHOOK: Output: database:default
POSTHOOK: Output: default@ice03
PREHOOK: query: insert into ice03 values (1,1),(2,1),(3,1),(4,1),(5,1)
PREHOOK: type: QUERY
PREHOOK: Input: _dummy_database@_dummy_table
PREHOOK: Output: default@ice03
POSTHOOK: query: insert into ice03 values (1,1),(2,1),(3,1),(4,1),(5,1)
POSTHOOK: type: QUERY
POSTHOOK: Input: _dummy_database@_dummy_table
POSTHOOK: Output: default@ice03
PREHOOK: query: explain select count(*) from ice03
PREHOOK: type: QUERY
PREHOOK: Input: default@ice03
PREHOOK: Output: hdfs://### HDFS PATH ###
POSTHOOK: query: explain select count(*) from ice03
POSTHOOK: type: QUERY
POSTHOOK: Input: default@ice03
POSTHOOK: Output: hdfs://### HDFS PATH ###
STAGE DEPENDENCIES:
Stage-0 is a root stage

STAGE PLANS:
Stage: Stage-0
Fetch Operator
limit: 1
Processor Tree:
ListSink

PREHOOK: query: select count(*) from ice03
PREHOOK: type: QUERY
PREHOOK: Input: default@ice03
PREHOOK: Output: hdfs://### HDFS PATH ###
POSTHOOK: query: select count(*) from ice03
POSTHOOK: type: QUERY
POSTHOOK: Input: default@ice03
POSTHOOK: Output: hdfs://### HDFS PATH ###
5
PREHOOK: query: delete from ice03 where id in (2,4)
PREHOOK: type: QUERY
PREHOOK: Input: default@ice03
PREHOOK: Output: default@ice03
POSTHOOK: query: delete from ice03 where id in (2,4)
POSTHOOK: type: QUERY
POSTHOOK: Input: default@ice03
POSTHOOK: Output: default@ice03
PREHOOK: query: explain select count(*) from ice03
PREHOOK: type: QUERY
PREHOOK: Input: default@ice03
PREHOOK: Output: hdfs://### HDFS PATH ###
POSTHOOK: query: explain select count(*) from ice03
POSTHOOK: type: QUERY
POSTHOOK: Input: default@ice03
POSTHOOK: Output: hdfs://### HDFS PATH ###
STAGE DEPENDENCIES:
Stage-1 is a root stage
Stage-0 depends on stages: Stage-1

STAGE PLANS:
Stage: Stage-1
Tez
#### A masked pattern was here ####
Edges:
Reducer 2 <- Map 1 (CUSTOM_SIMPLE_EDGE)
#### A masked pattern was here ####
Vertices:
Map 1
Map Operator Tree:
TableScan
alias: ice03
Statistics: Num rows: 3 Data size: #Masked# Basic stats: COMPLETE Column stats: COMPLETE
Select Operator
Statistics: Num rows: 3 Data size: #Masked# Basic stats: COMPLETE Column stats: COMPLETE
Group By Operator
aggregations: count()
minReductionHashAggr: 0.6666666
mode: hash
outputColumnNames: _col0
Statistics: Num rows: 1 Data size: #Masked# Basic stats: COMPLETE Column stats: COMPLETE
Reduce Output Operator
null sort order:
sort order:
Statistics: Num rows: 1 Data size: #Masked# Basic stats: COMPLETE Column stats: COMPLETE
value expressions: _col0 (type: bigint)
Execution mode: vectorized
Reducer 2
Execution mode: vectorized
Reduce Operator Tree:
Group By Operator
aggregations: count(VALUE._col0)
mode: mergepartial
outputColumnNames: _col0
Statistics: Num rows: 1 Data size: #Masked# Basic stats: COMPLETE Column stats: COMPLETE
File Output Operator
compressed: false
Statistics: Num rows: 1 Data size: #Masked# Basic stats: COMPLETE Column stats: COMPLETE
table:
input format: org.apache.hadoop.mapred.SequenceFileInputFormat
output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe

Stage: Stage-0
Fetch Operator
limit: -1
Processor Tree:
ListSink

PREHOOK: query: select count(*) from ice03
PREHOOK: type: QUERY
PREHOOK: Input: default@ice03
PREHOOK: Output: hdfs://### HDFS PATH ###
POSTHOOK: query: select count(*) from ice03
POSTHOOK: type: QUERY
POSTHOOK: Input: default@ice03
POSTHOOK: Output: hdfs://### HDFS PATH ###
3
PREHOOK: query: insert overwrite table ice03 select * from ice03
PREHOOK: type: QUERY
PREHOOK: Input: default@ice03
PREHOOK: Output: default@ice03
POSTHOOK: query: insert overwrite table ice03 select * from ice03
POSTHOOK: type: QUERY
POSTHOOK: Input: default@ice03
POSTHOOK: Output: default@ice03
PREHOOK: query: explain select count(*) from ice03
PREHOOK: type: QUERY
PREHOOK: Input: default@ice03
PREHOOK: Output: hdfs://### HDFS PATH ###
POSTHOOK: query: explain select count(*) from ice03
POSTHOOK: type: QUERY
POSTHOOK: Input: default@ice03
POSTHOOK: Output: hdfs://### HDFS PATH ###
STAGE DEPENDENCIES:
Stage-0 is a root stage

STAGE PLANS:
Stage: Stage-0
Fetch Operator
limit: 1
Processor Tree:
ListSink

PREHOOK: query: drop table ice01
PREHOOK: type: DROPTABLE
PREHOOK: Input: default@ice01
Expand All @@ -361,13 +212,3 @@ POSTHOOK: type: DROPTABLE
POSTHOOK: Input: default@ice02
POSTHOOK: Output: database:default
POSTHOOK: Output: default@ice02
PREHOOK: query: drop table ice03
PREHOOK: type: DROPTABLE
PREHOOK: Input: default@ice03
PREHOOK: Output: database:default
PREHOOK: Output: default@ice03
POSTHOOK: query: drop table ice03
POSTHOOK: type: DROPTABLE
POSTHOOK: Input: default@ice03
POSTHOOK: Output: database:default
POSTHOOK: Output: default@ice03
Loading
Loading