____ __
/ __/__ ___ _____/ /__
_\ \/ _ \/ _ `/ __/ '_/
/___/ .__/\_,_/_/ /_/\_\ version 2.0.0
/_/
Using Scala version 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_131)
Type in expressions to have them evaluated.
Type :help for more information.
#######查询#######
scala> val df = spark.sql("select * from v6 where dt = 20191205")
df: org.apache.spark.sql.DataFrame = [parent_cluster_id: string, parent_cluster_name: string ... 18 more fields]
######保存文件#####
scala> df.coalesce(1).rdd.saveAsTextFile("file:///usr/rddtest1")
sparksql从hive中查询并且写入到本地文件
最新推荐文章于 2023-11-08 16:04:32 发布