spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jais Sebastian (JIRA)" <j...@apache.org>
Subject [jira] [Created] (SPARK-12969) Exception while casting a spark supported date formatted "string" to "date" data type.
Date Sat, 23 Jan 2016 15:36:39 GMT
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


Mime
View raw message