今天使用Scala编写Spark程序的时候因为需要使用SparkSql建表所以有了如下的代码(代码只是例子,不是现实工程):
import org.apache.spark.{SparkContext, SparkConf}
/**
* Created by Utopia on 2016/7/13.
*/
object testforjob {
def main (args: Array[String]) {
val conf = new SparkConf()
conf.setAppName("Test")
conf.setMaster("local")
val sc = new SparkContext(conf)
val lines = sc.textFile("C://Users/802/Desktop/uip.txt").map(_.split(","))