apache / apache/sedona-db

Joining a large table against a tiny table does not push down the extent of the tiny table into the big table

Open
#225 5 comments 0 reactions 1 assignee Claimed by @Kontinuation View on GitHub
Dominant language
Rust
Stars
503
Forks
61
Avg merge
2d 4h
Merged PRs (30d)
90

Description

Not sure if this is something that was supposed to work already or not, but the following example doesn't execute for me without downloading all of Overture buildings:

```python
import sedona.db

sd = sedona.db.connect()

sd.read_parquet(
"s3://overturemaps-us-west-2/release/2025-08-20.0/theme=buildings/type=building/",
options={"aws.skip_signature": True, "aws.region": "us-west-2"},
).to_view("buildings", overwrite=True)

sd.sql("""
SELECT label, ST_SetSRID(ST_GeomFromWKT(wkt), 4326) AS poly
FROM (VALUES
('A', 'POLYGON ((-73.22 44.03, -73.22 44.01, -73.17 44.01, -73.18 44.03, -73.22 44.03))'),
('B', 'POLYGON ((-73.14 44.03, -73.14 44.01, -73.08 44.01, -73.09 44.03, -73.14 44.03))'),
('C', 'POLYGON ((-73.19 43.99, -73.18 43.96, -73.11 43.96, -73.12 44.00, -73.19 43.99))')
) AS t(label, wkt)
""").to_view("join_table", overwrite=True)

sd.sql("""
SELECT join_table.label, buildings.id, buildings.geometry
FROM buildings
JOIN join_table
ON ST_Contains(join_table.poly, buildings.geometry)
""").to_memtable()
```

I am not sure if the solution here is in the spatial join or whether the solution is to start implementing Statistics propagation.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.