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 f09d9c200 [doc] Move system tables to concepts
f09d9c200 is described below
commit f09d9c200a6f2d1913e7f1f318b164205d226ac0
Author: Jingsong <[email protected]>
AuthorDate: Tue Nov 19 11:20:56 2024 +0800
[doc] Move system tables to concepts
---
docs/content/concepts/spec/_index.md | 2 +-
.../{maintenance => concepts}/system-tables.md | 87 ++++++++++++----------
docs/content/concepts/table-types.md | 33 +++++++-
docs/content/flink/savepoint.md | 2 +-
.../content/primary-key-table/query-performance.md | 2 +-
docs/content/primary-key-table/table-mode.md | 2 +-
6 files changed, 81 insertions(+), 47 deletions(-)
diff --git a/docs/content/concepts/spec/_index.md
b/docs/content/concepts/spec/_index.md
index 166ce4eea..ef5f03098 100644
--- a/docs/content/concepts/spec/_index.md
+++ b/docs/content/concepts/spec/_index.md
@@ -1,7 +1,7 @@
---
title: Specification
bookCollapseSection: true
-weight: 6
+weight: 7
---
<!--
Licensed to the Apache Software Foundation (ASF) under one
diff --git a/docs/content/maintenance/system-tables.md
b/docs/content/concepts/system-tables.md
similarity index 97%
rename from docs/content/maintenance/system-tables.md
rename to docs/content/concepts/system-tables.md
index 5ef5121c2..5795aea41 100644
--- a/docs/content/maintenance/system-tables.md
+++ b/docs/content/concepts/system-tables.md
@@ -1,9 +1,9 @@
---
title: "System Tables"
-weight: 2
+weight: 6
type: docs
aliases:
-- /maintenance/system-tables.html
+- /concepts/system-tables.html
---
<!--
Licensed to the Apache Software Foundation (ASF) under one
@@ -26,9 +26,15 @@ under the License.
# System Tables
-## Table Specified System Table
+Paimon provides a very rich set of system tables to help users better analyze
and query the status of Paimon tables:
-Table specified system tables contain metadata and information about each
table, such as the snapshots created and the options in use. Users can access
system tables with batch queries.
+1. Query the status of the data table: Data System Table.
+2. Query the global status of the entire Catalog: Global System Table.
+
+## Data System Table
+
+Data System tables contain metadata and information about each Paimon data
table, such as the snapshots created and the
+options in use. Users can access system tables with batch queries.
Currently, Flink, Spark, Trino and StarRocks support querying system tables.
@@ -130,6 +136,26 @@ SELECT * FROM my_table$audit_log;
*/
```
+### Binlog Table
+
+You can query the binlog through binlog table. In the binlog system table, the
update before and update after will be packed in one row.
+
+```sql
+SELECT * FROM T$binlog;
+
+/*
++------------------+----------------------+-----------------------+
+| rowkind | column_0 | column_1 |
++------------------+----------------------+-----------------------+
+| +I | [col_0] | [col_1] |
++------------------+----------------------+-----------------------+
+| +U | [col_0_ub, col_0_ua] | [col_1_ub, col_1_ua] |
++------------------+----------------------+-----------------------+
+| -D | [col_0] | [col_1] |
++------------------+----------------------+-----------------------+
+*/
+```
+
### Read-optimized Table
If you require extreme reading performance and can accept reading slightly old
data,
@@ -347,6 +373,22 @@ SELECT * FROM my_table$buckets;
*/
```
+### Statistic Table
+You can query the statistic information through statistic table.
+
+```sql
+SELECT * FROM T$statistics;
+
+/*
++--------------+------------+-----------------------+------------------+----------+
+| snapshot_id | schema_id | mergedRecordCount | mergedRecordSize |
colstat |
++--------------+------------+-----------------------+------------------+----------+
+| 2 | 0 | 2 | 2 | {}
|
++--------------+------------+-----------------------+------------------+----------+
+1 rows in set
+*/
+```
+
## Global System Table
Global system tables contain the statistical information of all the tables
exists in paimon. For convenient of searching, we create a reference system
database called `sys`.
@@ -390,40 +432,3 @@ SELECT * FROM sys.catalog_options;
1 rows in set
*/
```
-
-### Statistic Table
-You can query the statistic information through statistic table.
-
-```sql
-SELECT * FROM T$statistics;
-
-/*
-+--------------+------------+-----------------------+------------------+----------+
-| snapshot_id | schema_id | mergedRecordCount | mergedRecordSize |
colstat |
-+--------------+------------+-----------------------+------------------+----------+
-| 2 | 0 | 2 | 2 | {}
|
-+--------------+------------+-----------------------+------------------+----------+
-1 rows in set
-*/
-```
-### Binlog Table
-
-You can query the binlog through binlog table. In the binlog system table, the
update before and update after will be packed in one row.
-
-```sql
-SELECT * FROM T$binlog;
-
-/*
-+------------------+----------------------+-----------------------+
-| rowkind | column_0 | column_1 |
-+------------------+----------------------+-----------------------+
-| +I | [col_0] | [col_1] |
-+------------------+----------------------+-----------------------+
-| +U | [col_0_ub, col_0_ua] | [col_1_ub, col_1_ua] |
-+------------------+----------------------+-----------------------+
-| -D | [col_0] | [col_1] |
-+------------------+----------------------+-----------------------+
-*/
-```
-
-
diff --git a/docs/content/concepts/table-types.md
b/docs/content/concepts/table-types.md
index 0a1ef6481..58199031b 100644
--- a/docs/content/concepts/table-types.md
+++ b/docs/content/concepts/table-types.md
@@ -94,14 +94,43 @@ CREATE TABLE my_table (
## View
-View is supported when the metastore can support view, for example, hive
metastore.
+View is supported when the metastore can support view, for example, hive
metastore. If you don't have metastore, you
+can only use temporary View, which only exists in the current session. This
chapter mainly describes persistent views.
View will currently save the original SQL. If you need to use View across
engines, you can write a cross engine
SQL statement. For example:
+{{< tabs "view" >}}
+{{< tab "Flink SQL" >}}
+
```sql
-CREATE VIEW my_view AS SELECT a + 1, b FROM my_db.my_source;
+CREATE VIEW [IF NOT EXISTS] [catalog_name.][db_name.]view_name
+ [( columnName [, columnName ]* )] [COMMENT view_comment]
+AS query_expression;
+
+DROP VIEW [IF EXISTS] [catalog_name.][db_name.]view_name;
+
+SHOW VIEWS;
+
+SHOW CREATE VIEW my_view;
```
+{{< /tab >}}
+
+{{< tab "Spark SQL" >}}
+
+```sql
+CREATE [OR REPLACE] VIEW [IF NOT EXISTS] [catalog_name.][db_name.]view_name
+ [( columnName [, columnName ]* )] [COMMENT view_comment]
+AS query_expression;
+
+DROP VIEW [IF EXISTS] [catalog_name.][db_name.]view_name;
+
+SHOW VIEWS;
+```
+
+{{< /tab >}}
+
+{{< /tabs >}}
## Format Table
diff --git a/docs/content/flink/savepoint.md b/docs/content/flink/savepoint.md
index a0934df13..b9d353c1d 100644
--- a/docs/content/flink/savepoint.md
+++ b/docs/content/flink/savepoint.md
@@ -70,7 +70,7 @@ to learn how to configure and trigger savepoint.
**Step 3: Choose the tag corresponding to the savepoint.**
The tag corresponding to the savepoint will be named in the form of
`savepoint-${savepointID}`. You can refer to
-[Tags Table]({{< ref "maintenance/system-tables#tags-table" >}}) to query.
+[Tags Table]({{< ref "concepts/system-tables#tags-table" >}}) to query.
**Step 4: Rollback the paimon table.**
diff --git a/docs/content/primary-key-table/query-performance.md
b/docs/content/primary-key-table/query-performance.md
index fd6bdeeeb..dea489936 100644
--- a/docs/content/primary-key-table/query-performance.md
+++ b/docs/content/primary-key-table/query-performance.md
@@ -33,7 +33,7 @@ The table schema has the greatest impact on query
performance. See [Table Mode](
For Merge On Read table, the most important thing you should pay attention to
is the number of buckets, which will limit
the concurrency of reading data.
-For MOW (Deletion Vectors) or COW table or [Read Optimized]({{< ref
"maintenance/system-tables#read-optimized-table" >}}) table,
+For MOW (Deletion Vectors) or COW table or [Read Optimized]({{< ref
"concepts/system-tables#read-optimized-table" >}}) table,
There is no limit to the concurrency of reading data, and they can also
utilize some filtering conditions for non-primary-key columns.
## Data Skipping By Primary Key Filter
diff --git a/docs/content/primary-key-table/table-mode.md
b/docs/content/primary-key-table/table-mode.md
index d7bc2efb9..c8cce7c8b 100644
--- a/docs/content/primary-key-table/table-mode.md
+++ b/docs/content/primary-key-table/table-mode.md
@@ -110,7 +110,7 @@ If you don't want to use Deletion Vectors mode, you want to
query fast enough in
older data, you can also:
1. Configure 'compaction.optimization-interval' when writing data.
-2. Query from [read-optimized system table]({{< ref
"maintenance/system-tables#read-optimized-table" >}}). Reading from
+2. Query from [read-optimized system table]({{< ref
"concepts/system-tables#read-optimized-table" >}}). Reading from
results of optimized files avoids merging records with the same key, thus
improving reading performance.
You can flexibly balance query performance and data latency when reading.