<?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>question How to read in a csv file from server location? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-to-read-in-a-csv-file-from-server-location/m-p/341826#M233616</link>
    <description>&lt;DIV&gt;&lt;DIV class=""&gt;&lt;DIV class="public-DraftStyleDefault-block public-DraftStyleDefault-ltr"&gt;&lt;SPAN&gt;I typically upload csv files into Cloudera Data Science Workbench, but I wonder if there is a way to programmatically read in a csv file from a shared server drive while in yarn mode? Using the below code, I get an error. Any Tips?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="public-DraftStyleDefault-block public-DraftStyleDefault-ltr"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="public-DraftStyleDefault-block public-DraftStyleDefault-ltr"&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;df = spark.read.format('csv')&lt;/SPAN&gt;&lt;SPAN&gt;.load('Q:\\project\\data_folder\\file.csv', header=True)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class="public-DraftStyleDefault-block public-DraftStyleDefault-ltr"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="public-DraftStyleDefault-block public-DraftStyleDefault-ltr"&gt;&lt;SPAN&gt;The error I get is:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="public-DraftStyleDefault-block public-DraftStyleDefault-ltr"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="public-DraftStyleDefault-block public-DraftStyleDefault-ltr"&gt;&lt;FONT color="#FF0000"&gt;&lt;SPAN&gt;IllegalArgumentException: 'java.net.URISyntaxException: Relative path in absolute URI: Q:%5Cproject%5Cdata_folder/file.csv'&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 21 Apr 2026 07:57:26 GMT</pubDate>
    <dc:creator>Data1701</dc:creator>
    <dc:date>2026-04-21T07:57:26Z</dc:date>
    <item>
      <title>How to read in a csv file from server location?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-read-in-a-csv-file-from-server-location/m-p/341826#M233616</link>
      <description>&lt;DIV&gt;&lt;DIV class=""&gt;&lt;DIV class="public-DraftStyleDefault-block public-DraftStyleDefault-ltr"&gt;&lt;SPAN&gt;I typically upload csv files into Cloudera Data Science Workbench, but I wonder if there is a way to programmatically read in a csv file from a shared server drive while in yarn mode? Using the below code, I get an error. Any Tips?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="public-DraftStyleDefault-block public-DraftStyleDefault-ltr"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="public-DraftStyleDefault-block public-DraftStyleDefault-ltr"&gt;&lt;FONT color="#0000FF"&gt;&lt;SPAN&gt;df = spark.read.format('csv')&lt;/SPAN&gt;&lt;SPAN&gt;.load('Q:\\project\\data_folder\\file.csv', header=True)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;DIV class="public-DraftStyleDefault-block public-DraftStyleDefault-ltr"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="public-DraftStyleDefault-block public-DraftStyleDefault-ltr"&gt;&lt;SPAN&gt;The error I get is:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="public-DraftStyleDefault-block public-DraftStyleDefault-ltr"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="public-DraftStyleDefault-block public-DraftStyleDefault-ltr"&gt;&lt;FONT color="#FF0000"&gt;&lt;SPAN&gt;IllegalArgumentException: 'java.net.URISyntaxException: Relative path in absolute URI: Q:%5Cproject%5Cdata_folder/file.csv'&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 21 Apr 2026 07:57:26 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-read-in-a-csv-file-from-server-location/m-p/341826#M233616</guid>
      <dc:creator>Data1701</dc:creator>
      <dc:date>2026-04-21T07:57:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to read in a csv file from server location?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-read-in-a-csv-file-from-server-location/m-p/341835#M233619</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/97352"&gt;@Data1701&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to &lt;A href="https://docs.oracle.com/javase/7/docs/api/java/net/URISyntaxException.html" target="_blank" rel="noopener"&gt;the API documentation&lt;/A&gt;, one can get a &lt;FONT face="terminal,monaco,monospace"&gt;java.net.URISyntaxException&lt;/FONT&gt; when a passed string could not be parsed as a URI reference.&lt;/P&gt;
&lt;P&gt;The file you are attempting to read in might very well be available on your local area network from a shared server drive, but it isn't available via a valid &lt;A href="https://en.wikipedia.org/wiki/Uniform_Resource_Identifier" target="_blank" rel="noopener"&gt;URI&lt;/A&gt;, or at the very least, the URI you are referencing in your Spark code isn't a valid and accessible URI.&lt;/P&gt;
&lt;P&gt;What your problem boils down to is that the file isn't available via a web server, and the server that is running your Spark code can't retrieve it at the time your code executes. And that should shed light on why you had to previously upload your &lt;FONT face="terminal,monaco,monospace"&gt;.csv&lt;/FONT&gt; files into CDSW, because that was the way to ensure that they could be found at runtime, since they were in a well-known/accessible location.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are several valid approaches to addressing this, but the easiest solution, if you want to continue to use the code snippet you've written and shared here, is to place the file on some server that is accessible over the web (preferably via &lt;A href="https://en.wikipedia.org/wiki/HTTPS" target="_blank" rel="noopener"&gt;HTTPS&lt;/A&gt;) and refer to it using a fully-qualified URL. In order to do that, a functioning and secured web server will have to be available to you (you could set this up on your local workstation).&lt;/P&gt;
&lt;P&gt;Let's assume you place the file on a web-accessible server somewhere local to your corporate network and the web-accessible directory path you place the file in turns out to be something like &lt;FONT face="terminal,monaco,monospace"&gt;Data1701/project/data_folder/&lt;/FONT&gt;. Then you can change the assignment statement in your Spark code to this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE&gt;
df = spark.read.format('csv').load('https://web.dept.yourcompany.com/Data1701/project/data_folder/file.csv', header=True)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;…and the rest of your code should work, unchanged.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2022 22:55:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-read-in-a-csv-file-from-server-location/m-p/341835#M233619</guid>
      <dc:creator>ask_bill_brooks</dc:creator>
      <dc:date>2022-04-20T22:55:42Z</dc:date>
    </item>
  </channel>
</rss>

