<?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: how to load structured stream data into delta table whose location is in ADLS Gen2 in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/how-to-load-structured-stream-data-into-delta-table-whose/m-p/7690#M3483</link>
    <description>&lt;P&gt;Connection is fine, I need to know how to write the stream data to adls gen2 path  and the same time have the delta table registered to the metastore as well. &lt;/P&gt;</description>
    <pubDate>Thu, 16 Mar 2023 03:24:46 GMT</pubDate>
    <dc:creator>Harun</dc:creator>
    <dc:date>2023-03-16T03:24:46Z</dc:date>
    <item>
      <title>how to load structured stream data into delta table whose location is in ADLS Gen2</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-load-structured-stream-data-into-delta-table-whose/m-p/7688#M3481</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working on a streaming data processing. As a intial step i have read the data from azure eventhub using readstream. now i want to writestream this into a delta table. &lt;/P&gt;&lt;P&gt;My requirement is, The data should present in external location (adls gen2) and the table should be available in my metastore. &lt;/P&gt;&lt;P&gt;When i tried the below code &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code_Snippet:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ext_table_location = "adls path"&lt;/P&gt;&lt;P&gt;autoloader_df.writeStream \&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.format("delta") \&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.outputMode("append") \&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.option("checkpointLocation", checkpoint_directory) \&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.option("mergeSchema", "true") \&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.option("path",ext_table_location) \&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;.table(ext_table_location)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is failing. Is there any standard approach for streaming data for this kind of scenario?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in Advance! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2023 15:55:28 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-load-structured-stream-data-into-delta-table-whose/m-p/7688#M3481</guid>
      <dc:creator>Harun</dc:creator>
      <dc:date>2023-03-15T15:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: how to load structured stream data into delta table whose location is in ADLS Gen2</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-load-structured-stream-data-into-delta-table-whose/m-p/7689#M3482</link>
      <description>&lt;P&gt;There are a couple ways to connect to ADLS Gen2. Please refer to below doc. For instance, if you decide to go by service principal method, you need to add below  storage account configurations details to the cluster or notebooks. Same goes for storage for SAS token and storage account keys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;service_credential = dbutils.secrets.get(scope="&amp;lt;scope&amp;gt;",key="&amp;lt;service-credential-key&amp;gt;")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;spark.conf.set("fs.azure.account.auth.type.&amp;lt;storage-account&amp;gt;.dfs.core.windows.net", "OAuth")&lt;/P&gt;&lt;P&gt;spark.conf.set("fs.azure.account.oauth.provider.type.&amp;lt;storage-account&amp;gt;.dfs.core.windows.net", "org.apache.hadoop.fs.azurebfs.oauth2.ClientCredsTokenProvider")&lt;/P&gt;&lt;P&gt;spark.conf.set("fs.azure.account.oauth2.client.id.&amp;lt;storage-account&amp;gt;.dfs.core.windows.net", "&amp;lt;application-id&amp;gt;")&lt;/P&gt;&lt;P&gt;spark.conf.set("fs.azure.account.oauth2.client.secret.&amp;lt;storage-account&amp;gt;.dfs.core.windows.net", service_credential)&lt;/P&gt;&lt;P&gt;spark.conf.set("fs.azure.account.oauth2.client.endpoint.&amp;lt;storage-account&amp;gt;.dfs.core.windows.net", "https://login.microsoftonline.com/&amp;lt;directory-id&amp;gt;/oauth2/token")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/azure/databricks/getting-started/connect-to-azure-storage" target="test_blank"&gt;https://learn.microsoft.com/en-us/azure/databricks/getting-started/connect-to-azure-storage&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/azure/databricks/storage/azure-storage" target="test_blank"&gt;https://learn.microsoft.com/en-us/azure/databricks/storage/azure-storage&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2023 16:29:52 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-load-structured-stream-data-into-delta-table-whose/m-p/7689#M3482</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-15T16:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: how to load structured stream data into delta table whose location is in ADLS Gen2</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-load-structured-stream-data-into-delta-table-whose/m-p/7690#M3483</link>
      <description>&lt;P&gt;Connection is fine, I need to know how to write the stream data to adls gen2 path  and the same time have the delta table registered to the metastore as well. &lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 03:24:46 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-load-structured-stream-data-into-delta-table-whose/m-p/7690#M3483</guid>
      <dc:creator>Harun</dc:creator>
      <dc:date>2023-03-16T03:24:46Z</dc:date>
    </item>
    <item>
      <title>Re: how to load structured stream data into delta table whose location is in ADLS Gen2</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-load-structured-stream-data-into-delta-table-whose/m-p/7691#M3484</link>
      <description>&lt;P&gt;can you try to use &amp;lt;database&amp;gt;.&amp;lt;tablename&amp;gt; for the .table option instead of a path?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 08:08:43 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-load-structured-stream-data-into-delta-table-whose/m-p/7691#M3484</guid>
      <dc:creator>-werners-</dc:creator>
      <dc:date>2023-03-16T08:08:43Z</dc:date>
    </item>
    <item>
      <title>Re: how to load structured stream data into delta table whose location is in ADLS Gen2</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-load-structured-stream-data-into-delta-table-whose/m-p/7692#M3485</link>
      <description>&lt;P&gt;Hi @werners, i tried that option as well. But it will create a managed table. But i want a external table. So now i created a external table prior to the streaming part. &lt;/P&gt;&lt;P&gt;What i understand from the research i did is, we cannot write to external table in writestream query. &lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 09:37:00 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-load-structured-stream-data-into-delta-table-whose/m-p/7692#M3485</guid>
      <dc:creator>Harun</dc:creator>
      <dc:date>2023-03-16T09:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: how to load structured stream data into delta table whose location is in ADLS Gen2</title>
      <link>https://community.databricks.com/t5/data-engineering/how-to-load-structured-stream-data-into-delta-table-whose/m-p/7693#M3486</link>
      <description>&lt;P&gt;If you write in delta format to a path, and create an unmanaged table on that path, that should work.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2023 09:55:13 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/how-to-load-structured-stream-data-into-delta-table-whose/m-p/7693#M3486</guid>
      <dc:creator>-werners-</dc:creator>
      <dc:date>2023-03-16T09:55:13Z</dc:date>
    </item>
  </channel>
</rss>

