<?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: Delta table acceleration for group by on key columns using ZORDER does not work in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/delta-table-acceleration-for-group-by-on-key-columns-using/m-p/10079#M5324</link>
    <description>&lt;P&gt;Hi @Hanan Shteingart​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for posting your question in our community! We are happy to assist you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To help us provide you with the most accurate information, could you please take a moment to review the responses and select the one that best answers your question?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will also help other community members who may have similar questions in the future. Thank you for your participation and let us know if you need any further assistance!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Apr 2023 06:55:40 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-04-06T06:55:40Z</dc:date>
    <item>
      <title>Delta table acceleration for group by on key columns using ZORDER does not work</title>
      <link>https://community.databricks.com/t5/data-engineering/delta-table-acceleration-for-group-by-on-key-columns-using/m-p/10077#M5322</link>
      <description>&lt;P&gt;What is the best practice for accelerating queries which looks like the following?&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;win = Window.partitionBy('key1','key2').orderBy('timestamp') 
df.select('timestamp', (F.col('col1') - F.lag('col1').over(win)).alias('col1_diff'))&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have tried to use OPTIMIZE table ZORDER key1, key2 but it does not work well.&lt;/P&gt;&lt;P&gt;There is a lot of shuffling going on. The data is partitioned by date which is a generated column from timestamp. &lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 13:02:06 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/delta-table-acceleration-for-group-by-on-key-columns-using/m-p/10077#M5322</guid>
      <dc:creator>chanansh</dc:creator>
      <dc:date>2023-02-03T13:02:06Z</dc:date>
    </item>
    <item>
      <title>Re: Delta table acceleration for group by on key columns using ZORDER does not work</title>
      <link>https://community.databricks.com/t5/data-engineering/delta-table-acceleration-for-group-by-on-key-columns-using/m-p/10078#M5323</link>
      <description>&lt;P&gt;@Hanan Shteingart​&amp;nbsp;: To optimize queries with window functions, you should try multiple things like - filter the data, reduce the number of columns used in the window, optimize the window partitioning and ordering, and increase the cluster size if needed. Please try the below options&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;FIlter the dataset df before applying the window function&lt;/LI&gt;&lt;LI&gt;Reduce the number of columns in df before applying the window function&lt;/LI&gt;&lt;LI&gt;Partition the dataframe df by choosing the right partition key that reduces the number of partitions and distributes the data evenly across the partitions&lt;/LI&gt;&lt;LI&gt;Choose an ordering key that reduces the amount of data that needs to be sorted and processed&lt;/LI&gt;&lt;LI&gt;Final resort, increase the size of your cluster to allocate more computing resources to the query&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Wed, 08 Mar 2023 06:21:44 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/delta-table-acceleration-for-group-by-on-key-columns-using/m-p/10078#M5323</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-08T06:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: Delta table acceleration for group by on key columns using ZORDER does not work</title>
      <link>https://community.databricks.com/t5/data-engineering/delta-table-acceleration-for-group-by-on-key-columns-using/m-p/10079#M5324</link>
      <description>&lt;P&gt;Hi @Hanan Shteingart​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for posting your question in our community! We are happy to assist you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To help us provide you with the most accurate information, could you please take a moment to review the responses and select the one that best answers your question?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will also help other community members who may have similar questions in the future. Thank you for your participation and let us know if you need any further assistance!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 06:55:40 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/delta-table-acceleration-for-group-by-on-key-columns-using/m-p/10079#M5324</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-06T06:55:40Z</dc:date>
    </item>
  </channel>
</rss>

