Skip to content

Commit 26d22d0

Browse files
committed
HIVE-28059 : major rebase stage 1;
1 parent a14a1e1 commit 26d22d0

File tree

9 files changed

+42
-296
lines changed

9 files changed

+42
-296
lines changed

iceberg/iceberg-handler/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergBranchOperation.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -231,12 +231,12 @@ public void testCreateBranchFromTag() throws IOException, InterruptedException {
231231
// Create a branch based on a tag which doesn't exist will fail.
232232
Assertions.assertThatThrownBy(() -> shell.executeStatement(String.format(
233233
"ALTER TABLE customers CREATE BRANCH %s FOR TAG AS OF %s", branchName2, nonExistTag)))
234-
.isInstanceOf(IllegalArgumentException.class).hasMessageContaining("does not exist");
234+
.isInstanceOf(IllegalArgumentException.class).hasMessageEndingWith("does not exist");
235235

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

242242
@Test

iceberg/iceberg-handler/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergStorageHandlerNoScan.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ public void testCreateTableError() {
700700
"')"))
701701
.isInstanceOf(IllegalArgumentException.class)
702702
.hasMessageStartingWith("Failed to execute Hive query")
703-
.hasMessageContaining("Table location not set");
703+
.hasMessageEndingWith("Table location not set");
704704
}
705705
}
706706

@@ -775,7 +775,7 @@ public void testCreatePartitionedTableWithPropertiesAndWithColumnSpecification()
775775
"')"))
776776
.isInstanceOf(IllegalArgumentException.class)
777777
.hasMessageStartingWith("Failed to execute Hive query")
778-
.hasMessageContaining(
778+
.hasMessageEndingWith(
779779
"Provide only one of the following: Hive partition transform specification, " +
780780
"or the iceberg.mr.table.partition.spec property");
781781
}

iceberg/iceberg-handler/src/test/queries/positive/iceberg_major_compaction_partition_evolution_w_id_spec_w_filter.q

+2-17
Original file line numberDiff line numberDiff line change
@@ -65,26 +65,11 @@ delete from ice_orc where last_name in ('ln1', 'ln9');
6565
delete from ice_orc where last_name in ('ln3', 'ln11');
6666
delete from ice_orc where last_name in ('ln5', 'ln13');
6767

68-
alter table ice_orc set partition spec(team_id);
69-
insert into ice_orc VALUES
70-
('fn17', 'ln17', 1, 10, 100),
71-
('fn18','ln18', 1, 10, 100);
72-
insert into ice_orc VALUES
73-
('fn19','ln19', 2, 11, 100),
74-
('fn20','ln20', 2, 11, 100);
75-
insert into ice_orc VALUES
76-
('fn21','ln21', 3, 12, 100),
77-
('fn22','ln22', 3, 12, 100);
78-
insert into ice_orc VALUES
79-
('fn23','ln23', 4, 13, 100),
80-
('fn24','ln24', 4, 13, 100);
81-
82-
8368
select * from ice_orc;
8469
describe formatted ice_orc;
8570

86-
explain alter table ice_orc COMPACT 'major' and wait where company_id=100 or dept_id in (1,2);
87-
alter table ice_orc COMPACT 'major' and wait where company_id=100 or dept_id in (1,2);
71+
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');
72+
alter table ice_orc COMPACT 'major' and wait where team_id=10 or first_name in ('fn3', 'fn11') or last_name in ('ln7', 'ln15');
8873

8974
select * from ice_orc;
9075
describe formatted ice_orc;

iceberg/iceberg-handler/src/test/queries/positive/iceberg_stats.q

-22
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,5 @@ select count(*) from ice01;
2828
insert overwrite table ice01 select * from ice01;
2929
explain select count(*) from ice01;
3030

31-
-- false means that count(*) query won't use row count stored in HMS
32-
set iceberg.hive.keep.stats=false;
33-
34-
create external table ice03 (id int, key int) Stored by Iceberg stored as ORC
35-
TBLPROPERTIES('format-version'='2');
36-
37-
insert into ice03 values (1,1),(2,1),(3,1),(4,1),(5,1);
38-
-- Iceberg table can utilize fetch task to directly retrieve the row count from iceberg SnapshotSummary
39-
explain select count(*) from ice03;
40-
select count(*) from ice03;
41-
42-
-- delete some values
43-
delete from ice03 where id in (2,4);
44-
45-
explain select count(*) from ice03;
46-
select count(*) from ice03;
47-
48-
-- iow
49-
insert overwrite table ice03 select * from ice03;
50-
explain select count(*) from ice03;
51-
5231
drop table ice01;
5332
drop table ice02;
54-
drop table ice03;

iceberg/iceberg-handler/src/test/results/positive/iceberg_stats.q.out

-159
Original file line numberDiff line numberDiff line change
@@ -192,155 +192,6 @@ STAGE PLANS:
192192
Processor Tree:
193193
ListSink
194194

195-
PREHOOK: query: create external table ice03 (id int, key int) Stored by Iceberg stored as ORC
196-
TBLPROPERTIES('format-version'='2')
197-
PREHOOK: type: CREATETABLE
198-
PREHOOK: Output: database:default
199-
PREHOOK: Output: default@ice03
200-
POSTHOOK: query: create external table ice03 (id int, key int) Stored by Iceberg stored as ORC
201-
TBLPROPERTIES('format-version'='2')
202-
POSTHOOK: type: CREATETABLE
203-
POSTHOOK: Output: database:default
204-
POSTHOOK: Output: default@ice03
205-
PREHOOK: query: insert into ice03 values (1,1),(2,1),(3,1),(4,1),(5,1)
206-
PREHOOK: type: QUERY
207-
PREHOOK: Input: _dummy_database@_dummy_table
208-
PREHOOK: Output: default@ice03
209-
POSTHOOK: query: insert into ice03 values (1,1),(2,1),(3,1),(4,1),(5,1)
210-
POSTHOOK: type: QUERY
211-
POSTHOOK: Input: _dummy_database@_dummy_table
212-
POSTHOOK: Output: default@ice03
213-
PREHOOK: query: explain select count(*) from ice03
214-
PREHOOK: type: QUERY
215-
PREHOOK: Input: default@ice03
216-
PREHOOK: Output: hdfs://### HDFS PATH ###
217-
POSTHOOK: query: explain select count(*) from ice03
218-
POSTHOOK: type: QUERY
219-
POSTHOOK: Input: default@ice03
220-
POSTHOOK: Output: hdfs://### HDFS PATH ###
221-
STAGE DEPENDENCIES:
222-
Stage-0 is a root stage
223-
224-
STAGE PLANS:
225-
Stage: Stage-0
226-
Fetch Operator
227-
limit: 1
228-
Processor Tree:
229-
ListSink
230-
231-
PREHOOK: query: select count(*) from ice03
232-
PREHOOK: type: QUERY
233-
PREHOOK: Input: default@ice03
234-
PREHOOK: Output: hdfs://### HDFS PATH ###
235-
POSTHOOK: query: select count(*) from ice03
236-
POSTHOOK: type: QUERY
237-
POSTHOOK: Input: default@ice03
238-
POSTHOOK: Output: hdfs://### HDFS PATH ###
239-
5
240-
PREHOOK: query: delete from ice03 where id in (2,4)
241-
PREHOOK: type: QUERY
242-
PREHOOK: Input: default@ice03
243-
PREHOOK: Output: default@ice03
244-
POSTHOOK: query: delete from ice03 where id in (2,4)
245-
POSTHOOK: type: QUERY
246-
POSTHOOK: Input: default@ice03
247-
POSTHOOK: Output: default@ice03
248-
PREHOOK: query: explain select count(*) from ice03
249-
PREHOOK: type: QUERY
250-
PREHOOK: Input: default@ice03
251-
PREHOOK: Output: hdfs://### HDFS PATH ###
252-
POSTHOOK: query: explain select count(*) from ice03
253-
POSTHOOK: type: QUERY
254-
POSTHOOK: Input: default@ice03
255-
POSTHOOK: Output: hdfs://### HDFS PATH ###
256-
STAGE DEPENDENCIES:
257-
Stage-1 is a root stage
258-
Stage-0 depends on stages: Stage-1
259-
260-
STAGE PLANS:
261-
Stage: Stage-1
262-
Tez
263-
#### A masked pattern was here ####
264-
Edges:
265-
Reducer 2 <- Map 1 (CUSTOM_SIMPLE_EDGE)
266-
#### A masked pattern was here ####
267-
Vertices:
268-
Map 1
269-
Map Operator Tree:
270-
TableScan
271-
alias: ice03
272-
Statistics: Num rows: 3 Data size: #Masked# Basic stats: COMPLETE Column stats: COMPLETE
273-
Select Operator
274-
Statistics: Num rows: 3 Data size: #Masked# Basic stats: COMPLETE Column stats: COMPLETE
275-
Group By Operator
276-
aggregations: count()
277-
minReductionHashAggr: 0.6666666
278-
mode: hash
279-
outputColumnNames: _col0
280-
Statistics: Num rows: 1 Data size: #Masked# Basic stats: COMPLETE Column stats: COMPLETE
281-
Reduce Output Operator
282-
null sort order:
283-
sort order:
284-
Statistics: Num rows: 1 Data size: #Masked# Basic stats: COMPLETE Column stats: COMPLETE
285-
value expressions: _col0 (type: bigint)
286-
Execution mode: vectorized
287-
Reducer 2
288-
Execution mode: vectorized
289-
Reduce Operator Tree:
290-
Group By Operator
291-
aggregations: count(VALUE._col0)
292-
mode: mergepartial
293-
outputColumnNames: _col0
294-
Statistics: Num rows: 1 Data size: #Masked# Basic stats: COMPLETE Column stats: COMPLETE
295-
File Output Operator
296-
compressed: false
297-
Statistics: Num rows: 1 Data size: #Masked# Basic stats: COMPLETE Column stats: COMPLETE
298-
table:
299-
input format: org.apache.hadoop.mapred.SequenceFileInputFormat
300-
output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat
301-
serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe
302-
303-
Stage: Stage-0
304-
Fetch Operator
305-
limit: -1
306-
Processor Tree:
307-
ListSink
308-
309-
PREHOOK: query: select count(*) from ice03
310-
PREHOOK: type: QUERY
311-
PREHOOK: Input: default@ice03
312-
PREHOOK: Output: hdfs://### HDFS PATH ###
313-
POSTHOOK: query: select count(*) from ice03
314-
POSTHOOK: type: QUERY
315-
POSTHOOK: Input: default@ice03
316-
POSTHOOK: Output: hdfs://### HDFS PATH ###
317-
3
318-
PREHOOK: query: insert overwrite table ice03 select * from ice03
319-
PREHOOK: type: QUERY
320-
PREHOOK: Input: default@ice03
321-
PREHOOK: Output: default@ice03
322-
POSTHOOK: query: insert overwrite table ice03 select * from ice03
323-
POSTHOOK: type: QUERY
324-
POSTHOOK: Input: default@ice03
325-
POSTHOOK: Output: default@ice03
326-
PREHOOK: query: explain select count(*) from ice03
327-
PREHOOK: type: QUERY
328-
PREHOOK: Input: default@ice03
329-
PREHOOK: Output: hdfs://### HDFS PATH ###
330-
POSTHOOK: query: explain select count(*) from ice03
331-
POSTHOOK: type: QUERY
332-
POSTHOOK: Input: default@ice03
333-
POSTHOOK: Output: hdfs://### HDFS PATH ###
334-
STAGE DEPENDENCIES:
335-
Stage-0 is a root stage
336-
337-
STAGE PLANS:
338-
Stage: Stage-0
339-
Fetch Operator
340-
limit: 1
341-
Processor Tree:
342-
ListSink
343-
344195
PREHOOK: query: drop table ice01
345196
PREHOOK: type: DROPTABLE
346197
PREHOOK: Input: default@ice01
@@ -361,13 +212,3 @@ POSTHOOK: type: DROPTABLE
361212
POSTHOOK: Input: default@ice02
362213
POSTHOOK: Output: database:default
363214
POSTHOOK: Output: default@ice02
364-
PREHOOK: query: drop table ice03
365-
PREHOOK: type: DROPTABLE
366-
PREHOOK: Input: default@ice03
367-
PREHOOK: Output: database:default
368-
PREHOOK: Output: default@ice03
369-
POSTHOOK: query: drop table ice03
370-
POSTHOOK: type: DROPTABLE
371-
POSTHOOK: Input: default@ice03
372-
POSTHOOK: Output: database:default
373-
POSTHOOK: Output: default@ice03

0 commit comments

Comments
 (0)