语句来调用
1.针对表的操作
1>创建表
df.registerTempTable("tabName")
2>查看表
sqlContext.sql("show tables").show
2.查询
val sqc...sh"),(3,"c","gz"),(4,"d","bj"),(5,"e","gz"))).toDF("id","name","addr");
df.registerTempTable("stu");
sqc.sql...sh"),(3,"c","gz"),(4,"d","bj"),(5,"e","gz"))).toDF("id","name","addr");
df.registerTempTable("stu");
sqc.sql...setMaster("local").setAppName("sql")
val sc = new SparkContext(conf)
//获取Sparksql上下文对象
val sqc...._
val t1 = r1.toDF("name", "age")
t1.registerTempTable("stu")
val result = sqc.sql("select