<?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 Streaming foreachBatch _jdf jvm attribute not supported in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/streaming-foreachbatch-jdf-jvm-attribute-not-supported/m-p/74564#M34756</link>
    <description>&lt;P&gt;I'm trying to perform a merge inside a streaming foreachbatch using the command:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;microBatchDF._jdf.sparkSession().sql(self.merge_query)&lt;/EM&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;Streaming runs fine if I use a Personal cluster while if I use a Shared cluster streaming fails with the following error:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;org.apache.spark.api.python.PythonException: Found error inside foreachBatch Python process: Traceback (most recent call last):&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;pyspark.errors.exceptions.base.PySparkAttributeError: [JVM_ATTRIBUTE_NOT_SUPPORTED] Attribute `_jdf` is not supported in Spark Connect as it depends on the JVM. If you need to use this attribute, do not use Spark Connect when creating your session. Visit &lt;A href="https://spark.apache.org/docs/latest/sql-getting-started.html#starting-point-sparksession" target="_blank"&gt;https://spark.apache.org/docs/latest/sql-getting-started.html#starting-point-sparksession&lt;/A&gt; for creating regular Spark Session in detail.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 17 Jun 2024 09:00:40 GMT</pubDate>
    <dc:creator>diego_poggioli</dc:creator>
    <dc:date>2024-06-17T09:00:40Z</dc:date>
    <item>
      <title>Streaming foreachBatch _jdf jvm attribute not supported</title>
      <link>https://community.databricks.com/t5/data-engineering/streaming-foreachbatch-jdf-jvm-attribute-not-supported/m-p/74564#M34756</link>
      <description>&lt;P&gt;I'm trying to perform a merge inside a streaming foreachbatch using the command:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;microBatchDF._jdf.sparkSession().sql(self.merge_query)&lt;/EM&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;Streaming runs fine if I use a Personal cluster while if I use a Shared cluster streaming fails with the following error:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;org.apache.spark.api.python.PythonException: Found error inside foreachBatch Python process: Traceback (most recent call last):&lt;/EM&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;EM&gt;pyspark.errors.exceptions.base.PySparkAttributeError: [JVM_ATTRIBUTE_NOT_SUPPORTED] Attribute `_jdf` is not supported in Spark Connect as it depends on the JVM. If you need to use this attribute, do not use Spark Connect when creating your session. Visit &lt;A href="https://spark.apache.org/docs/latest/sql-getting-started.html#starting-point-sparksession" target="_blank"&gt;https://spark.apache.org/docs/latest/sql-getting-started.html#starting-point-sparksession&lt;/A&gt; for creating regular Spark Session in detail.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;Any idea?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 09:00:40 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/streaming-foreachbatch-jdf-jvm-attribute-not-supported/m-p/74564#M34756</guid>
      <dc:creator>diego_poggioli</dc:creator>
      <dc:date>2024-06-17T09:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: Streaming foreachBatch _jdf jvm attribute not supported</title>
      <link>https://community.databricks.com/t5/data-engineering/streaming-foreachbatch-jdf-jvm-attribute-not-supported/m-p/75212#M34895</link>
      <description>&lt;P&gt;Can you share what runtime your cluster is using?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This error doesn't surprise me, Unity Catalog Shared clusters have many security limitations, but the list is reducing over time. &lt;A href="https://docs.databricks.com/en/compute/access-mode-limitations.html#shared-access-mode-limitations-on-unity-catalog" target="_blank"&gt;https://docs.databricks.com/en/compute/access-mode-limitations.html#shared-access-mode-limitations-on-unity-catalog&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 14:46:53 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/streaming-foreachbatch-jdf-jvm-attribute-not-supported/m-p/75212#M34895</guid>
      <dc:creator>holly</dc:creator>
      <dc:date>2024-06-20T14:46:53Z</dc:date>
    </item>
  </channel>
</rss>

