Skip to content
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

File size in bytes tracking with deleted files in expire snapshots #10036

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Base result types
  • Loading branch information
Sasank Pagolu committed Oct 27, 2024
commit d022eca004efbdcb665fffb98d11ef5aa0ff4680
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,9 @@ interface Result {
default long deletedStatisticsFilesCount() {
return 0L;
}

default long deletedFilesSizeInBytes() {
return 0L;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,11 @@ interface Result extends ExpireSnapshots.Result {
default long deletedStatisticsFilesCount() {
return ExpireSnapshots.Result.super.deletedStatisticsFilesCount();
}

@Override
@Value.Default
default long deletedFilesSizeInBytes() {
return ExpireSnapshots.Result.super.deletedFilesSizeInBytes();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ private ExpireSnapshots.Result deleteFiles(Iterator<FileInfo> files) {
.deletedManifestsCount(summary.manifestsCount())
.deletedManifestListsCount(summary.manifestListsCount())
.deletedStatisticsFilesCount(summary.statisticsFilesCount())
.deletedFilesSizeInBytes(summary.totalSizeInBytes())
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ public class ExpireSnapshotsProcedure extends BaseProcedure {
new StructField(
"deleted_manifest_lists_count", DataTypes.LongType, true, Metadata.empty()),
new StructField(
"deleted_statistics_files_count", DataTypes.LongType, true, Metadata.empty())
"deleted_statistics_files_count", DataTypes.LongType, true, Metadata.empty()),
new StructField("deleted_files_size_bytes", DataTypes.LongType, true, Metadata.empty())
});

public static ProcedureBuilder builder() {
Expand Down Expand Up @@ -162,7 +163,8 @@ private InternalRow[] toOutputRows(ExpireSnapshots.Result result) {
result.deletedEqualityDeleteFilesCount(),
result.deletedManifestsCount(),
result.deletedManifestListsCount(),
result.deletedStatisticsFilesCount());
result.deletedStatisticsFilesCount(),
result.deletedFilesSizeInBytes());
return new InternalRow[] {row};
}

Expand Down