0

我正在使用带钻的蜂巢。

存储插件信息:

{
  "type": "hive",
  "enabled": true,
  "configProps": {
    "hive.metastore.uris": "",
    "javax.jdo.option.ConnectionURL": "jdbc:mysql://localhost:3306/metastore_hive",
    "javax.jdo.option.ConnectionDriverName": "com.mysql.jdbc.Driver",
    "javax.jdo.option.ConnectionUserName": "root",
    "javax.jdo.option.ConnectionPassword": "root",
    "hive.metastore.warehouse.dir": "/user/hive/warehouse",
    "fs.default.name": "file:///",
    "hive.metastore.sasl.enabled": "false"
  }
}

它对查询和所有工作都很好。

然后我想检查它是否会自动发现 hive 中新创建的表。

我开始以嵌入式模式进行钻取,并在配置单元中使用了一个特定的数据库

use hive.testDB;

testDB是 Hive 中带有表t1&的数据库t2。然后我问:

show tables;

它给了我表名

t1 
t2

我在 hive 中创建了一个表,然后在 Drill 中t3再次触发。show tables;它还在显示 t1 t2。5-10 分钟后,我再次开火 show tables;,它正在显示t1 t2 t3

我认为它应该t3在添加t3蜂巢后立即显示。

这种行为可能是什么原因以及钻头如何在内部处理它?

4

1 回答 1

1

我在 Drill 的社区上问了同样的问题并找到了解决方案:

Drill 在其 HiveMetaStoreClient 中使用缓存,以减少访问 HiveMetaStore 的开销。默认情况下,缓存 TTL为 60 秒。

有一个已解决的问题。此问题已包含在 Drill 1.5 中。通过配置 hive 存储插件可以缩短缓存 TTL。

如果你想让缓存 TTL 更短,你可以配置 hive 存储插件。

示例 hive 插件缓存 ttl 5 秒):

"configProps": {
  "hive.metastore.uris": "thrift://hive.ip.address.com:9083",
  ... // other setting, 

  "hive.metastore.cache-ttl-seconds": "5",
  "hive.metastore.cache-expire-after": "access"
}

在此处查看更多详细信息。

于 2016-01-24T09:16:57.910 回答