zhangfengcdt commented on code in PR #2971:
URL: https://github.com/apache/parquet-java/pull/2971#discussion_r2035643493


##########
parquet-hadoop/src/main/java/org/apache/parquet/format/converter/ParquetMetadataConverter.java:
##########
@@ -775,6 +811,33 @@ public static Statistics toParquetStatistics(
     return formatStats;
   }
 
+  private static BoundingBox 
toParquetBoundingBox(org.apache.parquet.column.statistics.geometry.BoundingBox 
bbox) {
+    BoundingBox formatBbox = new BoundingBox();
+
+    // Use the same NaN check pattern for all coordinates
+    if (!Double.isNaN(bbox.getXMin()) && !Double.isNaN(bbox.getXMax())) {
+      formatBbox.setXmin(bbox.getXMin());
+      formatBbox.setXmax(bbox.getXMax());
+    }
+
+    if (!Double.isNaN(bbox.getYMin()) && !Double.isNaN(bbox.getYMax())) {
+      formatBbox.setYmin(bbox.getYMin());
+      formatBbox.setYmax(bbox.getYMax());
+    }

Review Comment:
   Cool, that makes a lot of sense! I will go ahead to set formatBbox to null 
for case like this. Thrift will throw exception when this happen, but we don't 
want to fail the writer/reader for completely empty column chunks.



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