spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hyukjin Kwon (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (SPARK-13137) NullPoingException in schema inference for CSV when the first line is empty
Date Mon, 22 Feb 2016 01:30:18 GMT

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

Hyukjin Kwon updated SPARK-13137:
---------------------------------
    Issue Type: Sub-task  (was: Bug)
        Parent: SPARK-12420

> NullPoingException in schema inference for CSV when the first line is empty
> ---------------------------------------------------------------------------
>
>                 Key: SPARK-13137
>                 URL: https://issues.apache.org/jira/browse/SPARK-13137
>             Project: Spark
>          Issue Type: Sub-task
>          Components: SQL
>    Affects Versions: 2.0.0
>            Reporter: Hyukjin Kwon
>            Assignee: Hyukjin Kwon
>             Fix For: 2.0.0
>
>
> When the first line is empty and it tries to infer schema, this emits the exception below:
> {code}
> java.lang.NullPointerException was thrown.
> 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:125)
> {code}
> This looks because it fails to skip the empty lines in {{findFirstLine()}} at {{CSVRelation}}.



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

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


Mime
View raw message