likawa3b opened a new issue, #13109:
URL: https://github.com/apache/iceberg/issues/13109

   ### Query engine
   
   Spark and Sedona
   
   ### Question
   
   ```
   from pyspark.sql import SparkSession
   from sedona.spark import SedonaContext
   from pyspark.sql.functions import expr
   
   spark = (
       SparkSession.builder
         .appName("SedonaIcebergApp")
         .master("local[*]")
         .config(
             "spark.jars.packages",
             ",".join([
                 "org.apache.sedona:sedona-spark-shaded-3.5_2.12:1.7.1",
                 "org.datasyslab:geotools-wrapper:1.7.1-28.5",
                 "org.apache.iceberg:iceberg-spark-runtime-3.5_2.12:1.9.0"
             ])
         )
         .config(
             "spark.jars.repositories",
             "https://artifacts.unidata.ucar.edu/repository/unidata-all";
         )
         .config("spark.sql.catalog.local",        
"org.apache.iceberg.spark.SparkCatalog")
         .config("spark.sql.catalog.local.type",   "hadoop")
         .config("spark.sql.catalog.local.warehouse", "spark-warehouse")
         .config("spark.sql.extensions",
                 
"org.apache.iceberg.spark.extensions.IcebergSparkSessionExtensions,"
                 "org.apache.sedona.sql.SedonaSqlExtensions")
         .getOrCreate()
   )
   
   sedona = SedonaContext.create(spark)
   
   df = sedona.createDataFrame([
       ("a", 'LINESTRING(1.0 3.0,3.0 1.0)'),
       ("b", 'LINESTRING(2.0 5.0,6.0 1.0)'),
   ], ["id", "geometry"])
   df = df.withColumn("geometry", expr("ST_GeomFromText(geometry)"))
   
   df.writeTo("local.default.test_geo") \
       .using("iceberg") \
       .tableProperty("format-version", "3") \
       .createOrReplace()
   ```
   
   But i got this error: UnsupportedOperationException: User-defined types are 
not supported
   
   I expect a iceberg table with native geometry column created in parquet 
format.


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to