edgarRd commented on a change in pull request #1399:
URL: https://github.com/apache/iceberg/pull/1399#discussion_r495251583



##########
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:
       Yeah, somehow I missed this one but did it for the method of 
unpartitioned tables. Thanks for pointing this out. I've reverted the change.




----------------------------------------------------------------
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]

Reply via email to