Presto无法获取HIVE表中的内容

时间:2014-01-14 09:20:32

标签: hive presto

我的环境: hadoop 1.0.4 蜂巢0.12 hbase 0.94.14 presto 0.56

所有包都安装在伪机器上。服务不在localhost上运行,但是 在具有静态IP的主机名上。

presto conf:

coordinator=false
datasources=jmx,hive
http-server.http.port=8081
presto-metastore.db.type=h2
presto-metastore.db.filename=/root
task.max-memory=1GB
discovery.uri=http://<HOSTNAME>:8081

在presto cli中,我可以成功获取hive中的表格:

presto:default> show tables;
       Table
-------------------
ht1
k_business_d_
k_os_business_d_
...
tt1_
(11 rows)

Query 20140114_072809_00002_5zhjn, FINISHED, 1 node
Splits: 2 total, 2 done (100.00%)
0:11 [11 rows, 291B] [0 rows/s, 26B/s]

但是当我尝试从任何表中查询数据时,结果总是为空:(没有错误信息)

presto:default> select * from k_business_d_;
 key | business | business_name | collect_time | numofalarm | numofhost | test
-----+----------+---------------+--------------+------------+-----------+------
(0 rows)

Query 20140114_072839_00003_5zhjn, FINISHED, 1 node
Splits: 1 total, 1 done (100.00%)
0:02 [0 rows, 0B] [0 rows/s, 0B/s]

如果我在HIVE中执行相同的sql,结果显示表中有1行。

hive> select * from k_business_d_;
OK
9223370648089975807|2   2       测试机       2014-01-04 00:00:00     NULL    1.0         NULL
Time taken: 2.574 seconds, Fetched: 1 row(s)

为什么presto无法从HIVE表中获取?

1 个答案:

答案 0 :(得分:3)

看起来这是一个通过org.apache.hadoop.hive.hbase.HBaseStorageHandler使用HBase的外部表。目前尚不支持此功能,但是一个邮件列表帖子表明,如果您将相应的jar文件复制到Hive插件目录中,则可能是https://groups.google.com/d/msg/presto-users/U7vx8PhnZAA/9edzcK76tD8J

相关问题