4-flink1.11.1对接hive2.3.4
flink对接hive
环境准备
- MacOS
- flink1.11.1
集成hive
- 配置sql-client-hive.yaml
cp $FLINK_HOME/conf/sql-client-defaults.yaml $FLINK_HOME/conf/sql-client-hive.yaml
- 准备hive-site.xml文件
- 修改配置文件
catalogs:
- name: myhive
type: hive
hive-conf-dir: /usr/local/flink-1.11.0/hive_conf
hive-version: 1.1.1
execution:
type: batch
-
拷贝jar包 wget https://repo.maven.apache.org/maven2/org/apache/flink/flink-sql-connector-hive-2.3.6_2.11/1.11.1/flink-sql-connector-hive-2.3.6_2.11-1.11.1.jar hive-exec-2.3.6.jar
-
启动flink start-cluster.sh
-
启动sql-client
sql-client.sh embedded -d $FLINK_HOME/conf/sql-client-hive.yaml -l $FLINK_HOME/lib
-
查询结果
use catalog myhive;
show databases;
use test;
describe records;
select * from test.records;