<?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 databricks-connect, dbutils, abfss path, URISyntaxException in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/databricks-connect-dbutils-abfss-path-urisyntaxexception/m-p/59496#M31429</link>
    <description>&lt;P&gt;When trying to use `dbutils.fs.cp` in the #databricks-connect #databricks-connect context to upload files to Azure Datalake Gen2 I get a malformed URI error&lt;BR /&gt;&lt;BR /&gt;I have used the code provided here:&lt;BR /&gt;&lt;A href="https://learn.microsoft.com/en-gb/azure/databricks/dev-tools/databricks-connect/python/databricks-utilities" target="_blank" rel="noopener"&gt;https://learn.microsoft.com/en-gb/azure/databricks/dev-tools/databricks-connect/python/databricks-utilities&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;from&lt;/SPAN&gt; databricks.sdk &lt;SPAN class=""&gt;import&lt;/SPAN&gt; WorkspaceClient
w = WorkspaceClient() &lt;BR /&gt;path =&amp;nbsp;r"abfss://bronze@devstorageacc.dfs.core.windows.net/test/"&lt;BR /&gt;w.dbutils.fs.cp('dbfs:/config.json', path)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;```databricks.sdk.errors.mapping.InvalidParameterValue: java.net.URISyntaxException: Relative path in absolute URI: abfss:%5Cbronze@devstorageacc.dfs.core.windows.net%5Ctest&lt;/SPAN&gt;&lt;SPAN&gt;```&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KrzysztofPrzyso_0-1707241094344.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/6122i254EE1A420A7D73C/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="KrzysztofPrzyso_0-1707241094344.png" alt="KrzysztofPrzyso_0-1707241094344.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The standard `dbutils.fs.cp` works on the cluster without problems. I have positively confirmed access rights.&lt;BR /&gt;&lt;BR /&gt;Possibly it is a known issue described here: &lt;A href="https://github.com/sparklyr/sparklyr/issues/2883" target="_blank" rel="noopener"&gt;databricks-connect : Relative path in absolute URI · Issue #2883 · sparklyr/sparklyr (github.com)&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 06 Feb 2024 17:46:58 GMT</pubDate>
    <dc:creator>KrzysztofPrzyso</dc:creator>
    <dc:date>2024-02-06T17:46:58Z</dc:date>
    <item>
      <title>databricks-connect, dbutils, abfss path, URISyntaxException</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-connect-dbutils-abfss-path-urisyntaxexception/m-p/59496#M31429</link>
      <description>&lt;P&gt;When trying to use `dbutils.fs.cp` in the #databricks-connect #databricks-connect context to upload files to Azure Datalake Gen2 I get a malformed URI error&lt;BR /&gt;&lt;BR /&gt;I have used the code provided here:&lt;BR /&gt;&lt;A href="https://learn.microsoft.com/en-gb/azure/databricks/dev-tools/databricks-connect/python/databricks-utilities" target="_blank" rel="noopener"&gt;https://learn.microsoft.com/en-gb/azure/databricks/dev-tools/databricks-connect/python/databricks-utilities&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;from&lt;/SPAN&gt; databricks.sdk &lt;SPAN class=""&gt;import&lt;/SPAN&gt; WorkspaceClient
w = WorkspaceClient() &lt;BR /&gt;path =&amp;nbsp;r"abfss://bronze@devstorageacc.dfs.core.windows.net/test/"&lt;BR /&gt;w.dbutils.fs.cp('dbfs:/config.json', path)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;```databricks.sdk.errors.mapping.InvalidParameterValue: java.net.URISyntaxException: Relative path in absolute URI: abfss:%5Cbronze@devstorageacc.dfs.core.windows.net%5Ctest&lt;/SPAN&gt;&lt;SPAN&gt;```&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KrzysztofPrzyso_0-1707241094344.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/6122i254EE1A420A7D73C/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="KrzysztofPrzyso_0-1707241094344.png" alt="KrzysztofPrzyso_0-1707241094344.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The standard `dbutils.fs.cp` works on the cluster without problems. I have positively confirmed access rights.&lt;BR /&gt;&lt;BR /&gt;Possibly it is a known issue described here: &lt;A href="https://github.com/sparklyr/sparklyr/issues/2883" target="_blank" rel="noopener"&gt;databricks-connect : Relative path in absolute URI · Issue #2883 · sparklyr/sparklyr (github.com)&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2024 17:46:58 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-connect-dbutils-abfss-path-urisyntaxexception/m-p/59496#M31429</guid>
      <dc:creator>KrzysztofPrzyso</dc:creator>
      <dc:date>2024-02-06T17:46:58Z</dc:date>
    </item>
    <item>
      <title>Re: databricks-connect, dbutils, abfss path, URISyntaxException</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-connect-dbutils-abfss-path-urisyntaxexception/m-p/68682#M33721</link>
      <description>&lt;P&gt;I have the same problem.&lt;/P&gt;&lt;P&gt;Running :&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from databricks.sdk import WorkspaceClient
w = WorkspaceClient()
w.dbutils.fs.ls("abfss://xxx@yyy.dfs.core.windows.net/zzz")&lt;/LI-CODE&gt;&lt;P&gt;via Databricks Connect gives the same result as running :&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from databricks.sdk import WorkspaceClient
w = WorkspaceClient()
w.dbutils.fs.ls("/")&lt;/LI-CODE&gt;&lt;P&gt;The problem seems to be the presence of '//': in that case the string being passed to the databricks library seems to be just '/'&lt;/P&gt;&lt;P&gt;When doing the same directly on a normal Databricks Workspace Notebook it works:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;dbutils.fs.ls("abfss://xxx@yyy.dfs.core.windows.net/zzz")&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 10 May 2024 01:42:23 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-connect-dbutils-abfss-path-urisyntaxexception/m-p/68682#M33721</guid>
      <dc:creator>Gen_Vi332</dc:creator>
      <dc:date>2024-05-10T01:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: databricks-connect, dbutils, abfss path, URISyntaxException</title>
      <link>https://community.databricks.com/t5/data-engineering/databricks-connect-dbutils-abfss-path-urisyntaxexception/m-p/72213#M34520</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/104829"&gt;@Gen_Vi332&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Apologies for the late response,&lt;BR /&gt;My experiments with other solutions show that using Volume paths instead of `abfss://` paths can potentially solve the issue.&lt;BR /&gt;The drawback is that you need to expose the folder (or its parent) as Volume in Unity Catalog and grant the client access to the volume object.&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;`/Volumes/catalog_dev/operational/vlm_source_landing/file_path`&lt;BR /&gt;&lt;/SPAN&gt;It seems that for many scenarios volume path is treated as local path, which can potentially simplify the code for non spark python operations.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2024 10:30:07 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/databricks-connect-dbutils-abfss-path-urisyntaxexception/m-p/72213#M34520</guid>
      <dc:creator>KrzysztofPrzyso</dc:creator>
      <dc:date>2024-06-10T10:30:07Z</dc:date>
    </item>
  </channel>
</rss>

