<?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 Unable to create a record_id column via DLT - Autoloader in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/unable-to-create-a-record-id-column-via-dlt-autoloader/m-p/65997#M32982</link>
    <description>&lt;P&gt;Hi Community,&lt;/P&gt;&lt;P&gt;I'm trying to load data from the landing zone to the bronze layer via DLT- Autoloader, I want to add a column record_id to the bronze table while I fetch my data. I'm also using file arrival trigger in the workflow to update my table incrementally.&lt;/P&gt;&lt;P&gt;I've followed a post in the community forum using monotonically_increasing_id() but it's not supported in the streaming use case. I also do not have any event-time based column to enable watermarking.&lt;/P&gt;&lt;P&gt;Attaching code snippet for reference:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;def create_bronze_tables(
    source_file_path=None,
    target_table_name=None,
    primary_keys=None
):
    &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/97035"&gt;@Dlt&lt;/a&gt;.table(name=f"{target_table_name}")
    def create_sample_tables():
        table = (
            spark.readStream.format("cloudFiles")
            .option("cloudFiles.format", "csv")
            .option("inferColumnTypes", True)
            .option('header','true')
            .option("delimiter", "\t")
            .option("mergeSchema", "true")
            .load(f"{source_file_path}")
            .withColumn("record_id", row_number().over(
                Window.orderBy(monotonically_increasing_id())))
        )
        return table&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the error I face is attached.&lt;/P&gt;&lt;P&gt;Any help in how to create a record-id in this setting is appreciated.&lt;/P&gt;</description>
    <pubDate>Wed, 10 Apr 2024 11:22:19 GMT</pubDate>
    <dc:creator>RiyazAliM</dc:creator>
    <dc:date>2024-04-10T11:22:19Z</dc:date>
    <item>
      <title>Unable to create a record_id column via DLT - Autoloader</title>
      <link>https://community.databricks.com/t5/data-engineering/unable-to-create-a-record-id-column-via-dlt-autoloader/m-p/65997#M32982</link>
      <description>&lt;P&gt;Hi Community,&lt;/P&gt;&lt;P&gt;I'm trying to load data from the landing zone to the bronze layer via DLT- Autoloader, I want to add a column record_id to the bronze table while I fetch my data. I'm also using file arrival trigger in the workflow to update my table incrementally.&lt;/P&gt;&lt;P&gt;I've followed a post in the community forum using monotonically_increasing_id() but it's not supported in the streaming use case. I also do not have any event-time based column to enable watermarking.&lt;/P&gt;&lt;P&gt;Attaching code snippet for reference:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;def create_bronze_tables(
    source_file_path=None,
    target_table_name=None,
    primary_keys=None
):
    &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/97035"&gt;@Dlt&lt;/a&gt;.table(name=f"{target_table_name}")
    def create_sample_tables():
        table = (
            spark.readStream.format("cloudFiles")
            .option("cloudFiles.format", "csv")
            .option("inferColumnTypes", True)
            .option('header','true')
            .option("delimiter", "\t")
            .option("mergeSchema", "true")
            .load(f"{source_file_path}")
            .withColumn("record_id", row_number().over(
                Window.orderBy(monotonically_increasing_id())))
        )
        return table&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the error I face is attached.&lt;/P&gt;&lt;P&gt;Any help in how to create a record-id in this setting is appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 11:22:19 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unable-to-create-a-record-id-column-via-dlt-autoloader/m-p/65997#M32982</guid>
      <dc:creator>RiyazAliM</dc:creator>
      <dc:date>2024-04-10T11:22:19Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to create a record_id column via DLT - Autoloader</title>
      <link>https://community.databricks.com/t5/data-engineering/unable-to-create-a-record-id-column-via-dlt-autoloader/m-p/66576#M33153</link>
      <description>&lt;P&gt;Hey&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/9"&gt;@Retired_mod&lt;/a&gt;&amp;nbsp; - could you or any body from the community team help me here, please? I've been stuck since quite some time now.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2024 09:36:18 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unable-to-create-a-record-id-column-via-dlt-autoloader/m-p/66576#M33153</guid>
      <dc:creator>RiyazAliM</dc:creator>
      <dc:date>2024-04-18T09:36:18Z</dc:date>
    </item>
  </channel>
</rss>

