load文件到hive,并保存
DataFrame usersDF = sqlContext.read().load("hdfs://spark1:9000/users.parquet");
usersDF.select("name", "favorite_color").write()
.save("hdfs://spark1:9000/namesAndFavColors.parquet");
//load、save方法~指定文件格式
DataFrame peopleDF = sqlContext.read().format("json")
.load("hdfs://spark1:9000/people.json");
peopleDF.select("name").write().format("parquet")
.save("hdfs://spark1:9000/peopleName_java");