[ 
https://issues.apache.org/jira/browse/SPARK-13173?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Davies Liu closed SPARK-13173.
------------------------------
    Resolution: Cannot Reproduce

> Fail to load CSV file with NPE
> ------------------------------
>
>                 Key: SPARK-13173
>                 URL: https://issues.apache.org/jira/browse/SPARK-13173
>             Project: Spark
>          Issue Type: Bug
>          Components: Input/Output, SQL
>            Reporter: Davies Liu
>
> {code}
> id|end_date|start_date|location
> 1|2015-10-14 00:00:00|2015-09-14 00:00:00|CA-SF
> 2|2015-10-15 01:00:20|2015-08-14 00:00:00|CA-SD
> 3|2015-10-16 02:30:00|2015-01-14 00:00:00|NY-NY
> 4|2015-10-17 03:00:20|2015-02-14 00:00:00|NY-NY
> 5|2015-10-18 04:30:00|2014-04-14 00:00:00|CA-SD
> {code}
> {code}
> adult_df = sqlContext.read.\
>     format("org.apache.spark.sql.execution.datasources.csv").\
>     option("header", "false").option("delimiter", "|").\
>     option("inferSchema", "true").load("/tmp/dataframe_sample.csv")
> {code}
> {code}
> Py4JJavaError: An error occurred while calling o239.load.
> : java.lang.NullPointerException
>       at 
> scala.collection.mutable.ArrayOps$ofRef$.length$extension(ArrayOps.scala:114)
>       at scala.collection.mutable.ArrayOps$ofRef.length(ArrayOps.scala:114)
>       at 
> scala.collection.IndexedSeqOptimized$class.zipWithIndex(IndexedSeqOptimized.scala:93)
>       at 
> scala.collection.mutable.ArrayOps$ofRef.zipWithIndex(ArrayOps.scala:108)
>       at 
> org.apache.spark.sql.execution.datasources.csv.CSVRelation.inferSchema(CSVRelation.scala:137)
>       at 
> org.apache.spark.sql.execution.datasources.csv.CSVRelation.dataSchema$lzycompute(CSVRelation.scala:50)
>       at 
> org.apache.spark.sql.execution.datasources.csv.CSVRelation.dataSchema(CSVRelation.scala:48)
>       at 
> org.apache.spark.sql.sources.HadoopFsRelation.schema$lzycompute(interfaces.scala:666)
>       at 
> org.apache.spark.sql.sources.HadoopFsRelation.schema(interfaces.scala:665)
>       at 
> org.apache.spark.sql.execution.datasources.LogicalRelation.<init>(LogicalRelation.scala:39)
>       at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:115)
>       at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:136)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.lang.reflect.Method.invoke(Method.java:497)
>       at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:231)
>       at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:381)
>       at py4j.Gateway.invoke(Gateway.java:290)
>       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(Thread.java:745)
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to