JingsongLi commented on code in PR #457: URL: https://github.com/apache/flink-table-store/pull/457#discussion_r1062035797
########## docs/content/docs/how-to/writing-tables.md: ########## @@ -87,3 +87,66 @@ INSERT OVERWRITE MyTable PARTITION (key1 = value1, key2 = value2, ...) SELECT .. {{< /tab >}} {{< /tabs >}} + +## Purging tables + +You can use `INSERT OVERWRITE` to purge tables by inserting empty value. + +{{< tabs "purge-tables-syntax" >}} + +{{< tab "Flink" >}} + +```sql +INSERT OVERWRITE MyTable SELECT * FROM MyTable WHERE false +``` + +{{< /tab >}} + +{{< /tabs >}} + +## Purging a Partition + +Particularly, you can use `INSERT OVERWRITE` to purge data of a partition by inserting empty value to the partition: + +{{< tabs "purge-partition-syntax" >}} + +{{< tab "Flink" >}} + +```sql +INSERT OVERWRITE MyTable PARTITION (key1 = value1, key2 = value2, ...) SELECT selectSpec FROM MyTable WHERE false +``` + +{{< /tab >}} + +{{< /tabs >}} + +{{< hint warning >}} + +The `selectSpec` should includes all the columns in the table except the partition columns behind PARTITION. Review Comment: Good, we can copy this line to above `Overwriting a Partition` too. -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org