You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2023/01/05 01:57:50 UTC

[GitHub] [flink-table-store] JingsongLi commented on a diff in pull request #457: [FLINK-30560] Add more description of 'Overwriting a Partition' to doc 'Writing Tables'

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-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org