RussellSpitzer commented on a change in pull request #1715:
URL: https://github.com/apache/iceberg/pull/1715#discussion_r525632123
##########
File path: spark/src/main/java/org/apache/iceberg/actions/BaseSparkAction.java
##########
@@ -86,6 +126,32 @@
return manifestDF.union(otherMetadataFileDF).union(manifestListDF);
}
+ protected static Dataset<Row> loadMetadataTable(SparkSession spark, String
tableName, String tableLocation,
+ MetadataTableType type) {
+ DataFrameReader noCatalogReader = spark.read().format("iceberg");
+ if (tableName.contains("/")) {
+ // Metadata location passed, load without a catalog
+ return noCatalogReader.load(tableName + "#" + type);
+ } else {
+ // Try catalog based name based resolution
+ try {
+ return spark.table(tableName + "." + type);
+ } catch (Exception e) {
+ // Catalog based resolution failed, our catalog may be a
non-DatasourceV2 Catalog
+ if (tableName.startsWith("hadoop.")) {
Review comment:
Anton I were talking about this, the issue is that it isn't just for
SparkV2 as it's quite possible for a user to be using manual catalogs in a
Spark3 application (or ported Spark2 application.) If we remove this we break
anyone who is accessing tables by this method.
I think that's actually something that's fine to break eventually but I
think it would be pretty big breaking change.
Example
Actions.forTable(tableCreatedFromHadoopOrHiveCatalog)
----------------------------------------------------------------
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]