<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to use Apache Sedona on Delta Live tables? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-to-use-apache-sedona-on-delta-live-tables/m-p/20331#M13712</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to run some geospatial transformations in Delta Live Table, using Apache Sedona.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried defining a minimal example pipeline demonstrating the problem I encounter.&lt;/P&gt;&lt;P&gt;First cell of my Notebook, I install apache-sedona Python package:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;%pip install apache-sedona&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;then I only use SedonaRegistrator.registerAll (to enable geospatial processing in SQL) and return an empty dataframe (that code is not reached anyway):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;import dlt
from pyspark.sql import SparkSession
from sedona.register import SedonaRegistrator
&amp;nbsp;
&amp;nbsp;
@dlt.table(comment="Test temporary table", temporary=True)
def my_temp_table():
    SedonaRegistrator.registerAll(spark)
    return spark.createDataFrame(data=[], schema=StructType([]))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I created the DLT Pipeline leaving everything as default, except for the spark configuration:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/1859i64268F17878FF075/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;Here is the uncut value of "spark.jars.packages": "org.apache.sedona:sedona-python-adapter-3.0_2.12:1.2.0-incubating,org.datasyslab:geotools-wrapper:1.1.0-25.2". This is required according to &lt;A href="https://sedona.apache.org/setup/install-python/" alt="https://sedona.apache.org/setup/install-python/" target="_blank"&gt;this documentation&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I run the Pipeline, I get the following error:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;py4j.Py4JException: An exception was raised by the Python Proxy. Return Message: Traceback (most recent call last):
  File "/databricks/spark/python/lib/py4j-0.10.9.1-src.zip/py4j/java_gateway.py", line 2442, in _call_proxy
    return_value = getattr(self.pool[obj_id], method)(*params)
  File "/databricks/spark/python/dlt/helpers.py", line 22, in call
    res = self.func()
  File "&amp;lt;command--1&amp;gt;", line 8, in my_temp_table
  File "/local_disk0/.ephemeral_nfs/envs/pythonEnv-0ecd1771-412a-4887-9fc3-44233ebe4058/lib/python3.8/site-packages/sedona/register/geo_registrator.py", line 43, in registerAll
    cls.register(spark)
  File "/local_disk0/.ephemeral_nfs/envs/pythonEnv-0ecd1771-412a-4887-9fc3-44233ebe4058/lib/python3.8/site-packages/sedona/register/geo_registrator.py", line 48, in register
    return spark._jvm.SedonaSQLRegistrator.registerAll(spark._jsparkSession)
TypeError: 'JavaPackage' object is not callable&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I can reproduce this error by running spark on my computer and avoiding installing the packages specified in "spark.jars.packages" above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess that this DLT Pipeline is not correctly configured to install Apache Sedona. I could not find any documentation describing how to install Sedona or other packages on a DLT Pipeline.&lt;/P&gt;&lt;P&gt;Does anyone know how/if it is possible to do it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a nice day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit:&lt;/P&gt;&lt;P&gt;What I also tried so far, without success:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;using an init script -&amp;gt; not supported in DLT&lt;/LI&gt;&lt;LI&gt;using a jar library -&amp;gt; not supported in DLT&lt;/LI&gt;&lt;LI&gt;using a maven library -&amp;gt; not supported in DLT&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 17 May 2022 11:11:23 GMT</pubDate>
    <dc:creator>NicolasJ</dc:creator>
    <dc:date>2022-05-17T11:11:23Z</dc:date>
    <item>
      <title>How to use Apache Sedona on Delta Live tables?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-use-apache-sedona-on-delta-live-tables/m-p/20331#M13712</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to run some geospatial transformations in Delta Live Table, using Apache Sedona.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried defining a minimal example pipeline demonstrating the problem I encounter.&lt;/P&gt;&lt;P&gt;First cell of my Notebook, I install apache-sedona Python package:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;%pip install apache-sedona&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;then I only use SedonaRegistrator.registerAll (to enable geospatial processing in SQL) and return an empty dataframe (that code is not reached anyway):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;import dlt
from pyspark.sql import SparkSession
from sedona.register import SedonaRegistrator
&amp;nbsp;
&amp;nbsp;
@dlt.table(comment="Test temporary table", temporary=True)
def my_temp_table():
    SedonaRegistrator.registerAll(spark)
    return spark.createDataFrame(data=[], schema=StructType([]))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I created the DLT Pipeline leaving everything as default, except for the spark configuration:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="image"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/1859i64268F17878FF075/image-size/large?v=v2&amp;amp;px=999" role="button" title="image" alt="image" /&gt;&lt;/span&gt;Here is the uncut value of "spark.jars.packages": "org.apache.sedona:sedona-python-adapter-3.0_2.12:1.2.0-incubating,org.datasyslab:geotools-wrapper:1.1.0-25.2". This is required according to &lt;A href="https://sedona.apache.org/setup/install-python/" alt="https://sedona.apache.org/setup/install-python/" target="_blank"&gt;this documentation&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I run the Pipeline, I get the following error:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;py4j.Py4JException: An exception was raised by the Python Proxy. Return Message: Traceback (most recent call last):
  File "/databricks/spark/python/lib/py4j-0.10.9.1-src.zip/py4j/java_gateway.py", line 2442, in _call_proxy
    return_value = getattr(self.pool[obj_id], method)(*params)
  File "/databricks/spark/python/dlt/helpers.py", line 22, in call
    res = self.func()
  File "&amp;lt;command--1&amp;gt;", line 8, in my_temp_table
  File "/local_disk0/.ephemeral_nfs/envs/pythonEnv-0ecd1771-412a-4887-9fc3-44233ebe4058/lib/python3.8/site-packages/sedona/register/geo_registrator.py", line 43, in registerAll
    cls.register(spark)
  File "/local_disk0/.ephemeral_nfs/envs/pythonEnv-0ecd1771-412a-4887-9fc3-44233ebe4058/lib/python3.8/site-packages/sedona/register/geo_registrator.py", line 48, in register
    return spark._jvm.SedonaSQLRegistrator.registerAll(spark._jsparkSession)
TypeError: 'JavaPackage' object is not callable&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I can reproduce this error by running spark on my computer and avoiding installing the packages specified in "spark.jars.packages" above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess that this DLT Pipeline is not correctly configured to install Apache Sedona. I could not find any documentation describing how to install Sedona or other packages on a DLT Pipeline.&lt;/P&gt;&lt;P&gt;Does anyone know how/if it is possible to do it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a nice day.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit:&lt;/P&gt;&lt;P&gt;What I also tried so far, without success:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;using an init script -&amp;gt; not supported in DLT&lt;/LI&gt;&lt;LI&gt;using a jar library -&amp;gt; not supported in DLT&lt;/LI&gt;&lt;LI&gt;using a maven library -&amp;gt; not supported in DLT&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 11:11:23 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-use-apache-sedona-on-delta-live-tables/m-p/20331#M13712</guid>
      <dc:creator>NicolasJ</dc:creator>
      <dc:date>2022-05-17T11:11:23Z</dc:date>
    </item>
  </channel>
</rss>

