chamikaramj commented on code in PR #39705:
URL: https://github.com/apache/beam/pull/39705#discussion_r3762465377
##########
sdks/java/io/iceberg/src/main/java/org/apache/beam/sdk/io/iceberg/SerializableDataFile.java:
##########
@@ -211,16 +246,36 @@ public DataFile createDataFile(Map<Integer,
PartitionSpec> partitionSpecs) {
toByteBufferMap(getLowerBounds()),
toByteBufferMap(getUpperBounds()));
- return DataFiles.builder(partitionSpec)
- .withFormat(FileFormat.fromString(getFileFormat()))
- .withPath(getPath())
- .withPartitionPath(getPartitionPath())
- .withEncryptionKeyMetadata(getKeyMetadata())
- .withFileSizeInBytes(getFileSizeInBytes())
- .withMetrics(dataFileMetrics)
- .withSplitOffsets(getSplitOffsets())
- .withFirstRowId(getFirstRowId())
- .build();
+ DataFiles.Builder builder =
+ DataFiles.builder(partitionSpec)
+ .withFormat(FileFormat.fromString(getFileFormat()))
+ .withPath(getPath())
+ .withEncryptionKeyMetadata(getKeyMetadata())
+ .withFileSizeInBytes(getFileSizeInBytes())
+ .withMetrics(dataFileMetrics)
+ .withSplitOffsets(getSplitOffsets())
+ .withFirstRowId(getFirstRowId());
+
+ @Nullable String jsonPartition = getJsonPartition();
+ if (jsonPartition != null) {
+ try {
+ builder = builder.withPartition(partition(partitionSpec));
+ } catch (RuntimeException e) {
+ // Some partition values (e.g. NaN / Infinity floating-point) don't
round-trip through the
Review Comment:
Sounds too broad ? Do we need to verify the RuntimeException before falling
back ?
--
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]