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

   Platform is Databricks - DBR 16.4 LTS
   Spark - 3.5.2
   Scala - 2.13
   
   I have followed https://sedona.apache.org/latest/setup/databricks/ and use 
Sedona within Python with `spark.sql` and it works fine. I now wish to scale up 
and use a spatial RDD. I load my data in Python, create a view and I can create 
a spatial RDD in Scala as follows;
   
   ```
   %scala
   import org.apache.spark.sql.sedona_sql.adapters.StructuredAdapter
   
   val scalaDf = spark.sql("select * from df")
   val spatialRdd = StructuredAdapter.toSpatialRdd(scalaDf, "geometry")
   spatialRdd.analyze()
   spatialRdd.boundary()
   ```
   
   And the boundary is printed as you would expect. This means the Sedona jars 
are on the classpath.
   
   But in Python this fails with;
   
   ```
   from sedona.spark import *
   from sedona.utils.structured_adapter import StructuredAdapter
   
   # create df code omitted
   
   spatial_rdd = StructuredAdapter.toSpatialRdd(df, "geometry")
   ```
   
   And this fails with 
   
   ```
        50     srdd = jvm.StructuredAdapter.toSpatialRdd(dataFrame._jdf)
        51 else:
   ---> 52     srdd = jvm.StructuredAdapter.toSpatialRdd(dataFrame._jdf, 
geometryFieldName)
        54 spatial_rdd = SpatialRDD(sc)
        55 spatial_rdd.set_srdd(srdd)
   
   TypeError: 'JavaPackage' object is not callable
   ```
   
   In previous versions of Sedona a python adapter was needed but I am not 
seeing this in the new docs.
   
   The Sedona raster and spatial SQL functions work just fine in Python using 
`spark.sql`.


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