pvary commented on a change in pull request #3912:
URL: https://github.com/apache/iceberg/pull/3912#discussion_r790765791



##########
File path: mr/src/main/java/org/apache/iceberg/mr/hive/HiveIcebergSerDe.java
##########
@@ -176,12 +179,22 @@ private static Schema hiveSchemaOrThrow(Properties 
serDeProperties, Exception pr
       if (columnComments != null) {
         Collections.addAll(comments, 
columnComments.split(Character.toString(Character.MIN_VALUE)));
       }
+      String identifierFields = 
serDeProperties.getProperty(InputFormatConfig.IDENTIFIER_FIELD_NAMES);
+      Set<String> identifierFieldNames = 
getIdentifierFieldSet(identifierFields);
       Schema hiveSchema = HiveSchemaUtil.convert(names, 
TypeInfoUtils.getTypeInfosFromTypeString(columnTypes),
-              comments, autoConversion);
+              comments, autoConversion, identifierFieldNames);
       LOG.info("Using hive schema {}", SchemaParser.toJson(hiveSchema));
       return hiveSchema;
     } else {
       throw new SerDeException("Please provide an existing table or a valid 
schema", previousException);
     }
   }
+
+  public static Set<String> getIdentifierFieldSet(@Nullable String 
identifierFields) {

Review comment:
       Could we create a general method here instead, which encapsulates 
getting the list from the map too? Something like:
   ```
   public static Set<String> getIdentifierFieldSet(Map properties) {
   }
   ```




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

Reply via email to