-
Notifications
You must be signed in to change notification settings - Fork 3.4k
API: Define RepairManifests action interface #17399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| /* | ||
| * 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. | ||
| */ | ||
| package org.apache.iceberg.actions; | ||
|
|
||
| import org.apache.iceberg.ManifestFile; | ||
|
|
||
| /** | ||
| * An action that repairs incorrect statistics in the manifests of a table. | ||
| * | ||
| * <p>Implementations rewrite the manifests of the table, producing a new set of manifests in which | ||
| * the statistics of the entries are corrected to match the underlying data and delete files. | ||
| */ | ||
| public interface RepairManifests extends SnapshotUpdate<RepairManifests, RepairManifests.Result> { | ||
|
|
||
| /** | ||
| * Repairs incorrect statistics of manifest entries, such as record counts, file sizes and column | ||
| * level statistics. | ||
| * | ||
| * @return this for method chaining | ||
| */ | ||
| RepairManifests repairEntryStats(); | ||
|
|
||
| /** | ||
| * Determines the repairs that would be performed without actually committing the operation to the | ||
| * table. | ||
| * | ||
| * @return this for method chaining | ||
| */ | ||
| RepairManifests dryRun(); | ||
|
|
||
| /** The action result that contains a summary of the execution. */ | ||
| interface Result { | ||
| /** Returns rewritten manifests. */ | ||
| Iterable<ManifestFile> rewrittenManifests(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also notice the rest of API says 'repaired'. here it is 'rewritten'. let's make them the same
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ack |
||
|
|
||
| /** Returns the number of manifest entries for which stats were incorrect. */ | ||
| long entryStatsIncorrectCount(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we just have one? Only one count should be populated right (depending on dryRun)? |
||
|
|
||
| /** Returns the number of manifest entries for which stats were corrected. */ | ||
| long entryStatsRepairedCount(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: repairedEntryCount
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok will change to just have |
||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think its inconsistent with remove-orphan-files dryRun but that pattern (supplying a no-op delete) doesnt really apply here. So im ok with an explicit flag.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree that we don't have a catch-all consumer for both incorrect manifest-list or manifest entry, but I still think it would be beneficial to at least know which files are examined with during dry-run. I think it might help the replication to be more resilient if we run this action on both source and target and ensure the result file set are the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dramaticlly sorry my comment lacked context, its from my reaidng of #10784 (comment) Whether we need a dryRun or not.
I think we need, even though its the not the same as RemoveOrphanFiles where its on the procedure and not action