<?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 read gcs paths with square barkets? in Get Started Discussions</title>
    <link>https://community.databricks.com/t5/get-started-discussions/how-to-read-gcs-paths-with-square-barkets/m-p/37937#M5479</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/9"&gt;@Retired_mod&lt;/a&gt;&amp;nbsp;! Thank you for your help.&lt;/P&gt;&lt;P&gt;However, when I tray using you're code I still get an error : "&lt;SPAN&gt;URISyntaxException: Illegal character in path at index&lt;/SPAN&gt; "&lt;/P&gt;&lt;P&gt;I'm trying to read a txt file. This is the file path:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"gs://my-bucket/my Data/sparkTests/GM-1220, reading a txt/Version1/3 Model Creation/3 models_to_check/[no_country] (2)/test.txt"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;This is how I'm trying to read the file:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;def&lt;/SPAN&gt;&lt;SPAN&gt; loadFromGCS(&lt;/SPAN&gt;&lt;SPAN&gt;gcsUrl&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;String&lt;/SPAN&gt;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;String&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;Boolean&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;RecordClassifier&lt;/SPAN&gt;&lt;SPAN&gt;) = {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;val&lt;/SPAN&gt; &lt;SPAN&gt;content&lt;/SPAN&gt;&lt;SPAN&gt; = spark.sparkContext.textFile(gcsUrl).collect().mkString(&lt;/SPAN&gt;&lt;SPAN&gt;"\n"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; print(content)&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 19 Jul 2023 08:53:26 GMT</pubDate>
    <dc:creator>Sparktaculer</dc:creator>
    <dc:date>2023-07-19T08:53:26Z</dc:date>
    <item>
      <title>How to read gcs paths with square barkets?</title>
      <link>https://community.databricks.com/t5/get-started-discussions/how-to-read-gcs-paths-with-square-barkets/m-p/37704#M5476</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to read a file &lt;STRONG&gt;using Scala&lt;/STRONG&gt;&amp;nbsp;from gcs that has square brackets in the file path.&lt;/P&gt;&lt;P&gt;I keep getting the following error:&lt;SPAN&gt;URISyntaxException: Illegal character in path at index 209&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I tried putting an extra front slash in front of them but it still didn't work.&lt;/P&gt;&lt;P&gt;Would really appreciate you're help ere!&lt;/P&gt;</description>
      <pubDate>Sun, 16 Jul 2023 14:47:40 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/how-to-read-gcs-paths-with-square-barkets/m-p/37704#M5476</guid>
      <dc:creator>Sparktaculer</dc:creator>
      <dc:date>2023-07-16T14:47:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to read gcs paths with square barkets?</title>
      <link>https://community.databricks.com/t5/get-started-discussions/how-to-read-gcs-paths-with-square-barkets/m-p/37859#M5478</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/84860"&gt;@Sparktaculer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In Spark, you can disable the option globPaths. This will skip the pattern matching that happens during file reads.&lt;/P&gt;&lt;PRE&gt;spark.read.option("__globPaths__", False).format("").load("path[]")&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2023 11:34:07 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/how-to-read-gcs-paths-with-square-barkets/m-p/37859#M5478</guid>
      <dc:creator>Tharun-Kumar</dc:creator>
      <dc:date>2023-07-18T11:34:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to read gcs paths with square barkets?</title>
      <link>https://community.databricks.com/t5/get-started-discussions/how-to-read-gcs-paths-with-square-barkets/m-p/37937#M5479</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/9"&gt;@Retired_mod&lt;/a&gt;&amp;nbsp;! Thank you for your help.&lt;/P&gt;&lt;P&gt;However, when I tray using you're code I still get an error : "&lt;SPAN&gt;URISyntaxException: Illegal character in path at index&lt;/SPAN&gt; "&lt;/P&gt;&lt;P&gt;I'm trying to read a txt file. This is the file path:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"gs://my-bucket/my Data/sparkTests/GM-1220, reading a txt/Version1/3 Model Creation/3 models_to_check/[no_country] (2)/test.txt"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;This is how I'm trying to read the file:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;def&lt;/SPAN&gt;&lt;SPAN&gt; loadFromGCS(&lt;/SPAN&gt;&lt;SPAN&gt;gcsUrl&lt;/SPAN&gt;&lt;SPAN&gt;: &lt;/SPAN&gt;&lt;SPAN&gt;String&lt;/SPAN&gt;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;String&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;Boolean&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;RecordClassifier&lt;/SPAN&gt;&lt;SPAN&gt;) = {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;val&lt;/SPAN&gt; &lt;SPAN&gt;content&lt;/SPAN&gt;&lt;SPAN&gt; = spark.sparkContext.textFile(gcsUrl).collect().mkString(&lt;/SPAN&gt;&lt;SPAN&gt;"\n"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; print(content)&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2023 08:53:26 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/how-to-read-gcs-paths-with-square-barkets/m-p/37937#M5479</guid>
      <dc:creator>Sparktaculer</dc:creator>
      <dc:date>2023-07-19T08:53:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to read gcs paths with square barkets?</title>
      <link>https://community.databricks.com/t5/get-started-discussions/how-to-read-gcs-paths-with-square-barkets/m-p/37944#M5480</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/84860"&gt;@Sparktaculer&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;We haven't heard from you since the last response from &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/39403"&gt;@Tharun-Kumar&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/9"&gt;@Retired_mod&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;, and I was checking back to see if her suggestions helped you.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Or else, If you have any solution, please share it with the community, as it can be helpful to others.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Also, Please don't forget to click on the "Select As Best" button whenever the information provided helps resolve your question.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2023 10:27:25 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/how-to-read-gcs-paths-with-square-barkets/m-p/37944#M5480</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-07-19T10:27:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to read gcs paths with square barkets?</title>
      <link>https://community.databricks.com/t5/get-started-discussions/how-to-read-gcs-paths-with-square-barkets/m-p/37946#M5481</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A href="https://community.databricks.com/t5/user/viewprofilepage/user-id/9" target="_blank"&gt;@Kaniz&lt;/A&gt;&amp;nbsp;! Thank you for your help.&lt;/P&gt;&lt;P&gt;However, when I try using you're code I still get an error: "&lt;SPAN&gt;URISyntaxException: Illegal character in path at index&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;"&lt;/P&gt;&lt;P&gt;I'm trying to read a txt file. This is the file path:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"gs://my-bucket/my Data/sparkTests/GM-1220, reading a txt/Version1/3 Model Creation/3 models_to_check/[no_country] (2)/test.txt"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;This is how I'm trying to read the file:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;def&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;loadFromGCS(&lt;/SPAN&gt;&lt;SPAN&gt;gcsUrl&lt;/SPAN&gt;&lt;SPAN&gt;:&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;String&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;(&lt;/SPAN&gt;&lt;SPAN&gt;String&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Boolean&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;RecordClassifier&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;val&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;content&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;= spark.sparkContext.textFile(gcsUrl).collect().mkString(&lt;/SPAN&gt;&lt;SPAN&gt;"\n"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; print(content)&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 19 Jul 2023 10:50:20 GMT</pubDate>
      <guid>https://community.databricks.com/t5/get-started-discussions/how-to-read-gcs-paths-with-square-barkets/m-p/37946#M5481</guid>
      <dc:creator>Sparktaculer</dc:creator>
      <dc:date>2023-07-19T10:50:20Z</dc:date>
    </item>
  </channel>
</rss>

