我尝试将日期文件与sparkSql一起使用,但它无法正常工作
喜欢在例子中 javaSparkSqlExample
我尝试添加datecoloumn dob
在Person类中我添加了
dob的setter和getter为Date
试图执行时
SELECT dob,name,age,count(*) as totalCount FROM Person WHERE dob >= '1995-01-01' AND age <= '2014-02-01';
还尝试在查询中使用它而不是&lt; =&amp; &gt; =以及
/Volumes/Official/spark-1.0.2-bin-hadoop2$: bin/spark-submit --class "SimpleApp" --master local[4] try/simple-project/target/simple-project-1.0.jar
Spark assembly has been built with Hive, including Datanucleus jars on classpath
2014-08-21 11:42:47.360 java[955:1903] Unable to load realm mapping info from SCDynamicStore
=== Data source: RDD ===
Exception in thread "main" scala.MatchError: class java.util.Date (of class java.lang.Class)
答案 0 :(得分:3)
它还处于待定状态,而Date
您可以在Timestamp
课程中使用Person
SPARK-2552
Spark SQL目前支持Timestamp,但不支持Date。
我们将等待一段时间直到1.2.0版本。
详细说明: