<?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 Spark 3 AQE and cache in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/spark-3-aqe-and-cache/m-p/22042#M15060</link>
    <description>&lt;P&gt;Hello everybody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I recently discovered (the hard way) that when a query plan uses cached data, the AQE does not kick-in. Result is that you loose the super cool feature of dynamic partition coalesce (no more custom shuffle readers in the DAG). &lt;/P&gt;&lt;P&gt;Is there a way to combine both? If not, do you guys know what the rule is or have any links I could read? &lt;/P&gt;&lt;P&gt;My understanding after testing is that if a cached dataframe in present in the sql query, then you have no adaptive query plan on the whole query. Is that correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Pantelis&lt;/P&gt;</description>
    <pubDate>Wed, 27 Apr 2022 07:41:08 GMT</pubDate>
    <dc:creator>pantelis_mare</dc:creator>
    <dc:date>2022-04-27T07:41:08Z</dc:date>
    <item>
      <title>Spark 3 AQE and cache</title>
      <link>https://community.databricks.com/t5/data-engineering/spark-3-aqe-and-cache/m-p/22042#M15060</link>
      <description>&lt;P&gt;Hello everybody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I recently discovered (the hard way) that when a query plan uses cached data, the AQE does not kick-in. Result is that you loose the super cool feature of dynamic partition coalesce (no more custom shuffle readers in the DAG). &lt;/P&gt;&lt;P&gt;Is there a way to combine both? If not, do you guys know what the rule is or have any links I could read? &lt;/P&gt;&lt;P&gt;My understanding after testing is that if a cached dataframe in present in the sql query, then you have no adaptive query plan on the whole query. Is that correct?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Pantelis&lt;/P&gt;</description>
      <pubDate>Wed, 27 Apr 2022 07:41:08 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/spark-3-aqe-and-cache/m-p/22042#M15060</guid>
      <dc:creator>pantelis_mare</dc:creator>
      <dc:date>2022-04-27T07:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: Spark 3 AQE and cache</title>
      <link>https://community.databricks.com/t5/data-engineering/spark-3-aqe-and-cache/m-p/22043#M15061</link>
      <description>&lt;P&gt;Hi @Pantelis Maroudis​&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you have a sample query to test this?  AQE was kicked in when I tried with a simple aggregation query (i.e group by) on a cached table. &lt;/P&gt;</description>
      <pubDate>Tue, 09 Aug 2022 02:41:47 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/spark-3-aqe-and-cache/m-p/22043#M15061</guid>
      <dc:creator>User16763506477</dc:creator>
      <dc:date>2022-08-09T02:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: Spark 3 AQE and cache</title>
      <link>https://community.databricks.com/t5/data-engineering/spark-3-aqe-and-cache/m-p/22044#M15062</link>
      <description>&lt;P&gt;Hi @Pantelis Maroudis​,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you check the physical query plan? did you check the SQL sub tab with in Spark UI? it will help you to undertand better what is happening.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2022 20:45:53 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/spark-3-aqe-and-cache/m-p/22044#M15062</guid>
      <dc:creator>jose_gonzalez</dc:creator>
      <dc:date>2022-08-15T20:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: Spark 3 AQE and cache</title>
      <link>https://community.databricks.com/t5/data-engineering/spark-3-aqe-and-cache/m-p/22045#M15063</link>
      <description>&lt;P&gt;Hello @Gaurav Rupnar​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following code snippet reproduces my statement.&lt;/P&gt;&lt;P&gt;See how the query plan changes when you comment the cache() on the res dataframe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;spark.conf.set("spark.sql.shuffle.partitions", 2000)
spark.conf.set("spark.sql.autoBroadcastJoinThreshold", -1)
&amp;nbsp;
val factData = Seq(1,2,3,4,5,6,7,8,9,10).toDF("value")
val dimData = Seq(1,2,3).toDF("value")
&amp;nbsp;
val res = factData.join(dimData, Seq("value"))
&amp;nbsp;
res.cache()
res.write.format("noop").mode("append").save()
res.unpersist()&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Sep 2022 16:28:00 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/spark-3-aqe-and-cache/m-p/22045#M15063</guid>
      <dc:creator>pantelis_mare</dc:creator>
      <dc:date>2022-09-13T16:28:00Z</dc:date>
    </item>
  </channel>
</rss>

