JimShady opened a new issue, #1514:
URL: https://github.com/apache/sedona/issues/1514

   I am trying to move a process which I currently run in PostGIS, to within 
the cloud and use Apache Sedona instead. In my PostgreSQL + PostGIS database 
this runs:
   
   ```
   WITH a_table AS (
   SELECT st_boundary(geom) geom
   FROM   emea_eu_seu.albania_prefectures_2021
   UNION ALL
   SELECT st_boundary(geom) geom
   FROM   emea_eu_seu.albania_municipalities_2021
   UNION ALL
   SELECT st_boundary(geom) geom
   FROM   emea_eu_seu.albania_2_digit_postcode_areas_2021
   ),
   b_table AS (
   SELECT   geom
   FROM     a_table
   GROUP BY geom
   )
   SELECT   ST_Union(geom) geom
   FROM     b_table
   ```
   
   The result is one row:
   
   
![image](https://github.com/apache/sedona/assets/2901470/8e467cf8-1025-4cda-8599-cc4ea6d0c75b)
   
   I have tried to run the same process using Sedona (code below) but get an 
error:
   
   ```
   WITH a_table AS (
   SELECT st_boundary(st_geomfromwkb(geom_wkb)) geom
   FROM   hive_metastore.gfk_bronze.albania_prefectures_2021
   UNION ALL
   SELECT st_boundary(st_geomfromwkb(geom_wkb)) geom
   FROM   hive_metastore.gfk_bronze.albania_municipalities_2021
   UNION ALL
   SELECT st_boundary(st_geomfromwkb(geom_wkb)) geom
   FROM   hive_metastore.gfk_bronze.albania_2_digit_postcode_areas_2021
   ),
   b_table AS (
   SELECT   geom
   FROM     a_table
   GROUP BY geom
   )
   SELECT   ST_Union(geom) geom
   FROM     b_table
   
   ```
   
   ```
   AnalysisException: [DATATYPE_MISMATCH.UNEXPECTED_INPUT_TYPE] Cannot resolve 
"st_union(geom)" due to data type mismatch: Parameter 1 requires the 
"ARRAY<BINARY>" type, however "geom" has the type "BINARY".; line 16 pos 9;
   'WithCTE
   ```
   
   I am using Sedona 1.6.0 by the way. I read "Variant 2 : As of version 1.6.0, 
this function accepts an array of Geometry objects and returns the geometric 
union of all geometries in the input array." so was expecting a similar result 
to that which PostGIS returns. Am I misunderstanding something?
   
   Thanks!


-- 
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: dev-unsubscr...@sedona.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to