wgtmac commented on code in PR #3222:
URL: https://github.com/apache/parquet-java/pull/3222#discussion_r2101439555


##########
parquet-column/src/main/java/org/apache/parquet/column/statistics/geospatial/BoundingBox.java:
##########
@@ -218,16 +233,27 @@ public void merge(BoundingBox other) {
       return;
     }
 
-    this.xMin = Math.min(this.xMin, other.xMin);
-    this.xMax = Math.max(this.xMax, other.xMax);
+    // We don't yet support merging wraparound bounds.
+    // Rather than throw, we mark the X bounds as invalid.
+    if (isXWraparound() || other.isXWraparound()) {
+      // Mark X dimension as invalid by setting to NaN
+      xMin = Double.NaN;
+      xMax = Double.NaN;

Review Comment:
   ```suggestion
         valid = false;
         resetBBox();
   ```
   
   Can we simply do this?



##########
parquet-column/src/main/java/org/apache/parquet/column/statistics/geospatial/BoundingBox.java:
##########
@@ -18,6 +18,7 @@
  */
 package org.apache.parquet.column.statistics.geospatial;
 
+import org.apache.parquet.ShouldNeverHappenException;

Review Comment:
   Ah, I didn't know this before this PR



##########
parquet-column/src/main/java/org/apache/parquet/column/statistics/geospatial/BoundingBox.java:
##########
@@ -218,16 +233,27 @@ public void merge(BoundingBox other) {
       return;
     }
 
-    this.xMin = Math.min(this.xMin, other.xMin);
-    this.xMax = Math.max(this.xMax, other.xMax);
+    // We don't yet support merging wraparound bounds.
+    // Rather than throw, we mark the X bounds as invalid.

Review Comment:
   ```suggestion
       // We don't yet support merging wraparound bounds.
   ```
   
   If you accept the below suggestion, this line should also be removed.



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