rdblue commented on a change in pull request #1399:
URL: https://github.com/apache/iceberg/pull/1399#discussion_r495211519
##########
File path: spark/src/main/java/org/apache/iceberg/spark/SparkTableUtil.java
##########
@@ -573,7 +574,8 @@ public static void importSparkPartitions(
int numShufflePartitions =
spark.sessionState().conf().numShufflePartitions();
MetricsConfig metricsConfig =
MetricsConfig.fromProperties(targetTable.properties());
String nameMappingString =
targetTable.properties().get(TableProperties.DEFAULT_NAME_MAPPING);
- NameMapping nameMapping = nameMappingString != null ?
NameMappingParser.fromJson(nameMappingString) : null;
+ NameMapping nameMapping = nameMappingString != null ?
+ NameMappingParser.fromJson(nameMappingString) :
MappingUtil.create(targetTable.schema());
Review comment:
This change needs to be reverted. The import process must create and
store a mapping on the table. We should not use an ephemeral mapping that is
immediately discarded.
----------------------------------------------------------------
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]