Presto-[4]-单机配置查询Hive

来源:互联网 发布:mac口红试色see sheer 编辑:程序博客网 时间:2024/05/14 23:47

一、已安装hive、myql、初步安装配置Presto

具体参考:

  • Presto-[3]-单机安装_配置查询Mysql
  • Mac安装Mysql_解决中文乱码_JDBC访问操作
  • Mac-单机Hive安装与测试

二、修改配置文件

(1)config.properties 

datasources=mysql,hive

(2)添加配置文件 etc/catalog/hive.properties

参考:https://prestodb.io/docs/current/connector/hive.html

connector.name=hive-hadoop2hive.metastore.uri=thrift://example.net:9083

(3)修改hive的hive-site.xml  

<property> 

  <name>hive.metastore.uris</name> 

  <value>thrift://localhost:9083</value> 

</property> 

</configuration>

(4)(另启动两个窗口)启动hive-meta和hive-server2 

hive --service hiveserver2 & 

hive --service metastore &

(5)重启Presto server

/Documents/software/Presto/presto-server-0.191$ bin/launcher start
Started as 56523

(6)启动Presto 终端hive schema

software/Presto/CLI/presto$ ./presto --server localhost:8080 --catalog hive --schema default
presto:default>

(7)查询hive表

presto:default> SELECT * FROM hive.hive_test.student;
id | name
------+----------
1001 | zhangsan
1002 | lisi
(2 rows)

Query 20171219_163839_00002_qee7n, FINISHED, 1 node
Splits: 17 total, 17 done (100.00%)
0:03 [2 rows, 23B] [0 rows/s, 9B/s]



参考:

https://prestodb.io/docs/current/connector/hive.html

http://www.wfuyu.com/Internet/22334.html


原创粉丝点击