<?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 How to do perform deep clone for data migration from one Datalake to another? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-to-do-perform-deep-clone-for-data-migration-from-one/m-p/63428#M32235</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;P&gt;I'm attempting to migrate data from Azure Data Lake to S3 using deep clone. The data in the source Data Lake is stored in Parquet format and partitioned. I've tried to follow the &lt;A href="https://docs.databricks.com/en/delta/clone-parquet.html" target="_self"&gt;documentation&lt;/A&gt; from Databricks, which suggests that I need to register Parquet tables with partitions in a catalog such as the Hive metastore before cloning. However, I encountered an error while attempting to execute the clone command.&lt;/P&gt;&lt;P&gt;First, I created a table in the target Data Lake with the following SQL statement:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CREATE TABLE IF NOT EXISTS customerOrderArchive (&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;column1 datatype,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;column2 datatype,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;...&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;PARTITIONED BY (batchid string)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;LOCATION 'targetPath/temp';&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;This table was successfully created in the catalog.&lt;/P&gt;&lt;P&gt;Then, I attempted to execute the clone command as follows:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CREATE OR REPLACE TABLE cdf.customerOrderArchive&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;CLONE parquet.`sourcePath/customerorder/`&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;However, this resulted in the following error:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;SparkException: Job aborted due to stage failure: Task 5 in stage 381.0 failed 4 times, most recent failure: Lost task 5.3 in stage 381.0 (TID 2488) (10.139.64.15 executor 0): com.databricks.sql.transaction.tahoe.DeltaAnalysisException: Expecting 0 partition column(s): [], but found 1 partition column(s): [`batchid`] from parsing the file name: abfs://pathToSource/batchid=20240123235612633/part-00000-tid-792802563625641899-725c22de-6f96-439a-927b-f4e70648de3a-42-1.c000.snappy.parquet&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Despite creating and registering the table in the Spark metadata catalog, I'm still encountering this error.&lt;/P&gt;&lt;P&gt;Can anyone provide insight into what might be causing this issue? Additionally, is it possible to migrate data from one Data Lake to another using deep clone?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 12 Mar 2024 19:17:26 GMT</pubDate>
    <dc:creator>Coders</dc:creator>
    <dc:date>2024-03-12T19:17:26Z</dc:date>
    <item>
      <title>How to do perform deep clone for data migration from one Datalake to another?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-do-perform-deep-clone-for-data-migration-from-one/m-p/63428#M32235</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;P&gt;I'm attempting to migrate data from Azure Data Lake to S3 using deep clone. The data in the source Data Lake is stored in Parquet format and partitioned. I've tried to follow the &lt;A href="https://docs.databricks.com/en/delta/clone-parquet.html" target="_self"&gt;documentation&lt;/A&gt; from Databricks, which suggests that I need to register Parquet tables with partitions in a catalog such as the Hive metastore before cloning. However, I encountered an error while attempting to execute the clone command.&lt;/P&gt;&lt;P&gt;First, I created a table in the target Data Lake with the following SQL statement:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CREATE TABLE IF NOT EXISTS customerOrderArchive (&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;column1 datatype,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;column2 datatype,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;...&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;PARTITIONED BY (batchid string)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;LOCATION 'targetPath/temp';&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;This table was successfully created in the catalog.&lt;/P&gt;&lt;P&gt;Then, I attempted to execute the clone command as follows:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;CREATE OR REPLACE TABLE cdf.customerOrderArchive&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;CLONE parquet.`sourcePath/customerorder/`&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;However, this resulted in the following error:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;SparkException: Job aborted due to stage failure: Task 5 in stage 381.0 failed 4 times, most recent failure: Lost task 5.3 in stage 381.0 (TID 2488) (10.139.64.15 executor 0): com.databricks.sql.transaction.tahoe.DeltaAnalysisException: Expecting 0 partition column(s): [], but found 1 partition column(s): [`batchid`] from parsing the file name: abfs://pathToSource/batchid=20240123235612633/part-00000-tid-792802563625641899-725c22de-6f96-439a-927b-f4e70648de3a-42-1.c000.snappy.parquet&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Despite creating and registering the table in the Spark metadata catalog, I'm still encountering this error.&lt;/P&gt;&lt;P&gt;Can anyone provide insight into what might be causing this issue? Additionally, is it possible to migrate data from one Data Lake to another using deep clone?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 12 Mar 2024 19:17:26 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-do-perform-deep-clone-for-data-migration-from-one/m-p/63428#M32235</guid>
      <dc:creator>Coders</dc:creator>
      <dc:date>2024-03-12T19:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to do perform deep clone for data migration from one Datalake to another?</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-do-perform-deep-clone-for-data-migration-from-one/m-p/63554#M32272</link>
      <description>&lt;P&gt;Hi Kaniz,&lt;/P&gt;&lt;P&gt;Thank you for the response. I'm pretty sure that source table is partitioned by &lt;STRONG&gt;batchid&lt;/STRONG&gt; and in the target datalake I have registered the table using the same partition &lt;STRONG&gt;batchid&lt;/STRONG&gt; as explained in the question.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I'm not sure why it's throwing an error when I try to clone.&lt;/P&gt;&lt;P&gt;Another question I have is, how do I provide external table location while cloning the data? I see that's syntax doesn't support that. Is it because clone cannot be used to copy data from one datalake to another?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 13:48:05 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-do-perform-deep-clone-for-data-migration-from-one/m-p/63554#M32272</guid>
      <dc:creator>Coders</dc:creator>
      <dc:date>2024-03-13T13:48:05Z</dc:date>
    </item>
  </channel>
</rss>

