chenruotao opened a new pull request, #41090:
URL: https://github.com/apache/spark/pull/41090
Now spark sql cannot drop multiple partitions in one call, so I fix it
With this patch we can drop multiple partitions like this :
alter table test.table_partition drop partition(dt<='2023-04-02',
dt>='2023-03-31')
this is my test demo with hms
1、insert five data into partitioned table test.table_partition
insert into table test.table_partition partition(dt='2023-03-30')
values('chenruotao','100');
insert into table test.table_partition partition(dt='2023-03-31')
values('chenruotao','100');
insert into table test.table_partition partition(dt='2023-04-01')
values('chenruotao','100');
insert into table test.table_partition partition(dt='2023-04-02')
values('chenruotao','100');
insert into table test.table_partition partition(dt='2023-04-03')
values('chenruotao','100');
<img width="420" alt="image"
src="https://user-images.githubusercontent.com/20615138/236775512-d54fa998-7f0b-40d9-ae30-7c2de6e7facc.png">
2、execute sql to drop multiple partitions:
alter table test.table_partition drop partition(dt<='2023-04-02',
dt>='2023-03-31');
<img width="394" alt="image"
src="https://user-images.githubusercontent.com/20615138/236775777-2ba14634-0a87-4fee-a819-38774273fb1e.png">
3、execute sql to drop one partitions:
alter table test.table_partition drop partition(dt='2023-03-30');
<img width="321" alt="image"
src="https://user-images.githubusercontent.com/20615138/236775891-ea53f3fb-e670-4cdc-8765-45d56d5d156e.png">
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]