jiayuasu commented on code in PR #12956:
URL: https://github.com/apache/iceberg/pull/12956#discussion_r2072882493


##########
format/spec.md:
##########
@@ -649,6 +649,8 @@ Notes:
 
 For `geometry` and `geography` types, `lower_bounds` and `upper_bounds` are 
both points of the following coordinates X, Y, Z, and M (see [Appendix 
G](#appendix-g-geospatial-notes)) which are the lower / upper bound of all 
objects in the file. For the X values only, xmin may be greater than xmax, in 
which case an object in this bounding box may match if it contains an X such 
that `x >= xmin` OR`x <= xmax`. In geographic terminology, the concepts of 
`xmin`, `xmax`, `ymin`, and `ymax` are also known as `westernmost`, 
`easternmost`, `southernmost` and `northernmost`, respectively. For `geography` 
types, these points are further restricted to the canonical ranges of [-180 
180] for X and [-90 90] for Y.
 
+Like for other types, null or invalid `geometry` and `geography` objects are 
skipped when calculating the bounds. Note this includes objects with valid WKB 
encodings, but which are marked as empty by 0 'numPoints', 'numRings', or 
'numGeometries'. In contrast, invalid coordinate values within a `geometry` or 
`geography` do not lead to the entire object being skipped, instead only that 
coordinate value itself is omitted for calculation. Invalid coordinate values 
include NaN values and values outside the allowed range, ie `x < -180` or `x > 
180` for `geography` objects. Note, no bounding box is produced if all x,y 
values in the file are invalid.

Review Comment:
   @szehon-ho Because the spec requires that a bbox (lower bound & upper bound) 
must have both X (min/max) and Y (min/max) present while the spec does not 
allow `NaN/Null` in bbox / bounds. Therefore, we have to drop the entire bbox 
if all X values are valid and all Y values are invalid.



-- 
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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to