This is an automated email from the ASF dual-hosted git repository.
lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/paimon.git
The following commit(s) were added to refs/heads/master by this push:
new 52f2570f6 [doc] Update Dedicated Compaction Job doc to add call
procedure (#3793)
52f2570f6 is described below
commit 52f2570f6d20ed5e0463ce5076ec9ac4b02b9318
Author: herefree <[email protected]>
AuthorDate: Tue Jul 23 17:44:29 2024 +0800
[doc] Update Dedicated Compaction Job doc to add call procedure (#3793)
---
docs/content/maintenance/dedicated-compaction.md | 63 ++++++++++++++++++++++--
1 file changed, 59 insertions(+), 4 deletions(-)
diff --git a/docs/content/maintenance/dedicated-compaction.md
b/docs/content/maintenance/dedicated-compaction.md
index dab957da1..2c333c6ea 100644
--- a/docs/content/maintenance/dedicated-compaction.md
+++ b/docs/content/maintenance/dedicated-compaction.md
@@ -81,9 +81,7 @@ To run a dedicated job for compaction, follow these
instructions.
{{< tabs "dedicated-compaction-job" >}}
-{{< tab "Flink" >}}
-
-Flink SQL currently does not support statements related to compactions, so we
have to submit the compaction job through `flink run`.
+{{< tab "Flink Action Jar" >}}
Run the following command to submit a compaction job for the table.
@@ -130,6 +128,25 @@ For more usage of the compact action, see
{{< /tab >}}
+{{< tab "Flink" >}}
+
+Run the following sql:
+
+```sql
+-- compact table
+CALL sys.compact(`table` => 'default.T');
+
+-- compact table with options
+CALL sys.compact(`table` => 'default.T', `options` => 'sink.parallelism=4');
+
+-- compact table partition
+CALL sys.compact(`table` => 'default.T', `partitions` => 'p=0');
+
+-- compact table partition with filter
+CALL sys.compact(`table` => 'default.T', `where` => 'dt>10 and h<20');
+```
+{{< /tab >}}
+
{{< /tabs >}}
{{< hint info >}}
@@ -143,7 +160,7 @@ You can run the following command to submit a compaction
job for multiple databa
{{< tabs "database-compaction-job" >}}
-{{< tab "Flink" >}}
+{{< tab "Flink Action Jar" >}}
```bash
<FLINK_HOME>/bin/flink run \
@@ -226,6 +243,26 @@ For more usage of the compact_database action, see
{{< /tab >}}
+{{< tab "Flink" >}}
+
+Run the following sql:
+
+```sql
+CALL sys.compact_database('includingDatabases')
+
+CALL sys.compact_database('includingDatabases', 'mode')
+
+CALL sys.compact_database('includingDatabases', 'mode', 'includingTables')
+
+CALL sys.compact_database('includingDatabases', 'mode', 'includingTables',
'excludingTables')
+
+CALL sys.compact_database('includingDatabases', 'mode', 'includingTables',
'excludingTables', 'tableOptions')
+
+-- example
+CALL sys.compact_database('db1|db2', 'combined', 'table_.*', 'ignore',
'sink.parallelism=4')
+```
+{{< /tab >}}
+
{{< /tabs >}}
## Sort Compact
@@ -234,6 +271,10 @@ If your table is configured with [dynamic bucket primary
key table]({{< ref "pri
or [append table]({{< ref "append-table/overview" >}}) ,
you can trigger a compact with specified column sort to speed up queries.
+{{< tabs "database-compaction-job" >}}
+
+{{< tab "Flink Action Jar" >}}
+
```bash
<FLINK_HOME>/bin/flink run \
-D execution.runtime-mode=batch \
@@ -253,3 +294,17 @@ There are two new configuration in `Sort Compact`
The sort parallelism is the same as the sink parallelism, you can dynamically
specify it by add conf `--table_conf sink.parallelism=<value>`.
+{{< /tab >}}
+
+{{< tab "Flink" >}}
+
+Run the following sql:
+
+```sql
+-- sort compact table
+CALL sys.compact(`table` => 'default.T', order_strategy => 'zorder', order_by
=> 'a,b')
+```
+{{< /tab >}}
+
+{{< /tabs >}}
+