hive和spark版本对应
配置连接
在spark master的机器中,spark/conf/目录下创建hive-site.xml,并配置
并在原来的hive-site.xml配置hive.metastore.uris
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<configuration>
<property>
<name>hive.metastore.uris</name>
<value>thrift://localhost:9083</value>
<description>Thrift URI for the remote metastore. ...</description>
</property>
</configuration>
配置spark thrift server
<property>
<name>hive.server2.thrift.bind.host</name>
<value>master</value>
<description>Bind host on which to run the HiveServer2 Thrift service.</description>
</property>
<property>
<name>hive.server2.thrift.port</name>
<value>10001</value> (与hiveserver2区分开)
<description>Port number of HiveServer2 Thrift interface when hive.server2.transport.mode is 'binary'.</descripti
[root@iZuf692x556cjpozgoe31bZ spark-2.4.5]# ./bin/spark-sql --conf
[root@root sark-2.4.5]# ./bin/spark-sql --conf spark.sql.warehouse.dir=hdfs://localhost:9000/root/hive/warehouse spark-sql -i /home/study/sqlfile/sql2flinksql.sql