如何使用presto查询hive数据 [英] how to use presto to query hive data

查看:223
本文介绍了如何使用presto查询hive数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了 presto,当我使用 presto-cli 查询 hive 数据时,出现以下错误:

I just installed presto and when I use the presto-cli to query hive data, I get the following error:

$ ./presto --server node6:8080 --catalog hive --schema default
presto:default> show tables;
Query 20131113_150006_00002_u8uyp failed: Table hive.information_schema.tables does not exist

config.properties 是:

The config.properties is:

coordinator=true
datasources=jmx,hive
http-server.http.port=8080
presto-metastore.db.type=h2
presto-metastore.db.filename=/root/h2
task.max-memory=1GB
discovery-server.enabled=true
discovery.uri=`http://node6:8080`

hive.properties 是:

And the hive.properties is:

connector.name=hive-cdh4
hive.metastore.uri=thrift://node6:9083

我使用的 hadoop 发行版是 CDH 4.4.我相信它已正确安装,并且 hive 可以自行成功处理查询.

The hadoop distribution I used is CDH 4.4. I believe it's properly installed and hive can process queries successfully on its own.

谁能帮我解决一下?任何想法将不胜感激.

Can anyone help me work it out? Any ideas will be appreciated.

推荐答案

按照入门的建议,我创建了一个控制器(仅限 jmx)和一个单独的工作器(jmx,hive),每个在不同的机器上.

As recommended by the Getting Started, I created a controller (jmx only) and a separate worker (jmx,hive), each on separate machines.

最终为我解决这个问题的是指定 worker's 主机名和 http-server.http.port 作为 --server 参数到 presto.指定控制器时,它不起作用.

What finally solved this for me was to specify the worker's hostname and http-server.http.port as the --server argument to presto. When specifying the controller, it didn't work.

这一切都说得通,但我仍然想知道当我有两个 Presto-Hive 工人时会发生什么......

This all makes sense, but I am still wondering what will happen when I have two Presto-Hive workers...

这篇关于如何使用presto查询hive数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆