kbendick commented on code in PR #5495:
URL: https://github.com/apache/iceberg/pull/5495#discussion_r946296156
##########
spark/v3.3/spark/src/main/java/org/apache/iceberg/spark/actions/DeleteOrphanFilesSparkAction.java:
##########
@@ -256,41 +256,62 @@ private DeleteOrphanFiles.Result doExecute() {
return new BaseDeleteOrphanFilesActionResult(orphanFiles);
}
- private Dataset<Row> buildValidFileDF() {
- return contentFileDS(table)
- .union(manifestDS(table))
- .union(manifestListDS(table))
- .union(otherMetadataFileDS(table))
- .toDF(FILE_PATH, FILE_TYPE)
- .select(FILE_PATH);
+ private Dataset<FileURI> validFileIdentDS() {
+ // apply the transformation before union to avoid extra serialization
+ FileInfoToFileURI toURI = new FileInfoToFileURI(equalSchemes,
equalAuthorities);
+
+ Dataset<FileURI> contentFileIdentDS = toURI.apply(contentFileDS(table));
+ Dataset<FileURI> manifestFileIdentDS = toURI.apply(manifestDS(table));
+ Dataset<FileURI> manifestListIdentDS = toURI.apply(manifestListDS(table));
+ Dataset<FileURI> otherMetadataFileIdentDS =
toURI.apply(otherMetadataFileDS(table));
+
+ return contentFileIdentDS
+ .union(manifestFileIdentDS)
+ .union(manifestListIdentDS)
+ .union(otherMetadataFileIdentDS);
}
- private Dataset<Row> buildActualFileDF() {
+ private Dataset<FileURI> actualFileIdentDS() {
Review Comment:
That reads kind of funny to me, admittedly.
Though Iād be ok either way. š
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]