<?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: &amp;quot;with open&amp;quot; not working with Shared Access Cluster on mounted location in Get Started Discussions</title>
    <link>https://community.databricks.com/t5/get-started-discussions/quot-with-open-quot-not-working-with-shared-access-cluster-on/m-p/84096#M3670</link>
    <description>&lt;P&gt;We are able to read the file but how we can write again into storage path for there is any solution&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 23 Aug 2024 19:58:19 GMT</pubDate>
    <dc:creator>srajawat</dc:creator>
    <dc:date>2024-08-23T19:58:19Z</dc:date>
    <item>
      <title>"with open" not working with Shared Access Cluster on mounted location</title>
      <link>https://community.databricks.com/t5/get-started-discussions/quot-with-open-quot-not-working-with-shared-access-cluster-on/m-p/54653#M1922</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;For an application that we are building, we need a encoding detector/utf-8 enforcer. For this, we used the python library chardet in combination with "with open". We open a file from a mounted adls location (we use a legacy hive-metastore)&lt;/P&gt;&lt;P&gt;When we were using Non Isolation Shared clusters, it was working fine, but because of security reasons, we have to change to Shared Access clusters. However, now the encoding detector is not working anymore.&lt;/P&gt;&lt;P&gt;This is how we detected encoding before:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mathijsfish_1-1701785425743.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/5455i23058F3E7C930B36/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="mathijsfish_1-1701785425743.png" alt="mathijsfish_1-1701785425743.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Error using shared access cluster:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mathijsfish_2-1701785466668.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/5456iC4189DFC94EAA44B/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="mathijsfish_2-1701785466668.png" alt="mathijsfish_2-1701785466668.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;After some investigation we concluded that using with open, but also the os and glob module on mounted locations with a shared access cluster, does not work properly. Any idea how we can fix this?&lt;BR /&gt;&lt;BR /&gt;For your reference, we have to use this mounted location, and a shared access cluster.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2023 14:28:50 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/quot-with-open-quot-not-working-with-shared-access-cluster-on/m-p/54653#M1922</guid>
      <dc:creator>mathijs-fish</dc:creator>
      <dc:date>2023-12-05T14:28:50Z</dc:date>
    </item>
    <item>
      <title>Re: "with open" not working with Shared Access Cluster on mounted location</title>
      <link>https://community.databricks.com/t5/get-started-discussions/quot-with-open-quot-not-working-with-shared-access-cluster-on/m-p/59363#M2486</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/88909"&gt;@mathijs-fish&lt;/a&gt;,I completely understand your hesitation and appreciate your approach to seeking guidance!&lt;/P&gt;
&lt;P&gt;I see you are trying to access the external files from dbfs mount location.&lt;BR /&gt;As you can see in the snapshots which you have shared, The reason behind the below error while trying to access the external dbfs mount file using "with open" is that you are using a shared access mode cluster.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;@FileNotFoundError: [Errno 2] No such file or directory: '/dbfs/mnt/art/inbound.
Ltest/EUT_Alignment_20230630_20230712130221.csv'&lt;/LI-CODE&gt;
&lt;P&gt;This is a known limitation for Shared Clusters, where /dbfs path is not accessible. You can try using a single-user cluster instead to access /dbfs which supports UC.&lt;/P&gt;
&lt;P&gt;Please refer:&lt;BR /&gt;&lt;A href="https://docs.databricks.com/clusters/configure.html#shared-access-mode-limitations" target="_blank"&gt;https://docs.databricks.com/clusters/configure.html#shared-access-mode-limitations&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://docs.databricks.com/en/dbfs/unity-catalog.html#how-does-dbfs-work-in-shared-access-mode" target="_blank"&gt;https://docs.databricks.com/en/dbfs/unity-catalog.html#how-does-dbfs-work-in-shared-access-mode&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;And we also have a preview feature 'Improved Shared Clusters' that addresses some of the limitations of Shared Clusters.&lt;/P&gt;
&lt;P&gt;Leave a like if this helps, followups are appreciated.&lt;/P&gt;
&lt;P&gt;Kudos,&lt;/P&gt;
&lt;P&gt;Ayushi&lt;/P&gt;</description>
      <pubDate>Tue, 06 Feb 2024 06:34:30 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/quot-with-open-quot-not-working-with-shared-access-cluster-on/m-p/59363#M2486</guid>
      <dc:creator>Ayushi_Suthar</dc:creator>
      <dc:date>2024-02-06T06:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: "with open" not working with Shared Access Cluster on mounted location</title>
      <link>https://community.databricks.com/t5/get-started-discussions/quot-with-open-quot-not-working-with-shared-access-cluster-on/m-p/59565#M2511</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/76914"&gt;@Ayushi_Suthar&lt;/a&gt;Thanks! However, this does not solve the issue; because we have to use shared clusters. In the meantime we found a way of detecting the encoding on shared clusters in the following way:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;rawdata &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; spark.read.&lt;/SPAN&gt;&lt;SPAN&gt;format&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"binaryFile"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .&lt;/SPAN&gt;&lt;SPAN&gt;load&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;file_path&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .&lt;/SPAN&gt;&lt;SPAN&gt;selectExpr&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"SUBSTR(content, 0, 500000) AS content"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .&lt;/SPAN&gt;&lt;SPAN&gt;collect&lt;/SPAN&gt;&lt;SPAN&gt;()[&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .content&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; encoding &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; chardet.&lt;/SPAN&gt;&lt;SPAN&gt;detect&lt;/SPAN&gt;&lt;SPAN&gt;(rawdata)[&lt;/SPAN&gt;&lt;SPAN&gt;"encoding"&lt;/SPAN&gt;&lt;SPAN&gt;]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;print&lt;/SPAN&gt;&lt;SPAN&gt;(encoding)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 07 Feb 2024 09:30:39 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/quot-with-open-quot-not-working-with-shared-access-cluster-on/m-p/59565#M2511</guid>
      <dc:creator>mathijs-fish</dc:creator>
      <dc:date>2024-02-07T09:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: "with open" not working with Shared Access Cluster on mounted location</title>
      <link>https://community.databricks.com/t5/get-started-discussions/quot-with-open-quot-not-working-with-shared-access-cluster-on/m-p/59570#M2512</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/88909"&gt;@mathijs-fish&lt;/a&gt;&amp;nbsp;thank you for sharing the solution, it will help us&amp;nbsp;to update our records and documentation, enabling us to assist other customers more effectively in similar cases.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2024 10:20:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/quot-with-open-quot-not-working-with-shared-access-cluster-on/m-p/59570#M2512</guid>
      <dc:creator>Ayushi_Suthar</dc:creator>
      <dc:date>2024-02-07T10:20:37Z</dc:date>
    </item>
    <item>
      <title>Re: "with open" not working with Shared Access Cluster on mounted location</title>
      <link>https://community.databricks.com/t5/get-started-discussions/quot-with-open-quot-not-working-with-shared-access-cluster-on/m-p/84096#M3670</link>
      <description>&lt;P&gt;We are able to read the file but how we can write again into storage path for there is any solution&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2024 19:58:19 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/quot-with-open-quot-not-working-with-shared-access-cluster-on/m-p/84096#M3670</guid>
      <dc:creator>srajawat</dc:creator>
      <dc:date>2024-08-23T19:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: "with open" not working with Shared Access Cluster on mounted location</title>
      <link>https://community.databricks.com/t5/get-started-discussions/quot-with-open-quot-not-working-with-shared-access-cluster-on/m-p/95966#M4487</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/88909"&gt;@mathijs-fish&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/76914"&gt;@Ayushi_Suthar&lt;/a&gt;&amp;nbsp; - I am having the same issue with shared cluster. I can see the list of PDF files on the mount using &lt;SPAN&gt;dbutils.fs.&lt;/SPAN&gt;&lt;SPAN&gt;ls&lt;/SPAN&gt;&lt;SPAN&gt;(mount_point), but when I am trying to read the PDF files using PyPDF, I am getting -&amp;nbsp;&lt;SPAN class=""&gt;FileNotFoundError: &lt;/SPAN&gt;[Errno 2] No such file or directory&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can I read the files after enabling certain settings on the shared cluster? I see that&amp;nbsp;&lt;/SPAN&gt;&lt;A href="#" target="_blank" rel="noopener"&gt;@srajawat&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;can&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;read the PDF.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Looking forward to your reply, thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2024 12:35:12 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/quot-with-open-quot-not-working-with-shared-access-cluster-on/m-p/95966#M4487</guid>
      <dc:creator>nagND</dc:creator>
      <dc:date>2024-10-24T12:35:12Z</dc:date>
    </item>
  </channel>
</rss>

