rdblue commented on a change in pull request #3722:
URL: https://github.com/apache/iceberg/pull/3722#discussion_r768092834
##########
File path:
spark/v3.2/spark/src/main/java/org/apache/iceberg/spark/source/IcebergSource.java
##########
@@ -115,10 +133,28 @@ public Table getTable(StructType schema, Transform[]
partitioning, Map<String, S
if (catalogAndIdentifier.catalog().name().equals("spark_catalog") &&
!(catalogAndIdentifier.catalog() instanceof SparkSessionCatalog)) {
// catalog is a session catalog but does not support Iceberg. Use
Iceberg instead.
+ Identifier ident = catalogAndIdentifier.identifier();
return new
Spark3Util.CatalogAndIdentifier(catalogManager.catalog(DEFAULT_CATALOG_NAME),
- catalogAndIdentifier.identifier());
- } else {
+ newIdentifier(ident, selector));
+ } else if (snapshotId == null && asOfTimestamp == null) {
return catalogAndIdentifier;
+ } else {
+ CatalogPlugin catalog = catalogAndIdentifier.catalog();
+ Identifier ident = catalogAndIdentifier.identifier();
+ return new Spark3Util.CatalogAndIdentifier(catalog,
+ newIdentifier(ident, selector));
+ }
+ }
+
+ private Identifier newIdentifier(Identifier ident, String newName) {
+ if (newName.equals("")) {
+ return ident;
+ } else {
+ String[] namespace = ident.namespace();
+ String name = ident.name();
Review comment:
This variable doesn't seem to be needed to me.
--
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]