You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by lz...@apache.org on 2022/12/12 09:55:40 UTC

[flink-table-store] branch master updated: [FLINK-30341] Document audit log table

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/flink-table-store.git


The following commit(s) were added to refs/heads/master by this push:
     new 23b523cd [FLINK-30341] Document audit log table
23b523cd is described below

commit 23b523cd47bd08dfd9ad8ba402af3720f097b538
Author: Jingsong Lee <ji...@gmail.com>
AuthorDate: Mon Dec 12 17:55:35 2022 +0800

    [FLINK-30341] Document audit log table
    
    This closes #431
---
 docs/content/docs/development/query-table.md | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/docs/content/docs/development/query-table.md b/docs/content/docs/development/query-table.md
index d65c761c..fb33239e 100644
--- a/docs/content/docs/development/query-table.md
+++ b/docs/content/docs/development/query-table.md
@@ -153,3 +153,31 @@ SELECT * FROM MyTable$options;
 +------------------------+--------------------+
 1 rows in set
 ```
+
+## Audit log Table
+
+If you need to audit the changelog of the table, you can use the `audit_log` to
+stream read table. Through `audit_log` table, you can get the `rowkind` column
+when you get the incremental data of the table. You can use this column for
+filtering and other operations to complete the audit.
+
+There are four values for `rowkind`:
+- `+I` Insertion operation.
+- `-U` Update operation with the previous content of the updated row.
+- `+U` Update operation with new content of the updated row.
+- `-D` Deletion operation.
+
+```sql
+SELECT * FROM MyTable$audit_log;
+
++------------------+-----------------+-----------------+
+|     rowkind      |     column_0    |     column_1    |
++------------------+-----------------+-----------------+
+|        +I        |      ...        |      ...        |
++------------------+-----------------+-----------------+
+|        -U        |      ...        |      ...        |
++------------------+-----------------+-----------------+
+|        +U        |      ...        |      ...        |
++------------------+-----------------+-----------------+
+3 rows in set
+```