jiayuasu opened a new issue, #1166:
URL: https://github.com/apache/sedona-db/issues/1166
A spatial LEFT join whose left (preserved) side is empty fails with an
internal error instead of returning zero rows.
## Reproduce
```python
import sedonadb
sd = sedonadb.connect()
left = sd.sql("SELECT ST_Point(0.0, 0.0) AS g, 1 AS x").alias("l")
left_empty = left.filter(left["x"] > 99) # empty after filtering
right = sd.sql("SELECT ST_Point(0.0, 0.0) AS g2, 2 AS y").alias("r")
left_empty.join(right, on=left_empty["g"].geo.intersects(right["g2"]),
how="left").count()
```
```
External error: SedonaDB internal error: The bitmap for visited left side is
not created.
```
The expected result is an empty, schema-correct frame — which is what an
ordinary (non-spatial) left join returns for an empty left side, and what
GeoPandas' `sjoin(how="left")` returns.
The symmetric case works: a RIGHT join with an empty right side returns 0
rows without error. An INNER join with an empty side also works. So the failure
is specific to the preserved-side bitmap not being initialized when the build
side is empty in the spatial join executor.
## Impact
"Filter, then left-join" is a common pipeline shape, and whether it crashes
depends on data — a filter that happens to match nothing turns a working query
into an internal error. Because the message says "internal error", users have
no indication their query was valid.
Found by GeoPandas-parity testing of `sedonadb-geopandas` (#1142);
documented there as a known engine limitation pending this fix.
Version: `sedonadb` 0.5.0 (source build of current `main`).
--
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]