RussellSpitzer commented on a change in pull request #1344:
URL: https://github.com/apache/iceberg/pull/1344#discussion_r473567264
##########
File path: spark/src/main/java/org/apache/iceberg/actions/BaseAction.java
##########
@@ -86,27 +91,36 @@ protected String metadataTableName(MetadataTableType type) {
}
protected Dataset<Row> buildValidDataFileDF(SparkSession spark) {
- String allDataFilesMetadataTable =
metadataTableName(MetadataTableType.ALL_DATA_FILES);
+ return buildValidDataFileDF(spark, table().toString());
+ }
+
+ protected Dataset<Row> buildValidDataFileDF(SparkSession spark, String
tableName) {
+ String allDataFilesMetadataTable = metadataTableName(tableName,
MetadataTableType.ALL_DATA_FILES);
return
spark.read().format("iceberg").load(allDataFilesMetadataTable).select("file_path");
}
- protected Dataset<Row> buildManifestFileDF(SparkSession spark) {
- String allManifestsMetadataTable =
metadataTableName(MetadataTableType.ALL_MANIFESTS);
+ protected Dataset<Row> buildManifestFileDF(SparkSession spark, String
tableName) {
+ String allManifestsMetadataTable = metadataTableName(tableName,
MetadataTableType.ALL_MANIFESTS);
return
spark.read().format("iceberg").load(allManifestsMetadataTable).selectExpr("path
as file_path");
}
protected Dataset<Row> buildManifestListDF(SparkSession spark, Table table) {
- List<String> manifestLists = getManifestListPaths(table);
+ List<String> manifestLists = getManifestListPaths(table.snapshots());
return spark.createDataset(manifestLists,
Encoders.STRING()).toDF("file_path");
}
+ protected Dataset<Row> buildManifestListDF(SparkSession spark, String
metadataFileLocation) {
Review comment:
You cannot pass a pure table name here since we aren't looking up the
table using Spark, this path is for metadataFileLocation based tables only.
----------------------------------------------------------------
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]