You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Liwei Lin (JIRA)" <ji...@apache.org> on 2016/08/13 00:36:20 UTC

[jira] [Comment Edited] (SPARK-17039) cannot read null dates from csv file

    [ https://issues.apache.org/jira/browse/SPARK-17039?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15419730#comment-15419730 ] 

Liwei Lin edited comment on SPARK-17039 at 8/13/16 12:36 AM:
-------------------------------------------------------------

Thanks [~barrybecker4] for reporting this! Please also see https://issues.apache.org/jira/browse/SPARK-16462. It'd be great if you could try this patch https://github.com/apache/spark/pull/14118 and provide some feedback.


was (Author: proflin):
Thanks [~barrybecker4] for reporting this. Please also see https://issues.apache.org/jira/browse/SPARK-16462.

> cannot read null dates from csv file
> ------------------------------------
>
>                 Key: SPARK-17039
>                 URL: https://issues.apache.org/jira/browse/SPARK-17039
>             Project: Spark
>          Issue Type: Bug
>          Components: Input/Output
>    Affects Versions: 2.0.0
>            Reporter: Barry Becker
>
> I see this exact same bug as reported in this [stack overflow post|http://stackoverflow.com/questions/38265640/spark-2-0-pre-csv-parsing-error-if-missing-values-in-date-column]  using Spark 2.0.0 (released version).
> In scala, I read a csv using 
> sqlContext.read
>           .format("csv")
>           .option("header", "false")
>           .option("inferSchema", "false") 
>           .option("nullValue", "?")
>           .option("dateFormat", "yyyy-MM-dd'T'HH:mm:ss")
>           .schema(dfSchema)
>           .csv(dataFile)
> The data contains some null dates (represented with ?).
> The error I get is:
> {code}
> org.apache.spark.SparkException: Job aborted due to stage failure: Task 0 in stage 8.0 failed 1 times, most recent failure: Lost task 0.0 in stage 8.0 (TID 10, localhost): java.text.ParseException: Unparseable date: "?"
> {code}



--
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