-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HIVE-24991: Enable fetching deleted rows in vectorized mode (Krisztia…
…n Kasa, reviewed by Panos Garefalakis)
- Loading branch information
Showing
262 changed files
with
3,591 additions
and
2,780 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
343 changes: 263 additions & 80 deletions
343
ql/src/java/org/apache/hadoop/hive/ql/io/orc/VectorizedOrcAcidRowBatchReader.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
ql/src/test/queries/clientpositive/fetch_deleted_rows_vector.q
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
set hive.support.concurrency=true; | ||
set hive.txn.manager=org.apache.hadoop.hive.ql.lockmgr.DbTxnManager; | ||
|
||
|
||
create table t1(a int, b varchar(128)) stored as orc tblproperties ('transactional'='true'); | ||
|
||
insert into t1(a,b) values (1, 'one'), (2, 'two'); | ||
|
||
delete from t1 where a = 1; | ||
|
||
insert into t1(a,b) values (3, 'three'), (4, 'four'), (4, 'four again'), (5, 'five'); | ||
|
||
explain vectorization | ||
select t1.ROW__IS__DELETED, * from t1('acid.fetch.deleted.rows'='true') order by a; | ||
|
||
select t1.ROW__IS__DELETED, * from t1('acid.fetch.deleted.rows'='true') order by a; | ||
|
||
|
||
update t1 | ||
set b = 'updated' | ||
where a = 3; | ||
|
||
select t1.ROW__IS__DELETED, * from t1('acid.fetch.deleted.rows'='true') order by a; | ||
|
||
|
||
create table t2(a int, c float) stored as orc tblproperties ('transactional'='true'); | ||
|
||
insert into t2(a,c) values (1, 1.0), (2, 2.0), (3, 3.3), (4, 4.4), (4, 4.5), (5, 5.5); | ||
|
||
select t1.*, t2.* from t1 | ||
join t2 on t1.a = t2.a | ||
order by t1.a; | ||
|
||
select t1.ROW__IS__DELETED, t1.*, t2.ROW__IS__DELETED, t2.* from t1('acid.fetch.deleted.rows'='true') | ||
join t2('acid.fetch.deleted.rows'='true') on t1.a = t2.a | ||
order by t1.a; | ||
|
||
delete from t2 where a in (1, 4); | ||
|
||
select t1.*, t2.* from t1 | ||
join t2 on t1.a = t2.a | ||
order by t1.a; | ||
|
||
explain vectorization | ||
select t1.ROW__IS__DELETED, t1.ROW__ID.writeId, t1.*, t2.ROW__IS__DELETED, t2.ROW__ID.writeId, t2.* from t1('acid.fetch.deleted.rows'='true') | ||
join t2('acid.fetch.deleted.rows'='true') on t1.a = t2.a | ||
order by t1.a; | ||
|
||
select t1.ROW__IS__DELETED, t1.ROW__ID.writeId, t1.*, t2.ROW__IS__DELETED, t2.ROW__ID.writeId, t2.* from t1('acid.fetch.deleted.rows'='true') | ||
join t2('acid.fetch.deleted.rows'='true') on t1.a = t2.a | ||
order by t1.a; | ||
|
||
set hive.transactional.events.mem=0; | ||
|
||
select t1.ROW__IS__DELETED, t1.ROW__ID.writeId, t1.*, t2.ROW__IS__DELETED, t2.ROW__ID.writeId, t2.* from t1('acid.fetch.deleted.rows'='true') | ||
join t2('acid.fetch.deleted.rows'='true') on t1.a = t2.a | ||
order by t1.a; |
Oops, something went wrong.