<?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: count or toPandas taking too long in Get Started Discussions</title>
    <link>https://community.databricks.com/t5/get-started-discussions/count-or-topandas-taking-too-long/m-p/69063#M3011</link>
    <description>&lt;P&gt;Hi,&amp;nbsp; it is quite normal that converting data frame from spark to pandas takes time.&lt;BR /&gt;Although there is a way we can optimize it.&lt;BR /&gt;Enable Arrow Optimization: Starting from Spark 3.0.0, We can enable arrow optimization, this will speed up the process by enabling&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;the use of Apache Arrow for faster data transfer between Spark and Python.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;spark.conf.set("spark.sql.execution.arrow.pyspark.enabled", "true")&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 15 May 2024 08:44:45 GMT</pubDate>
    <dc:creator>Hkesharwani</dc:creator>
    <dc:date>2024-05-15T08:44:45Z</dc:date>
    <item>
      <title>count or toPandas taking too long</title>
      <link>https://community.databricks.com/t5/get-started-discussions/count-or-topandas-taking-too-long/m-p/52423#M1792</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am fetching data from unity catalog from notebooks using spark.sql(). The query takes just a few seconds - I am actually trying to retrieving 2 rows - but some operations like count() or toPandas() take forever. I wonder why does it take so long and if there is a way to speed up those operations.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Compute: personal compute m5d.2xlarge (&lt;SPAN&gt;14.1 (includes Apache Spark 3.5.0, Scala 2.12))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Nov 2023 16:18:41 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/count-or-topandas-taking-too-long/m-p/52423#M1792</guid>
      <dc:creator>jimcast</dc:creator>
      <dc:date>2023-11-16T16:18:41Z</dc:date>
    </item>
    <item>
      <title>Re: count or toPandas taking too long</title>
      <link>https://community.databricks.com/t5/get-started-discussions/count-or-topandas-taking-too-long/m-p/69063#M3011</link>
      <description>&lt;P&gt;Hi,&amp;nbsp; it is quite normal that converting data frame from spark to pandas takes time.&lt;BR /&gt;Although there is a way we can optimize it.&lt;BR /&gt;Enable Arrow Optimization: Starting from Spark 3.0.0, We can enable arrow optimization, this will speed up the process by enabling&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;the use of Apache Arrow for faster data transfer between Spark and Python.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;spark.conf.set("spark.sql.execution.arrow.pyspark.enabled", "true")&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 May 2024 08:44:45 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/count-or-topandas-taking-too-long/m-p/69063#M3011</guid>
      <dc:creator>Hkesharwani</dc:creator>
      <dc:date>2024-05-15T08:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: count or toPandas taking too long</title>
      <link>https://community.databricks.com/t5/get-started-discussions/count-or-topandas-taking-too-long/m-p/70781#M3041</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/94031"&gt;@jimcast&lt;/a&gt;&amp;nbsp;how are you?&lt;/P&gt;
&lt;P&gt;You can check the internals and have a good hint of what's happening using the SparkUI. Filter and select the jobs that are taking the longest and check what is being requested on the SQL/Data Frame tab, as well as their plans.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If your data is public, please also share more details (such as logs, prints and dumps) so we can better help you with.&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;Alessandro&lt;/P&gt;</description>
      <pubDate>Mon, 27 May 2024 17:52:19 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/count-or-topandas-taking-too-long/m-p/70781#M3041</guid>
      <dc:creator>anardinelli</dc:creator>
      <dc:date>2024-05-27T17:52:19Z</dc:date>
    </item>
  </channel>
</rss>

