GitHub user michelelaporta edited a comment on the discussion: Sedona LEFT JOIN 
using SPATIAL INDEX

Thanks [jiayuasu](https://github.com/jiayuasu) I see `BroadcastIndexJoin` in 
the plan:

```
== Physical Plan ==
AdaptiveSparkPlan isFinalPlan=false
+- BroadcastIndexJoin point#96: geometry, RightSide, LeftSide, LeftOuter, 
WITHIN ST_WITHIN(point#96, geometry#15)
   :- Project [ **org.apache.spark.sql.sedona_sql.expressions.ST_GeomFromText** 
  AS point#96]
   :  +- FileScan parquet [latitude#42,longitude#43] Batched: true, 
DataFilters: [], Format: Parquet, Location: InMemoryFileIndex(1 
paths)[file:/data/adv/ITA/mobilewalla/20250426], PartitionFilters: [], 
PushedFilters: [], ReadSchema: struct<latitude:double,longitude:double>
   +- SpatialIndex geometry#15: geometry, RTREE, false, false
      +- Filter isnotnull(geometry#15)
         +- InMemoryTableScan [alpha2#0, alpha3#1, geometry#15], 
[isnotnull(geometry#15)]
               +- InMemoryRelation [alpha2#0, alpha3#1, geometry#15], 
StorageLevel(disk, memory, deserialized, 1 replicas)
                     +- AdaptiveSparkPlan isFinalPlan=true
                        +- == Final Plan ==
                           ShuffleQueryStage 0
                           +- Exchange SinglePartition, REPARTITION_BY_NUM, 
[plan_id=95]
                              +- Project [alpha2#0, alpha3#1, 
st_geomfromwkb(geometry#3) AS geometry#15]
                                 +- *(1) ColumnarToRow
                                    +- FileScan parquet 
[alpha2#0,alpha3#1,geometry#3] Batched: true, DataFilters: [], Format: Parquet, 
Location: InMemoryFileIndex(1 
paths)[file:/tmp/sedona-spatial-indexing/countries.parquet], PartitionFilters: 
[], PushedFilters: [], ReadSchema: 
struct<alpha2:string,alpha3:string,geometry:string>
                        +- == Initial Plan ==
                           Exchange SinglePartition, REPARTITION_BY_NUM, 
[plan_id=8]
                           +- Project [alpha2#0, alpha3#1, 
st_geomfromwkb(geometry#3) AS geometry#15]
                              +- FileScan parquet 
[alpha2#0,alpha3#1,geometry#3] Batched: true, DataFilters: [], Format: Parquet, 
Location: InMemoryFileIndex(1 
paths)[file:/tmp/sedona-spatial-indexing/countries.parquet], PartitionFilters: 
[], PushedFilters: [], ReadSchema: 
struct<alpha2:string,alpha3:string,geometry:string>

```

GitHub link: 
https://github.com/apache/sedona/discussions/2520#discussioncomment-15228996

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to