deniskuzZ commented on code in PR #6515:
URL: https://github.com/apache/hive/pull/6515#discussion_r3337070347
##########
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.
Review Comment:
The issue is in how the partition path string is generated and then parsed
back. `spec.partitionToPath(partitionData)` uses Iceberg's toHumanString() to
convert partition values to path segments. For `NULL` values, toHumanString()
produces the string `"null"`. So the path looks like `col=null`. When
`Warehouse.makeSpecFromName` parses this path back into a spec map, it just
sees the literal string `"null"` as the value — it has no way to know whether
this came from an actual `NULL` or from a legitimate string value `"null"`. It
puts `"null"` (the string) into the spec map rather than `NULL`.
The fix uses `partitionData` to check whether the value is actually `NULL`
at the Iceberg level, and if so, puts `NULL` into the spec map directly. We
need this because toHumanString() is lossy — it conflates `NULL` and the
string `"null"` into the same path representation.
--
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]