aokolnychyi commented on a change in pull request #2452:
URL: https://github.com/apache/iceberg/pull/2452#discussion_r615135915
##########
File path:
spark/src/main/java/org/apache/iceberg/spark/actions/BaseSparkAction.java
##########
@@ -159,7 +159,7 @@ protected Table newStaticTable(TableMetadata metadata,
FileIO io) {
.repartition(spark.sessionState().conf().numShufflePartitions()) //
avoid adaptive execution combining tasks
.as(Encoders.bean(ManifestFileBean.class));
- return allManifests.flatMap(new ReadManifest(ioBroadcast),
Encoders.STRING()).toDF("file_path");
+ return allManifests.flatMap(new ReadManifest(ioBroadcast),
Encoders.STRING()).toDF("file_path").distinct();
Review comment:
After thinking more about this, I think I agree with @RussellSpitzer.
Even let's say we loaded 4 million files where 1 million is unique and 40000
manifests where only 1000 are unique. Doing 2 extra shuffles to find unique
data files and manifests is probably going to be more expensive than doing one
larger shuffle.
It is important we dedup manifests before reading valid data files (which
the existing code does) so we should probably handle this on the caller side.
Make sure we do a projection before deduplicating.
That being said, I think we should refine the logic in
`getOtherMetadataFilePaths`.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]