<?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 Re: Databricks Connect Scala - in Get Started Discussions</title>
    <link>https://community.databricks.com/t5/get-started-discussions/databricks-connect-scala/m-p/61731#M2717</link>
    <description>&lt;P&gt;I just hope Databricks will pay attention to it.&lt;/P&gt;</description>
    <pubDate>Fri, 23 Feb 2024 15:38:41 GMT</pubDate>
    <dc:creator>dollyb</dc:creator>
    <dc:date>2024-02-23T15:38:41Z</dc:date>
    <item>
      <title>Databricks Connect Scala -</title>
      <link>https://community.databricks.com/t5/get-started-discussions/databricks-connect-scala/m-p/61415#M2674</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm using Databricks Connect to run Scala code from IntelliJ on a Databricks single node cluster.&lt;/P&gt;&lt;P&gt;Even with the simplest code, I'm experiencing this error:&lt;/P&gt;&lt;PRE&gt;org.apache.spark.SparkException: grpc_shaded.io.grpc.StatusRuntimeException: INTERNAL: org.apache.spark.sql.types.StructType; local class incompatible: stream classdesc serialVersionUID = -2957078008500330718, local class serialVersionUID = 7842785351289879144&lt;/PRE&gt;&lt;P&gt;Creating and processing dataframes works, but as soon as I try to do the simplest processing it fails.&lt;/P&gt;&lt;P&gt;Minimal code example to reproduce:&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;val &lt;/SPAN&gt;df &lt;SPAN&gt;= &lt;/SPAN&gt;spark.read.table(&lt;SPAN&gt;"samples.nyctaxi.trips"&lt;/SPAN&gt;)&lt;BR /&gt;&lt;SPAN&gt;import &lt;/SPAN&gt;spark.&lt;SPAN&gt;implicits&lt;/SPAN&gt;._&lt;BR /&gt;df&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;  .map(_.getAs[Int]&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"dropoff_zip"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;)&lt;BR /&gt;  .show(&lt;SPAN&gt;10&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;Happens with both 13.3 LTS and 14.3 LTS. Databricks Connect dependency has the same version as the cluster, Scala is 2.12.15, JDK 8 Azul.&lt;/P&gt;&lt;P&gt;Same code works fine in a notebook.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 07:16:19 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/databricks-connect-scala/m-p/61415#M2674</guid>
      <dc:creator>dollyb</dc:creator>
      <dc:date>2024-02-22T07:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks Connect Scala -</title>
      <link>https://community.databricks.com/t5/get-started-discussions/databricks-connect-scala/m-p/61459#M2676</link>
      <description>&lt;DIV&gt;&lt;P&gt;Forgot to add that I included the code as described in the docs:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;val &lt;/SPAN&gt;sourceLocation &lt;SPAN&gt;= &lt;/SPAN&gt;getClass.getProtectionDomain.getCodeSource.getLocation.toURI&lt;/PRE&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;DatabricksSession&lt;/SPAN&gt;.builder()&lt;BR /&gt;  .clusterId(clusterId)&lt;/PRE&gt;&lt;DIV&gt;&lt;PRE&gt;  .addCompiledArtifacts(sourceLocation)&lt;BR /&gt;  .getOrCreate()&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 22 Feb 2024 12:44:53 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/databricks-connect-scala/m-p/61459#M2676</guid>
      <dc:creator>dollyb</dc:creator>
      <dc:date>2024-02-22T12:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks Connect Scala -</title>
      <link>https://community.databricks.com/t5/get-started-discussions/databricks-connect-scala/m-p/61473#M2677</link>
      <description>&lt;P&gt;can you check your build.sbt?&lt;BR /&gt;&lt;A href="https://docs.databricks.com/en/dev-tools/databricks-connect/scala/index.html" target="_blank"&gt;https://docs.databricks.com/en/dev-tools/databricks-connect/scala/index.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Also, in your session builder I do not see the remote()&amp;nbsp; or sdkconfig() part.&lt;BR /&gt;Can you go through the docs and check everything?&amp;nbsp;&lt;BR /&gt;It should work, checked myself last week.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 13:34:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/databricks-connect-scala/m-p/61473#M2677</guid>
      <dc:creator>-werners-</dc:creator>
      <dc:date>2024-02-22T13:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks Connect Scala -</title>
      <link>https://community.databricks.com/t5/get-started-discussions/databricks-connect-scala/m-p/61474#M2678</link>
      <description>&lt;P&gt;I notice you call the addcompiledartifacts API, that is used for UDFs packed in a jar that is installed on the cluster.&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.databricks.com/en/dev-tools/databricks-connect/scala/udf.html" target="_blank"&gt;https://docs.databricks.com/en/dev-tools/databricks-connect/scala/udf.html&lt;/A&gt;Is that the case for you?&amp;nbsp; It seems you only want to run the default example.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 13:39:44 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/databricks-connect-scala/m-p/61474#M2678</guid>
      <dc:creator>-werners-</dc:creator>
      <dc:date>2024-02-22T13:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks Connect Scala -</title>
      <link>https://community.databricks.com/t5/get-started-discussions/databricks-connect-scala/m-p/61481#M2679</link>
      <description>&lt;P&gt;I left that out, my connection looks like this:&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;val &lt;/SPAN&gt;spark: &lt;SPAN&gt;SparkSession &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;BR /&gt;&lt;/SPAN&gt;  &lt;SPAN&gt;DatabricksSession&lt;/SPAN&gt;.builder()&lt;BR /&gt;    .host("xxx")&lt;BR /&gt;    .token(&lt;SPAN&gt;"xxx"&lt;/SPAN&gt;)&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;    .clusterId("xxx")&lt;BR /&gt;    .addCompiledArtifacts(sourceLocation) // tried with and without this&lt;BR /&gt;    .getOrCreate()&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 22 Feb 2024 14:20:55 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/databricks-connect-scala/m-p/61481#M2679</guid>
      <dc:creator>dollyb</dc:creator>
      <dc:date>2024-02-22T14:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks Connect Scala -</title>
      <link>https://community.databricks.com/t5/get-started-discussions/databricks-connect-scala/m-p/61482#M2680</link>
      <description>&lt;P&gt;The documentation states:&amp;nbsp;&lt;SPAN&gt;"The same mechanism described in the preceding section for UDFs also applies to typed Dataset APIs.".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;My&lt;/P&gt;&lt;PRE&gt;map(_.getAs[Int]&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"dropoff_zip"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;is like a UDF, so that's why I'm adding the compiled source.&lt;/P&gt;&lt;P&gt;(I also had to do it in a similar way when trying Spark Connect against a Spark 3.5.0 cluster, and it ran successfully).&lt;/P&gt;&lt;P&gt;By the way, as soon as I leave out the .map(), it runs, so the error has to do with user functions / Dataset API.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 14:29:51 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/databricks-connect-scala/m-p/61482#M2680</guid>
      <dc:creator>dollyb</dc:creator>
      <dc:date>2024-02-22T14:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks Connect Scala -</title>
      <link>https://community.databricks.com/t5/get-started-discussions/databricks-connect-scala/m-p/61487#M2681</link>
      <description>&lt;P&gt;I see, so it can't be the connection.&lt;BR /&gt;does importing udf help?&amp;nbsp; Just guessing here (after reading the docs for typed&amp;nbsp; dataset api)&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 15:14:29 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/databricks-connect-scala/m-p/61487#M2681</guid>
      <dc:creator>-werners-</dc:creator>
      <dc:date>2024-02-22T15:14:29Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks Connect Scala -</title>
      <link>https://community.databricks.com/t5/get-started-discussions/databricks-connect-scala/m-p/61491#M2682</link>
      <description>&lt;P&gt;Using a proper UDF does indeed work:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;val &lt;/SPAN&gt;myUdf &lt;SPAN&gt;= &lt;/SPAN&gt;udf &lt;SPAN&gt;{ &lt;/SPAN&gt;&lt;SPAN&gt;row&lt;/SPAN&gt;: Int &lt;SPAN&gt;=&amp;gt;&lt;BR /&gt;&lt;/SPAN&gt;  &lt;SPAN&gt;row &lt;/SPAN&gt;&lt;SPAN&gt;* &lt;/SPAN&gt;&lt;SPAN&gt;5&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;BR /&gt;df.withColumn("dropoff_zip_processed", myUdf($"dropoff_zip"))&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;It's just the Dataset API that doesn't work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 22 Feb 2024 16:04:00 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/databricks-connect-scala/m-p/61491#M2682</guid>
      <dc:creator>dollyb</dc:creator>
      <dc:date>2024-02-22T16:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks Connect Scala -</title>
      <link>https://community.databricks.com/t5/get-started-discussions/databricks-connect-scala/m-p/61643#M2709</link>
      <description>&lt;P&gt;So this is clearly a bug in Databricks Connect. I'm not on a support plan, so not sure how to report a bug on this...&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 07:14:43 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/databricks-connect-scala/m-p/61643#M2709</guid>
      <dc:creator>dollyb</dc:creator>
      <dc:date>2024-02-23T07:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks Connect Scala -</title>
      <link>https://community.databricks.com/t5/get-started-discussions/databricks-connect-scala/m-p/61648#M2710</link>
      <description>&lt;P&gt;I also tried on a shared cluster, and the error message is pretty clear&lt;/P&gt;&lt;P&gt;org.sparkproject.io.grpc.StatusRuntimeException: INVALID_ARGUMENT: User defined code is not yet supported.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 08:03:04 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/databricks-connect-scala/m-p/61648#M2710</guid>
      <dc:creator>dollyb</dc:creator>
      <dc:date>2024-02-23T08:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks Connect Scala -</title>
      <link>https://community.databricks.com/t5/get-started-discussions/databricks-connect-scala/m-p/61651#M2711</link>
      <description>&lt;P&gt;that is pretty clear indeed.&lt;BR /&gt;But according to the docs it should be supported.&lt;BR /&gt;Since scala support only went GA on 1st of feb 2024, chances are we are talking about a bug here.&lt;/P&gt;&lt;P&gt;Are you sure you added the correct databricks connect jar? (14.3)&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 08:29:10 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/databricks-connect-scala/m-p/61651#M2711</guid>
      <dc:creator>-werners-</dc:creator>
      <dc:date>2024-02-23T08:29:10Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks Connect Scala -</title>
      <link>https://community.databricks.com/t5/get-started-discussions/databricks-connect-scala/m-p/61667#M2712</link>
      <description>&lt;P&gt;Yes, I tried both 14.3.0 and 14.3.1.&lt;/P&gt;&lt;P&gt;I'm also encountering the same (or very similar) error when firing against a local Spark Connect cluster. When I replace databricks-connect with spark-connect, it works.&lt;/P&gt;&lt;P&gt;I sent a bug report to help@databricks.com.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 10:18:27 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/databricks-connect-scala/m-p/61667#M2712</guid>
      <dc:creator>dollyb</dc:creator>
      <dc:date>2024-02-23T10:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks Connect Scala -</title>
      <link>https://community.databricks.com/t5/get-started-discussions/databricks-connect-scala/m-p/61694#M2714</link>
      <description>&lt;P&gt;nice find.&lt;BR /&gt;definitely a bug if it works in spark-connect.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 11:40:30 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/databricks-connect-scala/m-p/61694#M2714</guid>
      <dc:creator>-werners-</dc:creator>
      <dc:date>2024-02-23T11:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks Connect Scala -</title>
      <link>https://community.databricks.com/t5/get-started-discussions/databricks-connect-scala/m-p/61731#M2717</link>
      <description>&lt;P&gt;I just hope Databricks will pay attention to it.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 15:38:41 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/databricks-connect-scala/m-p/61731#M2717</guid>
      <dc:creator>dollyb</dc:creator>
      <dc:date>2024-02-23T15:38:41Z</dc:date>
    </item>
  </channel>
</rss>

