Skip to content

Add docs for Table Maintenance in Flink - #13360

Closed
JeonDaehong wants to merge 15 commits into
apache:mainfrom
JeonDaehong:main
Closed

JeonDaehong wants to merge 15 commits into
apache:mainfrom
JeonDaehong:main

Conversation

@JeonDaehong

Copy link
Copy Markdown
Contributor

I have completed writing the documentation for Table Maintenance in Flink.

Please review it and kindly merge if everything looks good.

This is my first time contributing to open source documentation, so if any revisions are needed, I would appreciate your feedback. I will make the necessary changes and submit another PR accordingly.

Thank you very much.

( Docs update for Flink Table Maintenance API - Fixes #13307 )

image
image
image
image
image
image
image
image

@github-actions github-actions Bot added the docs label Jun 20, 2025
@JeonDaehong

Copy link
Copy Markdown
Contributor Author

Previous commits are coming along with my changes...
Do I need to delete my forked repository and fork it again?

@JeonDaehong

Copy link
Copy Markdown
Contributor Author

This is my first time working on documentation, so I would appreciate plenty of feedback. Thank you!

```java
StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
TableLoader tableLoader = TableLoader.fromHadoopTable("path/to/table");
TriggerLockFactory lockFactory = TriggerLockFactory.defaultLockFactory();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems I misunderstood that part and wrote it incorrectly.
I'll remove it.

Comment on lines +51 to +52
.partialProgressEnabled(true)
.partialProgressMaxCommits(10))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would turn this off in the main example. This becomes interesting if the table is big, and otherwise it add too many small commits

|--------|-------------|---------|
| `uidSuffix(String)` | Unique identifier suffix for the job | Random UUID |
| `rateLimit(Duration)` | Minimum interval between task executions | 60 seconds |
| `lockCheckDelay(Duration)` | Delay for checking lock availability | 30 seconds |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that based on this doc, the average user will know what is this lock, and why it is needed

| `scheduleOnDataFileCount(int)` | Trigger after N data files | No automatic scheduling | int |
| `scheduleOnDataFileSize(long)` | Trigger after total data file size (bytes) | No automatic scheduling | long |
| `scheduleOnIntervalSecond(long)` | Trigger after time interval (seconds) | No automatic scheduling | long |
| `parallelism(int)` | Parallelism for this specific task | Inherits from TableMaintenance | int |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is important to highlight that this parallelism is only for deletion

| `scheduleOnDataFileCount(int)` | Trigger after N data files | 1000 | int |
| `scheduleOnDataFileSize(long)` | Trigger after total data file size (bytes) | 100GB | long |
| `scheduleOnIntervalSecond(long)` | Trigger after time interval (seconds) | 600 (10 minutes) | long |
| `maxRewriteBytes(long)` | Maximum bytes to rewrite per execution | Long.MAX_VALUE | long |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Describe what it is used for - namely to reduce the work done in a single run if there are too many data to rewrite


| Configuration Key | Description | Default Value | Type |
|-------------------|-------------|---------------|------|
| `iceberg.maintenance.rate-limit-seconds` | Rate limit in seconds | 60 | long |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pvary

pvary commented Jun 20, 2025

Copy link
Copy Markdown
Contributor

@JeonDaehong: Thanks for working on this.
Added some specific comments.

As a more general one:

  • Could we start some high level description about the feature?
  • Can we have some generic part where we discuss the configuration options?
  • We can put the full config list after these

@Guosmilesmile Guosmilesmile left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JeonDaehong Thank you very much for your contribution.

Besides the points below, I have also left some comments regarding details.

  1. I think there might be some missing explanations about the role of locks here.
  2. For some of the more complex configuration options, I think we need to add what they are used for.
  3. It seems that the configuration options in the RewriteDataFiles Configuration section are not fully listed.
  4. As Peter mentioned, could we start with some high-level description of the feature?

| `rateLimit(Duration)` | Minimum interval between task executions | 60 seconds |
| `lockCheckDelay(Duration)` | Delay for checking lock availability | 30 seconds |
| `parallelism(int)` | Default parallelism for maintenance tasks | System default |
| `maxReadBack(int)` | Max snapshots to check during initialization | 100 |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be Maximum number of snapshots checked when started at the first time. Only available when the change stream is not provided ?


| Configuration Key | Description | Default Value | Type |
|-------------------|-------------|---------------|------|
| `iceberg.maintenance.rate-limit-seconds` | Rate limit in seconds | 60 | long |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding the configuration items for this part, I'm a bit unfamiliar. Are these all the configuration items? And where are they used?

.table(table)
.tableLoader(tableLoader)
.setAll(properties)
.addPostCommitTopology(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Users neither need to nor can call the addPostCommitTopology method. Compression in the sink is enabled through configuration.


| Method | Description | Default Value | Type |
|--------|-------------|---------------|------|
| `targetFileSizeBytes(long)` | Target size for rewritten files | Table property or 512MB | long |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there some configurations that we haven't listed, like minInputFiles, rewriteAll, maxFileGroupSizeBytes, and so on?

@JeonDaehong

JeonDaehong commented Jun 21, 2025 •

Copy link
Copy Markdown
Contributor Author

@Guosmilesmile @pvary

Thank you both so much for the feedback :D

I've carefully reviewed and read through all of your comments.
Based on your suggestions, I’ll make the necessary revisions and submit a new PR within the next two weeks!

By the way, I noticed that commit history from a previous unrelated issue is still showing up in this PR.
In this case, should I delete my forked repository and re-fork it from the upstream repo?

@Guosmilesmile

Copy link
Copy Markdown
Contributor

By the way, I noticed that commit history from a previous unrelated issue is still showing up in this PR.
In this case, should I delete my forked repository and re-fork it from the upstream repo?

You can try to Sync fork first and update branch, then rebase the code.If you are not familiar with the process, make sure to back up your code first.

@JeonDaehong

Copy link
Copy Markdown
Contributor Author

By the way, I noticed that commit history from a previous unrelated issue is still showing up in this PR.
In this case, should I delete my forked repository and re-fork it from the upstream repo?

You can try to Sync fork first and update branch, then rebase the code.If you are not familiar with the process, make sure to back up your code first.

Thank you for the guidance! I’m not very familiar with the rebase process, so I’ll review some docs and try it carefully with a backup first.

@JeonDaehong

Copy link
Copy Markdown
Contributor Author

@pvary @Guosmilesmile

Sorry for the delay.

I was away for a while due to a business trip and a service launch, so I wasn't able to work on the PR.

Now that I have more time, I’ll slowly get back to working on the documentation and submit the PR again.

Thank you for your patience.

@JeonDaehong JeonDaehong closed this Aug 9, 2025
@JeonDaehong

Copy link
Copy Markdown
Contributor Author

I will submit it again as a new PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add docs for Table Maintenance in Flink

4 participants