这不是
sc <- TranswarpR.init("kmeans", "GreedyHeterogeneousMode", "1", "0.2")
sql<- "select p1,p2,p3 from powerloaddata.powerdata limit 10"
sqlrdd<-txSql2RDD(sc,query=sql,minnum=100,sep=" ")
txKmeans(sqlrdd, 4, iter.max =10, nstart = 1, sep=" ")
require(RJDBC)
drv <- JDBC(‘org.apache.hadoop.hive.jdbc.HiveDriver’,
“hive-jdbc-0.12.0-transwarp.jar”)
conn <- dbConnect(drv, sprintf(‘jdbc:transwarp://%s:%s/powerloaddata’, ‘192.168.1.40’, ‘10000’))
data <- dbGetQuery(conn,”select * from powerloaddata.powerdata where Userid = ‘10002459’ limit 100”)
head(data)