我使用的是spark1.5.0,下面是我的代码,输出应该就是1000,但是经常输出错误,请教下这是BUG么?
case class data(id:Int,name:Int)
val tmp=(1 to 1000) zip (1 to 1000)
tmp.map(x=>data(x._1,x._2)).toDF.registerTempTable("test_table")
sqlContext.sql("select * from (select *,row_number() over(partition by id order by id DESC)rank from test_table)tmp where rank=1").count
|
|