<?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 Error while encoding: java.lang.RuntimeException: org.apache.spark.sql.catalyst.util.GenericArrayDa in Get Started Discussions</title>
    <link>https://community.databricks.com/t5/get-started-discussions/error-while-encoding-java-lang-runtimeexception-org-apache-spark/m-p/66586#M7106</link>
    <description>&lt;P&gt;Hello:)&lt;/P&gt;&lt;P&gt;we are trying to run an existing working flow that works currently on EMR, on databricks.&lt;/P&gt;&lt;P&gt;we use LTS 10.4, and when loading the data we get the following error:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;at org.apache.spark.api.python.BasePythonRunner$WriterThread.run(PythonRunner.scala:365)
Caused by: java.lang.RuntimeException: org.apache.spark.sql.catalyst.util.GenericArrayData is not a valid external type for schema of array&amp;lt;struct&amp;lt;id:string,name:string,name_type:string&amp;gt;&amp;gt;
at com.databricks.sql.expressions.codegen.RuntimeUtils.assertTrue(RuntimeUtils.java:77)
at org.apache.spark.sql.catalyst.expressions.GeneratedClass$SpecificUnsafeProjection.MapObjects_0$(Unknown Source)
at org.apache.spark.sql.catalyst.expressions.GeneratedClass$SpecificUnsafeProjection.apply(Unknown Source)
at org.apache.spark.sql.catalyst.encoders.ExpressionEncoder$Serializer.apply(ExpressionEncoder.scala:233)
... 19 more
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it's important to note that the same code works on emr with spark version 3.2.1. we tried looking at the data, removing some of the columns - but the data is consistent with the structure.&lt;/P&gt;&lt;P&gt;did anyone encounter this and could provide assistance in identifying the cause? we'd be happy to share more of the stack if relevant.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
    <pubDate>Thu, 18 Apr 2024 11:03:28 GMT</pubDate>
    <dc:creator>liormayn</dc:creator>
    <dc:date>2024-04-18T11:03:28Z</dc:date>
    <item>
      <title>Error while encoding: java.lang.RuntimeException: org.apache.spark.sql.catalyst.util.GenericArrayDa</title>
      <link>https://community.databricks.com/t5/get-started-discussions/error-while-encoding-java-lang-runtimeexception-org-apache-spark/m-p/66586#M7106</link>
      <description>&lt;P&gt;Hello:)&lt;/P&gt;&lt;P&gt;we are trying to run an existing working flow that works currently on EMR, on databricks.&lt;/P&gt;&lt;P&gt;we use LTS 10.4, and when loading the data we get the following error:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;at org.apache.spark.api.python.BasePythonRunner$WriterThread.run(PythonRunner.scala:365)
Caused by: java.lang.RuntimeException: org.apache.spark.sql.catalyst.util.GenericArrayData is not a valid external type for schema of array&amp;lt;struct&amp;lt;id:string,name:string,name_type:string&amp;gt;&amp;gt;
at com.databricks.sql.expressions.codegen.RuntimeUtils.assertTrue(RuntimeUtils.java:77)
at org.apache.spark.sql.catalyst.expressions.GeneratedClass$SpecificUnsafeProjection.MapObjects_0$(Unknown Source)
at org.apache.spark.sql.catalyst.expressions.GeneratedClass$SpecificUnsafeProjection.apply(Unknown Source)
at org.apache.spark.sql.catalyst.encoders.ExpressionEncoder$Serializer.apply(ExpressionEncoder.scala:233)
... 19 more
&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it's important to note that the same code works on emr with spark version 3.2.1. we tried looking at the data, removing some of the columns - but the data is consistent with the structure.&lt;/P&gt;&lt;P&gt;did anyone encounter this and could provide assistance in identifying the cause? we'd be happy to share more of the stack if relevant.&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2024 11:03:28 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/error-while-encoding-java-lang-runtimeexception-org-apache-spark/m-p/66586#M7106</guid>
      <dc:creator>liormayn</dc:creator>
      <dc:date>2024-04-18T11:03:28Z</dc:date>
    </item>
  </channel>
</rss>

