<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rishabh Pandey on Medium]]></title>
        <description><![CDATA[Stories by Rishabh Pandey on Medium]]></description>
        <link>https://medium.com/@itsrishabh206?source=rss-1fac147c7dda------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*h7Dlwmwiw-JO--laaz9X6g.png</url>
            <title>Stories by Rishabh Pandey on Medium</title>
            <link>https://medium.com/@itsrishabh206?source=rss-1fac147c7dda------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 06:37:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@itsrishabh206/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Seamlessly Move Tables Between Databricks Lakeflow Declarative Pipelines]]></title>
            <link>https://medium.com/@itsrishabh206/how-to-seamlessly-move-tables-between-databricks-lakeflow-declarative-pipelines-6966f16752da?source=rss-1fac147c7dda------2</link>
            <guid isPermaLink="false">https://medium.com/p/6966f16752da</guid>
            <dc:creator><![CDATA[Rishabh Pandey]]></dc:creator>
            <pubDate>Fri, 25 Jul 2025 13:42:53 GMT</pubDate>
            <atom:updated>2025-07-25T13:53:52.129Z</atom:updated>
            <content:encoded><![CDATA[<p>In the world of data engineering, pipelines don’t stay static they often grow bigger and more complex over time. Sometimes they need to be split for better performance or merged to create a more centralized workflow. <strong>Databricks Lakeflow</strong> simplifies this process by letting you move streaming tables or materialized views between pipelines without starting from scratch.</p><p>This guide walks you through <strong>how to migrate tables between pipelines</strong>, common use cases and <strong>best practices to avoid downtime</strong>.</p><h3>Why Move Tables Between Pipelines?</h3><p>There are multiple reasons why you might want to shift tables across pipelines:</p><ul><li><strong>Breaking Down a Monolith:</strong> Large pipelines can become unwieldy. Splitting them into smaller modular pipelines improves manageability.</li><li><strong>Merging Workflows:</strong> When different teams manage similar pipelines, combining them into a single pipeline reduces operational overhead.</li><li><strong>Adjusting Refresh Frequency:</strong> Different tables may require different update intervals and separating them across pipelines makes scheduling easier.</li><li><strong>Migrating from Legacy Publishing:</strong> If your pipeline still uses the <strong>legacy publishing mode</strong> moving to the <strong>default publishing mode</strong> ensures better flexibility with catalogs and schemas.</li></ul><h3>Key Requirements</h3><p>Before initiating the table migration make sure the following conditions are met:</p><p><strong>1 Databricks Runtime:</strong></p><ul><li>Your environment must be running <strong>Databricks Runtime 16.3 or above</strong></li></ul><p><strong>2 Pipeline Ownership:</strong></p><ul><li>Both source and target pipelines must exist in the <strong>same workspace</strong>.</li><li>You must be the <strong>owner of both pipelines</strong> and have access through a service principal.</li></ul><p><strong>3 Publishing Mode:</strong></p><ul><li>If the <strong>destination pipeline</strong> uses the <strong>default publishing mode</strong> you can migrate tables across different catalogs and schemas.</li><li>If both pipelines use <strong>legacy publishing mode</strong> they must share the <strong>same catalog and target schema</strong>.</li></ul><h3>Step-by-Step Guide to Moving Tables</h3><p>Here’s how you can move a <strong>streaming table</strong> or <strong>materialized view</strong> between pipelines.</p><h3>1. Stop the Source Pipeline</h3><ul><li>First, stop the pipeline where the table currently resides.</li><li>Wait for it to <strong>completely shut down</strong> to avoid conflicts.</li></ul><h3>2. Remove the Table Definition</h3><ul><li>Delete the table’s definition from the <strong>source pipeline’s notebook or file</strong>.</li><li>Save the definition (queries, code, or transformations) somewhere safe you’ll need it later.</li></ul><h3>3. Run the ALTER Command</h3><p>From a notebook or SQL editor reassign the table to the new pipeline using the <strong>ALTER</strong> command</p><pre>ALTER [MATERIALIZED VIEW | STREAMING TABLE | TABLE] &lt;table_name&gt;<br>  SET TBLPROPERTIES(&quot;pipelines.pipelineId&quot;=&quot;&lt;destination_pipeline_id&gt;&quot;);</pre><ul><li>Use ALTER STREAMING TABLE for streaming tables and ALTER MATERIALIZED VIEW for materialized views.</li><li>For Hive metastore tables use ALTER TABLE.</li></ul><p><strong>Example:</strong></p><pre>ALTER STREAMING TABLE sales<br>  SET TBLPROPERTIES(&quot;pipelines.pipelineId&quot;=&quot;abcd1234-ef56-ab78-cd90-1234efab5678&quot;);</pre><h3>4. Add the Definition to the Target Pipeline</h3><ul><li>Add the saved table definition into the <strong>destination pipeline’s notebook/file</strong>.</li><li>If the <strong>catalog or schema</strong> in the new pipeline differs update partially qualified table references.</li></ul><h3>5. Restart the Pipelines</h3><ul><li>Once the table is reassigned and definitions are updated, start the pipelines.</li><li>The <strong>destination pipeline</strong> now fully manages the table updates.</li></ul><p>For more information Pl referred this databricks official documentation to have more clarity on the same.</p><p><a href="https://docs.databricks.com/aws/en/dlt/move-table">Move tables between Lakeflow Declarative Pipelines | Databricks Documentation</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6966f16752da" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unlocking 10x Faster Queries with Automatic Liquid Clustering in Databricks]]></title>
            <link>https://medium.com/@itsrishabh206/unlocking-10x-faster-queries-with-automatic-liquid-clustering-in-databricks-179e695f0f73?source=rss-1fac147c7dda------2</link>
            <guid isPermaLink="false">https://medium.com/p/179e695f0f73</guid>
            <dc:creator><![CDATA[Rishabh Pandey]]></dc:creator>
            <pubDate>Mon, 16 Jun 2025 12:21:20 GMT</pubDate>
            <atom:updated>2025-06-17T06:28:38.375Z</atom:updated>
            <content:encoded><![CDATA[<p>In today’s data-driven world, optimizing query performance is paramount. Traditional methods like partitioning and Z-Ordering often fall short in dynamic environments. Enter <strong>Automatic Liquid Clustering</strong> — a game-changer in data layout optimization.</p><p>What Is Automatic Liquid Clustering?</p><p>Automatic Liquid Clustering is a feature in Databricks that intelligently organizes your data based on query patterns and access frequencies. Unlike static partitioning, it adapts to evolving data and query behaviors, ensuring optimal performance without manual intervention.</p><h3>How It Works</h3><ol><li><strong>Telemetry Analysis</strong>: Collects and analyzes query scan statistics to identify potential clustering benefits.</li><li><strong>Workload Modeling</strong>: Simulates past queries to predict the most effective clustering keys.</li><li><strong>Cost-Benefit Optimization</strong>: Evaluates the performance gains against the costs of clustering to ensure efficiency.</li><li>This process results in a data layout that maximizes data skipping, reducing the amount of data scanned during queries and significantly improving performance.</li></ol><h3>When to Use It</h3><p>Automatic Liquid Clustering is ideal for</p><ul><li>Tables frequently filtered by high cardinality columns.</li><li>Datasets with significant skew in data distribution.</li><li>Rapidly growing tables requiring minimal maintenance.</li><li>Environments with changing query patterns over time.</li></ul><p>It’s particularly beneficial when traditional partitioning methods lead to issues like the small file problem or inefficient data layout.</p><h3>Code Example: Enabling Automatic Liquid Clustering</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wlC3ta7tC-vHNmBkkyJwBA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*URSddJWBNmtZJt516Kr2Nw.png" /></figure><h3>Performance Benefits</h3><p>Organizations have reported up to a <strong>12x improvement in query performance</strong> and <strong>7x faster write times</strong> compared to traditional methods. This is achieved through efficient data layout and reduced overhead during data ingestion.</p><h3>Getting Started</h3><p>To leverage Automatic Liquid Clustering, ensure you’re using Databricks Runtime 15.2 or above. Simply define your clustering keys during table creation, and let Databricks handle the rest. For existing tables, you can enable it using the OPTIMIZE command.</p><p>Automatic Liquid Clustering, powered by Predictive Optimization, automates clustering key selection to continuously improve query performance and lowering costs, you can refer more from this</p><p><a href="https://www.databricks.com/blog/announcing-automatic-liquid-clustering">Announcing Automatic Liquid Clustering | Databricks Blog</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=179e695f0f73" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to deal with Slow Spark Jobs?]]></title>
            <link>https://medium.com/@itsrishabh206/how-to-deal-with-slow-spark-jobs-b116125a182e?source=rss-1fac147c7dda------2</link>
            <guid isPermaLink="false">https://medium.com/p/b116125a182e</guid>
            <dc:creator><![CDATA[Rishabh Pandey]]></dc:creator>
            <pubDate>Thu, 06 Jun 2024 06:10:21 GMT</pubDate>
            <atom:updated>2024-06-06T06:10:21.904Z</atom:updated>
            <content:encoded><![CDATA[<p>Definitely configure <a href="https://docs.databricks.com/en/workflows/jobs/job-notifications.html#configure-notifications-for-slow-running-or-late-jobs">job timeouts,</a> and configure <a href="https://docs.databricks.com/en/workflows/jobs/job-notifications.html#add-email-and-system-notifications-for-job-events">notifications.</a></p><p>This will help you to identify slowness due to various factors.</p><p>It is crucial to also investigate and fix the issue causing the slowness.</p><ol><li>The first step is to identify the problem. This can be done by <strong>comparing the run</strong> times of the same job at different instances.</li><li>The next step is to analyze the details of the job. This can be done by <strong>checking the SQL query plan</strong>, the read time, and the cloud storage request duration, etc from the Spark UI.</li><li>External factors such as <strong>storage</strong> and <strong>network</strong> can also affect the job run time. <strong>Checking Logs</strong> and some system level commands can give insights if the vm is still up and running.</li></ol><p>While comparing the two runs (good and bad), try answering the following</p><ul><li>Is this an intermittent failure or it degraded after a certain point of time.</li><li>If it is slow after a certain time consistently was there a DBR change?</li><li>Is the volume of the data the same?</li><li>Have the cluster configs changed/updated?</li></ul><p>While comparing the DAGs and sql plan</p><ul><li>Look for the stages that took most time.</li><li>Use filters and reduce data size.</li><li>Check the joins, metrics.</li></ul><p>In the logs</p><ul><li>You can check for errors, warnings.</li><li>Go to the timestamp when the stage was delayed.</li><li>Compare it with a run where it took the expected time.</li></ul><p>Bonus tip — Enable speculative execution for tasks to re-run slow tasks in parallel. spark.speculation=true</p><p>Keep a look out for my new post for more tuning on a slow task/jobs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b116125a182e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data Warehouse vs. Data Lake vs. Delta Lake: Unraveling the Mysteries of Data Storage]]></title>
            <link>https://medium.com/@itsrishabh206/data-warehouse-vs-data-lake-vs-delta-lake-unraveling-the-mysteries-of-data-storage-cf823de1d504?source=rss-1fac147c7dda------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf823de1d504</guid>
            <category><![CDATA[data-lake]]></category>
            <category><![CDATA[databricks]]></category>
            <category><![CDATA[delta-lake]]></category>
            <category><![CDATA[data-ware-housing]]></category>
            <category><![CDATA[data]]></category>
            <dc:creator><![CDATA[Rishabh Pandey]]></dc:creator>
            <pubDate>Sat, 29 Jul 2023 15:26:04 GMT</pubDate>
            <atom:updated>2023-07-29T15:26:04.035Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://www.youtube.com/watch?v=bqpb7C2VLy4">https://www.youtube.com/watch?v=bqpb7C2VLy4</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf823de1d504" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DATA SKEWNESS AND DATA SALTING]]></title>
            <link>https://medium.com/@itsrishabh206/data-skweness-and-data-salting-92a5b0cbc443?source=rss-1fac147c7dda------2</link>
            <guid isPermaLink="false">https://medium.com/p/92a5b0cbc443</guid>
            <category><![CDATA[data]]></category>
            <category><![CDATA[pyspark]]></category>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[spark]]></category>
            <dc:creator><![CDATA[Rishabh Pandey]]></dc:creator>
            <pubDate>Wed, 15 Mar 2023 09:32:09 GMT</pubDate>
            <atom:updated>2023-03-15T09:32:42.073Z</atom:updated>
            <content:encoded><![CDATA[<p>DATA SKEWNESS AND DATA SALTING</p><p>Hey there,<br>Have you noticed that a lot of people these days seem to be confused about data skewness and data salting in big data processing? I’ve noticed that many folks are struggling to understand these concepts and their importance in distributed systems.</p><p>Data skewness refers to an imbalance in the distribution of data across the nodes of a distributed system. In a distributed system, the data is partitioned into smaller subsets and distributed across multiple nodes for parallel processing. However, if the distribution of data across nodes is not balanced, some nodes may have to process a disproportionately large amount of data, leading to performance issues and slowing down the overall processing time.</p><p>Data salting is a technique used to address data skewness in big data processing. In this technique, a random string or number is added to the key value of each record before it is distributed across nodes. This helps to ensure that records with the same key value are not all sent to the same node, reducing the data skewness and improving the performance of the system.<br>For example, suppose you have a dataset of customer transactions that you want to process using a distributed system. The customer ID could be used as the key value for partitioning the data. However, if there are some customers with a disproportionately high number of transactions, this could lead to data skewness. To address this issue, you could add a random string or number to the customer ID before partitioning the data, which would help to distribute the data more evenly across the nodes.</p><p>from pyspark.sql.functions import col, rand</p><p># create a dataframe with skewed data<br>df_skewed = spark.range(1000000).withColumn(‘key’, col(‘id’) % 100)</p><p># calculate skewness factor<br>skewness_factor = df_skewed.groupBy(‘key’).count().agg({‘count’: ‘stddev’}).collect()[0][0]</p><p># create a dataframe with salted data<br>df_salted = spark.range(1000000).withColumn(‘key’, (col(‘id’) + rand(seed=42) * skewness_factor).cast(‘int’) % 100)</p><p># display the number of records per key in the skewed and salted dataframes<br>print(“Skewed data:”)<br>df_skewed.groupBy(‘key’).count().orderBy(‘key’).show()<br>print(“Salted data:”)<br>df_salted.groupBy(‘key’).count().orderBy(‘key’).show()</p><p>In this example, we first create a dataframe (df_skewed) with 1 million rows and a key column that is calculated as the modulo of the id column by 100, which results in skewed data where some keys have many more records than others.</p><p>We then calculate the skewness factor by grouping the df_skewed dataframe by key and calculating the standard deviation of the count column. This gives us a measure of how skewed the data is.</p><p>Next, we create a new data frame(df_salted) with the same number of rows as df_skewed, but we salt the key column by adding a random number multiplied by the skewness factor and then casting the result to an integer and taking the modulo of 100. This effectively redistributes the data across the keys and reduces skewness.</p><p>Finally, we display the number of records per key in both dataframes to compare the effect of data skewness and data salting.</p><p>Note that this is just a simple example to illustrate the concept of data skewness and data salting in big data. In practice, data skewness can have much more severe consequences for performance and scalability, and data salting is just one of many techniques used to mitigate this issue.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=92a5b0cbc443" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>