You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Jais Sebastian (JIRA)" <ji...@apache.org> on 2016/01/23 16:36:39 UTC
[jira] [Created] (SPARK-12969) Exception while casting a spark
supported date formatted "string" to "date" data type.
Jais Sebastian created SPARK-12969:
--------------------------------------
Summary: 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