<?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 Pyspark Dataframe error while displaying data read from mongodb in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/databricks-pyspark-dataframe-error-while-displaying-data-read/m-p/79474#M35768</link>
    <description>&lt;P&gt;&lt;STRONG&gt;UPDATE:&lt;/STRONG&gt;&lt;BR /&gt;Installing&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;mongo-spark-connector_2.12-10.3.0-all.jar&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;from&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://repo1.maven.org/maven2/org/mongodb/spark/mongo-spark-connector_2.12/10.3.0/" target="_blank" rel="noopener nofollow ugc"&gt;Maven&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;does NOT require the JAR files below to be installed on the cluster to display the dataframe&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;bson&lt;/LI&gt;&lt;LI&gt;mongodb-driver-core&lt;/LI&gt;&lt;LI&gt;mongodb-driver-sync&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Also, I noticed that&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;both&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;DBR 13.3 LTS and 14.3 LTS work fine with this specific spark connector JAR file installed on the cluster.&lt;/P&gt;</description>
    <pubDate>Fri, 19 Jul 2024 16:20:36 GMT</pubDate>
    <dc:creator>an313x</dc:creator>
    <dc:date>2024-07-19T16:20:36Z</dc:date>
    <item>
      <title>Databricks Pyspark Dataframe error while displaying data read from mongodb</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-pyspark-dataframe-error-while-displaying-data-read/m-p/64056#M32450</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;We are trying to read data from mongodb using databricks notebook with pyspark connectivity.&lt;/P&gt;&lt;P&gt;When we try to display data frame data using show or display method , it gives error "org.bson.BsonInvalidOperationException:Document does not contain key count"&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data in mongo collection is in timeseries (struct) format .&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;connectionString&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;'mongodb+srv://CONNECTION_STRING_HERE/&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;database&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;"sample_supplies"&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;collection&lt;/SPAN&gt;&lt;SPAN class=""&gt;=&lt;/SPAN&gt;&lt;SPAN class=""&gt;"sales"&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;salesDF&lt;/SPAN&gt; &lt;SPAN class=""&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;spark&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;read&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;format&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;"mongo"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;option&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;"database"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;database&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;option&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;"collection"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;collection&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;option&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;"spark.mongodb.input.uri"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt; &lt;SPAN class=""&gt;connectionString&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN class=""&gt;load&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN class=""&gt;display&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN class=""&gt;salesDF&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;"org.bson.BsonInvalidOperationException:Document does not contain key count"&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 09:52:54 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-pyspark-dataframe-error-while-displaying-data-read/m-p/64056#M32450</guid>
      <dc:creator>pankaj30</dc:creator>
      <dc:date>2024-03-19T09:52:54Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks Pyspark Dataframe error while displaying data read from mongodb</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-pyspark-dataframe-error-while-displaying-data-read/m-p/64078#M32457</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/9"&gt;@Retired_mod&lt;/a&gt;&amp;nbsp; , I tried all above steps, still didn't work. Parallelly checking with Mongo team.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 13:08:25 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-pyspark-dataframe-error-while-displaying-data-read/m-p/64078#M32457</guid>
      <dc:creator>pankaj30</dc:creator>
      <dc:date>2024-03-19T13:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks Pyspark Dataframe error while displaying data read from mongodb</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-pyspark-dataframe-error-while-displaying-data-read/m-p/79452#M35765</link>
      <description>&lt;P&gt;Thanks,&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/9"&gt;@Retired_mod&lt;/a&gt;&amp;nbsp;for your input. I had the same problem and couldn't display the dataframe and I had only&amp;nbsp;&lt;STRONG&gt;mongo-spark-connector&lt;/STRONG&gt;&amp;nbsp;installed on my cluster (DBR 14.3 LTS Spark 3.5.0 and Scala 2.12). After I installed the rest of the suggested JAR files it still failed, but after I changed DBR to 13.3 LTS Spark 3.4.1 and Scala 2.12 it worked.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2024 15:17:14 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-pyspark-dataframe-error-while-displaying-data-read/m-p/79452#M35765</guid>
      <dc:creator>an313x</dc:creator>
      <dc:date>2024-07-19T15:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks Pyspark Dataframe error while displaying data read from mongodb</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-pyspark-dataframe-error-while-displaying-data-read/m-p/79474#M35768</link>
      <description>&lt;P&gt;&lt;STRONG&gt;UPDATE:&lt;/STRONG&gt;&lt;BR /&gt;Installing&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;mongo-spark-connector_2.12-10.3.0-all.jar&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;from&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://repo1.maven.org/maven2/org/mongodb/spark/mongo-spark-connector_2.12/10.3.0/" target="_blank" rel="noopener nofollow ugc"&gt;Maven&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;does NOT require the JAR files below to be installed on the cluster to display the dataframe&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;bson&lt;/LI&gt;&lt;LI&gt;mongodb-driver-core&lt;/LI&gt;&lt;LI&gt;mongodb-driver-sync&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Also, I noticed that&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;both&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;DBR 13.3 LTS and 14.3 LTS work fine with this specific spark connector JAR file installed on the cluster.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Jul 2024 16:20:36 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-pyspark-dataframe-error-while-displaying-data-read/m-p/79474#M35768</guid>
      <dc:creator>an313x</dc:creator>
      <dc:date>2024-07-19T16:20:36Z</dc:date>
    </item>
  </channel>
</rss>

