我使用這個代碼從蜂巢中獲取數據星火: val hc = new org.apache.spark.sql.hive.HiveContext(sc)
val MyTab = hc.sql("select * from svm_file")
,我也得到數據幀: scala> MyTab.show()
+--------------------+
| line|
+----------
以下工作: val df = sqlc.sql("select coalesce(optPrefix.optSysIp,'--') as ip, count(1) as cnt
from llines group by coalesce(optPrefix.optSysIp,'--')").collect
res39: Array[org.apache.spark.sql.Row] = Ar