paleolimbot commented on code in PR #57:
URL: https://github.com/apache/sedona-db/pull/57#discussion_r2340579264
##########
rust/sedona-spatial-join/src/optimizer.rs:
##########
@@ -2418,4 +2466,39 @@ mod tests {
let result = transform_join_filter(&join_filter);
assert!(result.is_none()); // Should fail - k must be a literal value
}
+
+ #[test]
+ fn test_is_spatial_predicate_supported() {
+ // Planar geometry field
+ let geom_field = WKB_GEOMETRY.to_storage_field("geom", false).unwrap();
+ let schema = Arc::new(Schema::new(vec![geom_field.clone()]));
Review Comment:
This would benefit from a high-level integration test in Python (i.e., make
sure that a join with geography returns correct results). A join between
`"submodules/geoarrow-data/natural-earth/files/natural-earth_countries-geography_geo.parquet"`
and
`"submodules/geoarrow-data/natural-earth/files/natural-earth_countries-geography_geo.parquet"`
might be a good candidate.
##########
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:
Should we handle this in `literal_bounds()` by returning a Full bounding box?
https://github.com/apache/sedona-db/blob/3e9b7a97f9b5b925ec2f01e0a235190c96e3fc89/rust/sedona-expr/src/spatial_filter.rs#L317-L319
(Strictly speaking there's nothing wrong with the information in the file,
it's just that we can't bound the literal)
--
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]