Error in reading deckofcards.txt using pyspark


#1

Hi Team, Not able to read deckofcards either through cmd or through Pyspark IDE.
Is it related to Environment variables setting.

Attaching logs & Screenshot below.

sc.textFile(“C:\deckofcards.txt”).first()
19/01/05 15:47:42 INFO MemoryStore: Block broadcast_0 stored as values in memory (estimated size 127.4 KB, free 511.0 MB)
19/01/05 15:47:42 INFO MemoryStore: Block broadcast_0_piece0 stored as bytes in memory (estimated size 13.9 KB, free 511.0 MB)
19/01/05 15:47:42 INFO BlockManagerInfo: Added broadcast_0_piece0 in memory on localhost:62194 (size: 13.9 KB, free: 511.1 MB)
19/01/05 15:47:42 INFO SparkContext: Created broadcast 0 from textFile at null:-2
Traceback (most recent call last):
File “”, line 1, in
File “C:\spark-1.6.3-bin-hadoop2.6\python\pyspark\rdd.py”, line 1315, in first
rs = self.take(1)
File “C:\spark-1.6.3-bin-hadoop2.6\python\pyspark\rdd.py”, line 1267, in take
totalParts = self.getNumPartitions()
File “C:\spark-1.6.3-bin-hadoop2.6\python\pyspark\rdd.py”, line 356, in getNumPartitions
return self.jrdd.partitions().size()
File “C:\spark-1.6.3-bin-hadoop2.6\python\lib\py4j-0.9-src.zip\py4j\java_gateway.py”, line 813, in call
File “C:\spark-1.6.3-bin-hadoop2.6\python\pyspark\sql\utils.py”, line 45, in deco
return f(*a, **kw)
File “C:\spark-1.6.3-bin-hadoop2.6\python\lib\py4j-0.9-src.zip\py4j\protocol.py”, line 308, in get_return_value
py4j.protocol.Py4JJavaError: An error occurred while calling o18.partitions.
**
: org.apache.hadoop.mapred.InvalidInputException: Input path does not exist: file:/C:/deckofcards.txt_**
at org.apache.hadoop.mapred.FileInputFormat.singleThreadedListStatus(FileInputFormat.java:285)
at org.apache.hadoop.mapred.FileInputFormat.listStatus(FileInputFormat.java:228)
at org.apache.hadoop.mapred.FileInputFormat.getSplits(FileInputFormat.java:313)
at org.apache.spark.rdd.HadoopRDD.getPartitions(HadoopRDD.scala:202)
at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:239)
at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:237)
at scala.Option.getOrElse(Option.scala:120)
at org.apache.spark.rdd.RDD.partitions(RDD.scala:237)
at org.apache.spark.rdd.MapPartitionsRDD.getPartitions(MapPartitionsRDD.scala:35)
at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:239)
at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:237)
at scala.Option.getOrElse(Option.scala:120)
at org.apache.spark.rdd.RDD.partitions(RDD.scala:237)
at org.apache.spark.api.java.JavaRDDLike$class.partitions(JavaRDDLike.scala:64)
at org.apache.spark.api.java.AbstractJavaRDDLike.partitions(JavaRDDLike.scala:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:231)
at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:381)
at py4j.Gateway.invoke(Gateway.java:259)
at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:133)
at py4j.commands.CallCommand.execute(CallCommand.java:79)
at py4j.GatewayConnection.run(GatewayConnection.java:209)
at java.lang.Thread.run(Unknown Source)


#2

@debabrotadas Can you paste environment variables and PATH variables screenshot.