zhangfengcdt commented on PR #254:
URL: https://github.com/apache/sedona-db/pull/254#issuecomment-3475318924

   @paleolimbot I think I found the issue after using your example code that 
the issue is isolated to some SQL functions, not all. For example:
   
   This preserve the metadata created in the ST_GeomFromText:
   ```
   SELECT ST_AsText(ST_Envelope_Aggr(geom)) FROM (
           VALUES
               (ST_GeomFromText('POINT (1 2)')),
               (ST_GeomFromText('POINT (3 4)')),
               (ST_GeomFromText('POINT (5 6)'))
       ) AS t(geom)
   ```
   
   BUT, this one does not:
   ```
   SELECT ST_AsText(ST_Envelope_Aggr(geom)) FROM (
           SELECT ST_GeomFromText('POINT (1 2)') as geom
           UNION ALL
           SELECT ST_GeomFromText('POINT (3 4)') as geom
           UNION ALL
           SELECT ST_GeomFromText('POINT (5 6)') as geom
       ) AS t(geom)
   ```
   
   This surely shows the bug in Datafusion and I think I will try to find time 
fix it upstream there. For now,  I can change the unit test to use the UNION 
ALL or read from parquet. I don't think the bug of the "VALUES" syntax with 
metadata carry-over will impact a lot of real use cases at this stage.
   


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