SparkSQL ThriftServer服务的使用和程序中JDBC的连接
此时要注意版本问题,我第一次用的是hive2.1.1的,因为要用sparksql的hive服务,但是sparksql默认的是1.2的,在替换了下面四个包之后
hive-beeline-1.2.1.spark2.jar
hive-cli-1.2.1.spark2.jar
hive-exec-1.2.1.spark2.jar
hive-jdbc-1.2.1.spark2.jar
hive-metastore-1.2.1.spark2.jar
依然报错,只好退回hive1.2.1
在beeline中,如果执行load data 方法 路径执行错误时,beeline不会报错, 即使路径正确,没有返回错误,但是也不会执行.
在sparkonsql中有的命令依然是不支持的.且有的命令即使错误也不会报错
然后配置hive-site.xml
configuration> <!-- WARNING!!! This file is auto generated for documentation purposes ONLY! --> <!-- WARNING!!! Any changes you make to this file will be ignored by Hive. --> <!-- WARNING!!! You must make your changes in hive-site.xml instead. --> <!-- Hive Execution Parameters --> <property> <name>javax.jdo.option.ConnectionURL</name> <value>jdbc:mysql://mini1:3306/hive?createDatabaseIfNotExist=true</value> </property> <property> <name>javax.jdo.option.ConnectionDriverName</name> <value>com.mysql.jdbc.Driver</value> </property> <property> <name>javax.jdo.option.ConnectionUserName</name> <value>root</value> </property> <property> <name>javax.jdo.option.ConnectionPassword</name> <value>root</value> </property> <property> <name>hive.metastore.schema.verification</name> <value>false</value> </property> <property> <name>hive.server2.thrift.port</name> <value>10000</value> </property> <property> <name>hive.server2.thrift.host</name> <value>mini1</value> </property> </configuration>
对比