-
Notifications
You must be signed in to change notification settings - Fork 4.8k
HIVE-28903: Skip deleting archived path when drop partition/table #5769
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,28 @@ | ||
set hive.mapred.mode=nonstrict; | ||
set hive.archive.enabled = true; | ||
|
||
create database test_db; | ||
|
||
create table test_db.test_tbl (id int, name string) partitioned by (dt date, hr string); | ||
|
||
insert overwrite table test_db.test_tbl partition (dt='2025-04-01', hr='11') select 1, 'tom'; | ||
insert overwrite table test_db.test_tbl partition (dt='2025-04-01', hr='12') select 2, 'jerry'; | ||
insert overwrite table test_db.test_tbl partition (dt='2025-04-01', hr='13') select 3, 'spike'; | ||
|
||
show partitions test_db.test_tbl; | ||
|
||
alter table test_db.test_tbl archive partition (dt='2025-04-01'); | ||
dfs -ls ${hiveconf:hive.metastore.warehouse.dir}/test_db.db/test_tbl/dt=2025-04-01/; | ||
dfs -ls ${hiveconf:hive.metastore.warehouse.dir}/test_db.db/test_tbl/dt=2025-04-01/data.har/; | ||
|
||
show partitions test_db.test_tbl; | ||
|
||
alter table test_db.test_tbl drop partition (dt='2025-04-01',hr='12'); | ||
dfs -ls ${hiveconf:hive.metastore.warehouse.dir}/test_db.db/test_tbl/dt=2025-04-01/; | ||
dfs -ls ${hiveconf:hive.metastore.warehouse.dir}/test_db.db/test_tbl/dt=2025-04-01/data.har/; | ||
|
||
show partitions test_db.test_tbl; | ||
|
||
select * from test_db.test_tbl; | ||
|
||
drop table test_db.test_tbl; | ||
122 changes: 122 additions & 0 deletions
122
ql/src/test/results/clientpositive/llap/archive_drop.q.out
This file contains hidden or 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,122 @@ | ||
PREHOOK: query: create database test_db | ||
PREHOOK: type: CREATEDATABASE | ||
PREHOOK: Output: database:test_db | ||
POSTHOOK: query: create database test_db | ||
POSTHOOK: type: CREATEDATABASE | ||
POSTHOOK: Output: database:test_db | ||
PREHOOK: query: create table test_db.test_tbl (id int, name string) partitioned by (dt date, hr string) | ||
PREHOOK: type: CREATETABLE | ||
PREHOOK: Output: database:test_db | ||
PREHOOK: Output: test_db@test_tbl | ||
POSTHOOK: query: create table test_db.test_tbl (id int, name string) partitioned by (dt date, hr string) | ||
POSTHOOK: type: CREATETABLE | ||
POSTHOOK: Output: database:test_db | ||
POSTHOOK: Output: test_db@test_tbl | ||
PREHOOK: query: insert overwrite table test_db.test_tbl partition (dt='2025-04-01', hr='11') select 1, 'tom' | ||
PREHOOK: type: QUERY | ||
PREHOOK: Input: _dummy_database@_dummy_table | ||
PREHOOK: Output: test_db@test_tbl@dt=2025-04-01/hr=11 | ||
POSTHOOK: query: insert overwrite table test_db.test_tbl partition (dt='2025-04-01', hr='11') select 1, 'tom' | ||
POSTHOOK: type: QUERY | ||
POSTHOOK: Input: _dummy_database@_dummy_table | ||
POSTHOOK: Output: test_db@test_tbl@dt=2025-04-01/hr=11 | ||
POSTHOOK: Lineage: test_tbl PARTITION(dt=2025-04-01,hr=11).id SIMPLE [] | ||
POSTHOOK: Lineage: test_tbl PARTITION(dt=2025-04-01,hr=11).name SIMPLE [] | ||
PREHOOK: query: insert overwrite table test_db.test_tbl partition (dt='2025-04-01', hr='12') select 2, 'jerry' | ||
PREHOOK: type: QUERY | ||
PREHOOK: Input: _dummy_database@_dummy_table | ||
PREHOOK: Output: test_db@test_tbl@dt=2025-04-01/hr=12 | ||
POSTHOOK: query: insert overwrite table test_db.test_tbl partition (dt='2025-04-01', hr='12') select 2, 'jerry' | ||
POSTHOOK: type: QUERY | ||
POSTHOOK: Input: _dummy_database@_dummy_table | ||
POSTHOOK: Output: test_db@test_tbl@dt=2025-04-01/hr=12 | ||
POSTHOOK: Lineage: test_tbl PARTITION(dt=2025-04-01,hr=12).id SIMPLE [] | ||
POSTHOOK: Lineage: test_tbl PARTITION(dt=2025-04-01,hr=12).name SIMPLE [] | ||
PREHOOK: query: insert overwrite table test_db.test_tbl partition (dt='2025-04-01', hr='13') select 3, 'spike' | ||
PREHOOK: type: QUERY | ||
PREHOOK: Input: _dummy_database@_dummy_table | ||
PREHOOK: Output: test_db@test_tbl@dt=2025-04-01/hr=13 | ||
POSTHOOK: query: insert overwrite table test_db.test_tbl partition (dt='2025-04-01', hr='13') select 3, 'spike' | ||
POSTHOOK: type: QUERY | ||
POSTHOOK: Input: _dummy_database@_dummy_table | ||
POSTHOOK: Output: test_db@test_tbl@dt=2025-04-01/hr=13 | ||
POSTHOOK: Lineage: test_tbl PARTITION(dt=2025-04-01,hr=13).id SIMPLE [] | ||
POSTHOOK: Lineage: test_tbl PARTITION(dt=2025-04-01,hr=13).name SIMPLE [] | ||
PREHOOK: query: show partitions test_db.test_tbl | ||
PREHOOK: type: SHOWPARTITIONS | ||
PREHOOK: Input: test_db@test_tbl | ||
POSTHOOK: query: show partitions test_db.test_tbl | ||
POSTHOOK: type: SHOWPARTITIONS | ||
POSTHOOK: Input: test_db@test_tbl | ||
dt=2025-04-01/hr=11 | ||
dt=2025-04-01/hr=12 | ||
dt=2025-04-01/hr=13 | ||
PREHOOK: query: alter table test_db.test_tbl archive partition (dt='2025-04-01') | ||
PREHOOK: type: ALTERTABLE_ARCHIVE | ||
PREHOOK: Input: test_db@test_tbl | ||
PREHOOK: Output: test_db@test_tbl@dt=2025-04-01/hr=11 | ||
PREHOOK: Output: test_db@test_tbl@dt=2025-04-01/hr=12 | ||
PREHOOK: Output: test_db@test_tbl@dt=2025-04-01/hr=13 | ||
POSTHOOK: query: alter table test_db.test_tbl archive partition (dt='2025-04-01') | ||
POSTHOOK: type: ALTERTABLE_ARCHIVE | ||
POSTHOOK: Input: test_db@test_tbl | ||
POSTHOOK: Output: test_db@test_tbl@dt=2025-04-01/hr=11 | ||
POSTHOOK: Output: test_db@test_tbl@dt=2025-04-01/hr=12 | ||
POSTHOOK: Output: test_db@test_tbl@dt=2025-04-01/hr=13 | ||
Found 1 items | ||
#### A masked pattern was here #### | ||
Found 4 items | ||
#### A masked pattern was here #### | ||
PREHOOK: query: show partitions test_db.test_tbl | ||
PREHOOK: type: SHOWPARTITIONS | ||
PREHOOK: Input: test_db@test_tbl | ||
POSTHOOK: query: show partitions test_db.test_tbl | ||
POSTHOOK: type: SHOWPARTITIONS | ||
POSTHOOK: Input: test_db@test_tbl | ||
dt=2025-04-01/hr=11 | ||
dt=2025-04-01/hr=12 | ||
dt=2025-04-01/hr=13 | ||
PREHOOK: query: alter table test_db.test_tbl drop partition (dt='2025-04-01',hr='12') | ||
PREHOOK: type: ALTERTABLE_DROPPARTS | ||
PREHOOK: Input: test_db@test_tbl | ||
PREHOOK: Output: test_db@test_tbl@dt=2025-04-01/hr=12 | ||
POSTHOOK: query: alter table test_db.test_tbl drop partition (dt='2025-04-01',hr='12') | ||
POSTHOOK: type: ALTERTABLE_DROPPARTS | ||
POSTHOOK: Input: test_db@test_tbl | ||
POSTHOOK: Output: test_db@test_tbl@dt=2025-04-01/hr=12 | ||
Found 1 items | ||
#### A masked pattern was here #### | ||
Found 4 items | ||
#### A masked pattern was here #### | ||
PREHOOK: query: show partitions test_db.test_tbl | ||
PREHOOK: type: SHOWPARTITIONS | ||
PREHOOK: Input: test_db@test_tbl | ||
POSTHOOK: query: show partitions test_db.test_tbl | ||
POSTHOOK: type: SHOWPARTITIONS | ||
POSTHOOK: Input: test_db@test_tbl | ||
dt=2025-04-01/hr=11 | ||
dt=2025-04-01/hr=13 | ||
PREHOOK: query: select * from test_db.test_tbl | ||
PREHOOK: type: QUERY | ||
PREHOOK: Input: test_db@test_tbl | ||
PREHOOK: Input: test_db@test_tbl@dt=2025-04-01/hr=11 | ||
PREHOOK: Input: test_db@test_tbl@dt=2025-04-01/hr=13 | ||
#### A masked pattern was here #### | ||
POSTHOOK: query: select * from test_db.test_tbl | ||
POSTHOOK: type: QUERY | ||
POSTHOOK: Input: test_db@test_tbl | ||
POSTHOOK: Input: test_db@test_tbl@dt=2025-04-01/hr=11 | ||
POSTHOOK: Input: test_db@test_tbl@dt=2025-04-01/hr=13 | ||
#### A masked pattern was here #### | ||
1 tom 2025-04-01 11 | ||
3 spike 2025-04-01 13 | ||
PREHOOK: query: drop table test_db.test_tbl | ||
PREHOOK: type: DROPTABLE | ||
PREHOOK: Input: test_db@test_tbl | ||
PREHOOK: Output: database:test_db | ||
PREHOOK: Output: test_db@test_tbl | ||
POSTHOOK: query: drop table test_db.test_tbl | ||
POSTHOOK: type: DROPTABLE | ||
POSTHOOK: Input: test_db@test_tbl | ||
POSTHOOK: Output: database:test_db | ||
POSTHOOK: Output: test_db@test_tbl |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.