deniskuzZ commented on code in PR #6515:
URL: https://github.com/apache/hive/pull/6515#discussion_r3337072250


##########
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/IcebergTableUtil.java:
##########
@@ -452,6 +452,25 @@ public static void performMetadataDelete(Table 
icebergTable, String branchName,
     deleteFiles.deleteFromRowFilter(exp).commit();
   }
 
+  /**
+   * Parses an Iceberg partition path into a Hive-compatible spec map.
+   * Unlike {@link Warehouse#makeSpecFromName}, this correctly represents null 
partition values
+   * as {@code null} instead of the literal string "null".
+   */
+  public static Map<String, String> makeSpecFromName(String partName,
+      PartitionSpec spec, PartitionData data) {
+    Map<String, String> partSpecMap = Maps.newLinkedHashMap();
+    Warehouse.makeSpecFromName(partSpecMap, new Path(partName), null);
+
+    List<PartitionField> fields = spec.fields();
+    for (int i = 0; i < fields.size(); i++) {
+      if (data.get(i, Object.class) == null) {
+        partSpecMap.put(fields.get(i).name(), null);

Review Comment:
   no, we can't



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