rdblue commented on a change in pull request #1783:
URL: https://github.com/apache/iceberg/pull/1783#discussion_r539749213
##########
File path:
spark3/src/main/java/org/apache/iceberg/spark/source/IcebergSource.java
##########
@@ -56,48 +80,70 @@ public boolean supportsExternalMetadata() {
}
@Override
- public SparkTable getTable(StructType schema, Transform[] partitioning,
Map<String, String> options) {
- // Get Iceberg table from options
- Configuration conf = SparkSession.active().sessionState().newHadoopConf();
- Table icebergTable = getTableAndResolveHadoopConfiguration(options, conf);
-
- // Build Spark table based on Iceberg table, and return it
- // Eagerly refresh the table before reading to ensure views containing
this table show up-to-date data
- return new SparkTable(icebergTable, schema, true);
+ public Table getTable(StructType schema, Transform[] partitioning,
Map<String, String> options) {
+ String catalogName = extractCatalog(new CaseInsensitiveStringMap(options));
+ Identifier ident = extractIdentifier(new
CaseInsensitiveStringMap(options));
Review comment:
This is doing a lot of extra work by not calling `CatalogAndIdentifier`
directly. There are two maps created, two identical catalog/table resolutions,
and then this needs to get the active session and look up the catalog that was
already loaded. Is it possible to refactor so that the "extract" functions use
a common method that can be used here?
----------------------------------------------------------------
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]