[Spark][Hive][Python][SQL]Spark 读取Hive表的小例子$ cat customers.txt 1 Ali us 2 Bsb ca 3 Carls mx $ hive hive> > CREATE TABLE IF NOT EXISTS customers( > cust_id string, > name string, > country string > ) > ROW FORMAT DELIMITED FIELDS TERMI…
spark 2.4.3 spark读取hive表,步骤: 1)hive-site.xml hive-site.xml放到$SPARK_HOME/conf下 2)enableHiveSupport SparkSession.builder.enableHiveSupport().getOrCreate() 3) 测试代码 val sparkConf = new SparkConf().setAppName(getName) val sc = new SparkContext(sparkConf)…