<?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: Not able to read text file from local file path - Spark CSV reader in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/not-able-to-read-text-file-from-local-file-path-spark-csv-reader/m-p/68659#M33713</link>
    <description>&lt;P&gt;Thanks for your help. It helped me a lot.&lt;/P&gt;</description>
    <pubDate>Thu, 09 May 2024 12:37:13 GMT</pubDate>
    <dc:creator>AshleeBall</dc:creator>
    <dc:date>2024-05-09T12:37:13Z</dc:date>
    <item>
      <title>Not able to read text file from local file path - Spark CSV reader</title>
      <link>https://community.databricks.com/t5/data-engineering/not-able-to-read-text-file-from-local-file-path-spark-csv-reader/m-p/29382#M21112</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;We are using Spark CSV reader to read the csv file to convert as DataFrame and we are running the job on &lt;PRE&gt;&lt;CODE&gt;yarn-client&lt;/CODE&gt;&lt;/PRE&gt;, its working fine in local mode.&lt;/P&gt;
&lt;P&gt;We are submitting the spark job in &lt;PRE&gt;&lt;CODE&gt;edge node&lt;/CODE&gt;&lt;/PRE&gt;.&lt;/P&gt;
&lt;P&gt;But when we place the file in local file path instead of HDFS, we are getting file not found exception.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Code:&lt;/B&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;sqlContext.read.format("com.databricks.spark.csv")
      .option("header", "true").option("inferSchema", "true")
      .load("file:/filepath/file.csv")
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;We also tried &lt;PRE&gt;&lt;CODE&gt;file:///&lt;/CODE&gt;&lt;/PRE&gt;, but still we are getting the same error.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Error log:&lt;/B&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;2016-12-24 16:05:40,044 WARN  [task-result-getter-0] scheduler.TaskSetManager: Lost task 0.0 in stage 0.0 (TID 0, hklvadcnc06.hk.standardchartered.com): java.io.FileNotFoundException: File file:/shared/sample1.csv does not exist
        at org.apache.hadoop.fs.RawLocalFileSystem.deprecatedGetFileStatus(RawLocalFileSystem.java:609)
        at org.apache.hadoop.fs.RawLocalFileSystem.getFileLinkStatusInternal(RawLocalFileSystem.java:822)
        at org.apache.hadoop.fs.RawLocalFileSystem.getFileStatus(RawLocalFileSystem.java:599)
        at org.apache.hadoop.fs.FilterFileSystem.getFileStatus(FilterFileSystem.java:421)
        at org.apache.hadoop.fs.ChecksumFileSystem$ChecksumFSInputChecker.&amp;lt;init&amp;gt;(ChecksumFileSystem.java:140)
        at org.apache.hadoop.fs.ChecksumFileSystem.open(ChecksumFileSystem.java:341)
        at org.apache.hadoop.fs.FileSystem.open(FileSystem.java:767)
        at org.apache.hadoop.mapred.LineRecordReader.&amp;lt;init&amp;gt;(LineRecordReader.java:109)
        at org.apache.hadoop.mapred.TextInputFormat.getRecordReader(TextInputFormat.java:67)
        at org.apache.spark.rdd.HadoopRDD$anon$1.&amp;lt;init&amp;gt;(HadoopRDD.scala:241)
        at org.apache.spark.rdd.HadoopRDD.compute(HadoopRDD.scala:212)
        at org.apache.spark.rdd.HadoopRDD.compute(HadoopRDD.scala:101)
        at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:313)
        at org.apache.spark.rdd.RDD.iterator(RDD.scala:277)
        at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
        at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:313)
        at org.apache.spark.rdd.RDD.iterator(RDD.scala:277)
        at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
        at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:313)
        at org.apache.spark.rdd.RDD.iterator(RDD.scala:277)
        at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:66)
        at org.apache.spark.scheduler.Task.run(Task.scala:89)
        at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:214)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)&lt;/CODE&gt;&lt;/PRE&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Dec 2016 09:01:28 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/not-able-to-read-text-file-from-local-file-path-spark-csv-reader/m-p/29382#M21112</guid>
      <dc:creator>SankaraiahNaray</dc:creator>
      <dc:date>2016-12-24T09:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to read text file from local file path - Spark CSV reader</title>
      <link>https://community.databricks.com/t5/data-engineering/not-able-to-read-text-file-from-local-file-path-spark-csv-reader/m-p/29383#M21113</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;The path should be with file:/// and it works for me. @&lt;/P&gt;
&lt;P&gt;snsancar &lt;/P&gt;&lt;P&gt;&lt;/P&gt;Not sure if this got resolved for you or not. If not let me know know so that i can share my code. 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2017 08:01:43 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/not-able-to-read-text-file-from-local-file-path-spark-csv-reader/m-p/29383#M21113</guid>
      <dc:creator>VenkatKrishnan</dc:creator>
      <dc:date>2017-06-21T08:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to read text file from local file path - Spark CSV reader</title>
      <link>https://community.databricks.com/t5/data-engineering/not-able-to-read-text-file-from-local-file-path-spark-csv-reader/m-p/29384#M21114</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Hi, Please share your code to help me resolve the above issue as I am facing the same issue mentioned.&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 10:30:14 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/not-able-to-read-text-file-from-local-file-path-spark-csv-reader/m-p/29384#M21114</guid>
      <dc:creator>gopinathsh</dc:creator>
      <dc:date>2019-01-22T10:30:14Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to read text file from local file path - Spark CSV reader</title>
      <link>https://community.databricks.com/t5/data-engineering/not-able-to-read-text-file-from-local-file-path-spark-csv-reader/m-p/29385#M21115</link>
      <description>&lt;P&gt;searching for the related issue for mykfcexperience and looking forward to getting a solution in this website&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2019 21:06:52 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/not-able-to-read-text-file-from-local-file-path-spark-csv-reader/m-p/29385#M21115</guid>
      <dc:creator>kairaadvani</dc:creator>
      <dc:date>2019-01-22T21:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to read text file from local file path - Spark CSV reader</title>
      <link>https://community.databricks.com/t5/data-engineering/not-able-to-read-text-file-from-local-file-path-spark-csv-reader/m-p/29386#M21116</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;I tried in all the possible ways to read the files and I can't. With a Notebook it works, but I need to run a Spark Submit job and in that way it does not work&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;pdf = pd.read_csv("/databricks/driver/zipFiles/s3Sensor/2017/Tracking_Bounces_20190906.csv.zip/Bounces.csv")
pdf2 = pd.read_csv("file:/databricks/driver/zipFiles/s3Sensor/2017/Tracking_Bounces_20190906.csv.zip/Bounces.csv")
df3 = pd.read_csv("file:///databricks/driver/zipFiles/s3Sensor/2017/Tracking_Bounces_20190906.csv.zip/Bounces.csv")
&lt;/CODE&gt;&lt;/PRE&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2019 18:38:29 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/not-able-to-read-text-file-from-local-file-path-spark-csv-reader/m-p/29386#M21116</guid>
      <dc:creator>EricBellet</dc:creator>
      <dc:date>2019-10-24T18:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to read text file from local file path - Spark CSV reader</title>
      <link>https://community.databricks.com/t5/data-engineering/not-able-to-read-text-file-from-local-file-path-spark-csv-reader/m-p/29387#M21117</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;It works if a run the code using a Notebook, but if I use a Spark Submit or Python Submit job it doesn't work&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2019 07:03:33 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/not-able-to-read-text-file-from-local-file-path-spark-csv-reader/m-p/29387#M21117</guid>
      <dc:creator>EricBellet</dc:creator>
      <dc:date>2019-10-28T07:03:33Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to read text file from local file path - Spark CSV reader</title>
      <link>https://community.databricks.com/t5/data-engineering/not-able-to-read-text-file-from-local-file-path-spark-csv-reader/m-p/29388#M21118</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Does the file exist on executor node?&lt;/P&gt; 
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 08 Mar 2020 15:35:01 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/not-able-to-read-text-file-from-local-file-path-spark-csv-reader/m-p/29388#M21118</guid>
      <dc:creator>ajit1</dc:creator>
      <dc:date>2020-03-08T15:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to read text file from local file path - Spark CSV reader</title>
      <link>https://community.databricks.com/t5/data-engineering/not-able-to-read-text-file-from-local-file-path-spark-csv-reader/m-p/29389#M21119</link>
      <description>&lt;P&gt;I am also not able to read a csv file from a C:\ drive location. Can anyone help? I get error as path doesnt exist. &lt;/P&gt;&lt;P&gt;Code snippet - &lt;/P&gt;&lt;P&gt;path = 'file:///C:/Users/folder_1/folder_2/folder_3/xyz.csv'&lt;/P&gt;&lt;P&gt;df = spark.read.csv(path)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tried lots of combinations for above path but no success.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Dec 2021 12:47:18 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/not-able-to-read-text-file-from-local-file-path-spark-csv-reader/m-p/29389#M21119</guid>
      <dc:creator>abhi_1825</dc:creator>
      <dc:date>2021-12-17T12:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to read text file from local file path - Spark CSV reader</title>
      <link>https://community.databricks.com/t5/data-engineering/not-able-to-read-text-file-from-local-file-path-spark-csv-reader/m-p/29390#M21120</link>
      <description>&lt;P&gt;@Abhishek Pathak​&amp;nbsp;- My name is Piper, and I'm one of the moderators for Databricks. Thank you for posting your question! Let's see what the community has to say; otherwise, we'll circle back around to this. &lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 20:22:59 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/not-able-to-read-text-file-from-local-file-path-spark-csv-reader/m-p/29390#M21120</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-20T20:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to read text file from local file path - Spark CSV reader</title>
      <link>https://community.databricks.com/t5/data-engineering/not-able-to-read-text-file-from-local-file-path-spark-csv-reader/m-p/29391#M21121</link>
      <description>&lt;P&gt;Hi, Thanks for replying. Do we have any update on this? As far as i looked, it seems we cant read a local file directly. Is it the case.&lt;/P&gt;&lt;P&gt;Accordingly, can i connect to ADLS gen2 storage(Azure) while using community edition of Databricks? I am getting an error there as well. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Dec 2021 06:31:41 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/not-able-to-read-text-file-from-local-file-path-spark-csv-reader/m-p/29391#M21121</guid>
      <dc:creator>abhi_1825</dc:creator>
      <dc:date>2021-12-27T06:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: Not able to read text file from local file path - Spark CSV reader</title>
      <link>https://community.databricks.com/t5/data-engineering/not-able-to-read-text-file-from-local-file-path-spark-csv-reader/m-p/68659#M33713</link>
      <description>&lt;P&gt;Thanks for your help. It helped me a lot.&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2024 12:37:13 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/not-able-to-read-text-file-from-local-file-path-spark-csv-reader/m-p/68659#M33713</guid>
      <dc:creator>AshleeBall</dc:creator>
      <dc:date>2024-05-09T12:37:13Z</dc:date>
    </item>
  </channel>
</rss>

