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

Support passing partition value as a parameter to ALTER TABLE t DROP PARTITION #49449

Closed
davenger opened this issue May 3, 2023 · 0 comments · Fixed by #49516 or #55604
Closed

Support passing partition value as a parameter to ALTER TABLE t DROP PARTITION #49449

davenger opened this issue May 3, 2023 · 0 comments · Fixed by #49516 or #55604
Assignees
Labels

Comments

@davenger
Copy link
Member

davenger commented May 3, 2023

Currently partition can be passed as a parameter only inside tuple() function

ALTER TABLE test DROP PARTITION tuple(toMonday({partition:Date}));

But users would prefer to be able to pass it directly:

ALTER TABLE test DROP PARTITION {partition:String};
ALTER TABLE test DROP PARTITION {partition:Date};

Here are the steps

CREATE OR REPLACE TABLE default.test
(

   EventDate Date
)
ENGINE = MergeTree
ORDER BY tuple()
PARTITION BY toMonday(EventDate);


ALTER TABLE test DROP PARTITION '2023-04-10'; -- works


SET param_table=test;
ALTER TABLE {table:Identifier} DROP PARTITION '2023-04-10' -- works;


SET param_partition='2023-04-10';

ALTER TABLE test DROP PARTITION tuple(toMonday({partition:Date})); -- works

ALTER TABLE test DROP PARTITION {partition:Identifier}; -- doesn't work
ALTER TABLE test DROP PARTITION '{partition:Identifier}'; -- doesn't work
ALTER TABLE test DROP PARTITION {partition:String}; -- doesn't work
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants