Skip to content

Commit

Permalink
[doc] Introduce learn paimon doc
Browse files Browse the repository at this point in the history
  • Loading branch information
JingsongLi committed Dec 4, 2023
1 parent 33f8d5f commit 1758644
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 46 deletions.
25 changes: 25 additions & 0 deletions docs/content/learn-paimon/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
title: Learn Paimon
icon: <i class="fa fa-sitemap title maindish" aria-hidden="true"></i>
bold: true
bookCollapseSection: true
weight: 10
---
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
title: "Understand Files"
weight: 99
weight: 1
type: docs
aliases:
- /maintenance/understand-files.html
- /learn-paimon/understand-files.html
---
<!--
Licensed to the Apache Software Foundation (ASF) under one
Expand Down Expand Up @@ -337,50 +337,6 @@ expiration looks like:
As a result, partition `20230503` to `20230510` are physically deleted.
### Remove Orphan Files
Paimon files are deleted physically only when expiring snapshots. However, it is possible that some unexpected errors occurred
when deleting files, so that there may exist files that are not used by Paimon table (so-called "orphan files"). You can
submit a `remove-orphan-files` job to clean them:
{{< tabs "remove-orphan-files" >}}
{{< tab "Flink" >}}
```bash
<FLINK_HOME>/bin/flink run \
/path/to/paimon-flink-action-{{< version >}}.jar \
remove-orphan-files \
--warehouse <warehouse-path> \
--database <database-name> \
--table <table-name> \
[--older_than <timestamp>]
```
To avoid deleting files that are newly added by other writing jobs, this action only deletes orphan files older than
1 day by default. The interval can be modified by `--older_than`. For example:
```bash
<FLINK_HOME>/bin/flink run \
/path/to/paimon-flink-action-{{< version >}}.jar \
remove-orphan-files \
--warehouse <warehouse-path> \
--database <database-name> \
--table T \
--older_than '2023-10-31 12:00:00'
```
{{< /tab >}}
{{< tab "Spark" >}}
```sql
CALL sys.remove_orphan_files(table => "tableId", [older_then => "2023-10-31 12:00:00"])
```
{{< /tab >}}
{{< /tabs >}}
### Flink Stream Write
Finally, we will examine Flink Stream Write by utilizing the example
Expand Down
43 changes: 43 additions & 0 deletions docs/content/maintenance/manage-snapshots.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,4 +286,47 @@ CALL rollback(table => 'test.T', version => '2');
{{< /tab >}}
{{< /tabs >}}
## Remove Orphan Files
Paimon files are deleted physically only when expiring snapshots. However, it is possible that some unexpected errors occurred
when deleting files, so that there may exist files that are not used by Paimon snapshots (so-called "orphan files"). You can
submit a `remove_orphan_files` job to clean them:
{{< tabs "remove_orphan_files" >}}
{{< tab "Flink" >}}
```bash
<FLINK_HOME>/bin/flink run \
/path/to/paimon-flink-action-{{< version >}}.jar \
remove_orphan_files \
--warehouse <warehouse-path> \
--database <database-name> \
--table <table-name> \
[--older_than <timestamp>]
```
To avoid deleting files that are newly added by other writing jobs, this action only deletes orphan files older than
1 day by default. The interval can be modified by `--older_than`. For example:
```bash
<FLINK_HOME>/bin/flink run \
/path/to/paimon-flink-action-{{< version >}}.jar \
remove_orphan_files \
--warehouse <warehouse-path> \
--database <database-name> \
--table T \
--older_than '2023-10-31 12:00:00'
```
{{< /tab >}}
{{< tab "Spark" >}}
```sql
CALL sys.remove_orphan_files(table => "tableId", [older_then => "2023-10-31 12:00:00"])
```
{{< /tab >}}
{{< /tabs >}}

0 comments on commit 1758644

Please sign in to comment.