paleolimbot opened a new issue, #389:
URL: https://github.com/apache/sedona-db/issues/389

   This is the actual root cause for #380 and the corresponding Parquet issue 
noted in #385. We had been assuming that the `Column::index()` was an index 
into the `file_schema`; however, the index referred to the value in the 
projected schema.
   
   ```
   # Final Logical Plan
   Projection: count(Int64(1)) AS count(*)
     Aggregate: groupBy=[[]], aggr=[[count(Int64(1))]]
       SubqueryAlias: buildings
         Projection:
           Filter: st_intersects(?table?.geometry, 
Binary("1,3,0,0,0,1,0,0,0,5,0,0,0,61,10,215,163,112,77,82,192,164,112,61,10,215,3,70,64,61,10,215,163,112,77,82,192,61,10,215,163,112,253,69,64,215,163,112,61,10,71,82,192,92,143,194,245,40,252,69,64,72,225,122,20,174,71,82,192,164,112,61,10,215,3,70,64,61,10,215,163,112,77,82,192,164,112,61,10,215,3,70,64")
 FieldMetadata { inner: {"ARROW:extension:metadata": "{\"crs\":\"EPSG:4326\"}", 
"ARROW:extension:name": "geoarrow.wkb"} })
             TableScan: ?table? projection=[geometry], 
partial_filters=[st_intersects(?table?.geometry, 
Binary("1,3,0,0,0,1,0,0,0,5,0,0,0,61,10,215,163,112,77,82,192,164,112,61,10,215,3,70,64,61,10,215,163,112,77,82,192,61,10,215,163,112,253,69,64,215,163,112,61,10,71,82,192,92,143,194,245,40,252,69,64,72,225,122,20,174,71,82,192,164,112,61,10,215,3,70,64,61,10,215,163,112,77,82,192,164,112,61,10,215,3,70,64")
 FieldMetadata { inner: {"ARROW:extension:metadata": "{\"crs\":\"EPSG:4326\"}", 
"ARROW:extension:name": "geoarrow.wkb"} })]
   
   # Initial Physical plan
   ProjectionExec: expr=[count(Int64(1))@0 as count(*)]
     AggregateExec: mode=Final, gby=[], aggr=[count(Int64(1))]
       AggregateExec: mode=Partial, gby=[], aggr=[count(Int64(1))]
         ProjectionExec: expr=[]
           FilterExec: st_intersects(geometry@0, 01030000000100000005...)
             DataSourceExec: file_groups={12 groups: [[...]]}, 
projection=[geometry], file_type=parquet
   ```
   
   Here `geometry@0` is correct: it's the first column accounting for 
`projection=[geometry]`.
   
   I'll correct this in #385 since the I think the `TableGeoStatistics` change 
is helpful regardless.


-- 
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]

Reply via email to