Hello. I have a table divided into partitions by date. I want to delete the oldest partition (I calculate the value of this partition so: SELECT MAX (CAST(time AS DATE)) FROM mytable;
Now I want to delete this partition, I try like this: SELECT DROP_PARTITIONS ('mytable','SELECT MAX (CAST(time AS DATE)) FROM mytable','SELECT MAX (CAST(time AS DATE)) FROM mytable');
But I get an error:
Failed to convert to internal form: Invalid input syntax for date
ERROR 3721: Invalid partition key
How can I use query in DROP_PARTITIONS?