Kontinuation commented on code in PR #57:
URL: https://github.com/apache/sedona-db/pull/57#discussion_r2341197408
##########
rust/sedona-geoparquet/src/file_opener.rs:
##########
@@ -200,7 +200,13 @@ fn geoparquet_file_geo_stats(
// If this column is in the GeoParquet metadata, construct actual
statistics
// (otherwise, construct unspecified statistics)
if let Some(column_metadata) = metadata.columns.get(field.name()) {
- Ok(column_metadata.to_geo_statistics())
+ if is_prunable_geospatial_field(field) {
+ Ok(column_metadata.to_geo_statistics())
+ } else {
+ // Bounding box based pruning does not work for geography
fields, so we remove
+ // the bbox from statistics to ensure that they are not
used for pruning.
+ Ok(column_metadata.to_geo_statistics().with_bbox(None))
+ }
Review Comment:
I found that we cannot return a full bounding box for geography. We are
pushing down ST_Contains and ST_Covers predicates as `SpatialFilter::Covers`,
which requires the bbox of the geospatial column to contain the query window.
Returning a full bounding box for geography will skip everything in such cases.
I'll try a different approach. The modification will still go into
spatial_filter.rs and keep the bboxes in geo-statistics retrieved from
GeoParquet files intact.
--
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]