spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ajesh Kumar (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SPARK-12969) Exception while casting a spark supported date formatted "string" to "date" data type.
Date Mon, 25 Jan 2016 10:52:39 GMT

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

Ajesh Kumar commented on SPARK-12969:
-------------------------------------

I have tried the same code in spark 1.6.0 and able to get the below output with out any exception.

16/01/25 16:14:53 INFO DAGScheduler: Job 2 finished: show at DateTest.java:33, took 0.043454
s
+-------------+
|           d     |
+-------------+
|2015-02-01|
+--------------+

Can you verify the spark version and try it again. ? Is still issue exist, can you please
provide the steps to recreate this issue.

> Exception while  casting a spark supported date formatted "string" to "date" data type.
> ---------------------------------------------------------------------------------------
>
>                 Key: SPARK-12969
>                 URL: https://issues.apache.org/jira/browse/SPARK-12969
>             Project: Spark
>          Issue Type: Bug
>          Components: Java API
>    Affects Versions: 1.6.0
>         Environment: Spark Java 
>            Reporter: Jais Sebastian
>
> Getting exception while  converting a string column( column is having spark supported
date format yyyy-MM-dd ) to date data type. Below is the code snippet 
>         List<String> jsonData = Arrays.asList( "{\"d\":\"2015-02-01\",\"n\":1}");
>         JavaRDD<String> dataRDD = this.getSparkContext().parallelize(jsonData);
>         DataFrame data = this.getSqlContext().read().json(dataRDD);
>         DataFrame newData = data.select(data.col("d").cast("date"));
>         newData.show();
> Above code will give the error
> failed to compile: org.codehaus.commons.compiler.CompileException: File generated.java,
Line 95, Column 28: Expression "scala.Option < Long > longOpt16" is not an lvalue



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