Drill uses cache in its HiveMetaStoreClient, in order to reduce the
overhead to access HiveMetaStore. By default, the cache TTL is 60
seconds [1].

If you want to make the cache TTL shorter, you could configure hive
storage plugin. The following example reduces TTL to 5 seconds. See
[2]

"hive.metastore.cache-ttl-seconds": "5",


[1]. 
https://github.com/apache/drill/blob/master/contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/DrillHiveMetaStoreClient.java#L146

[2] https://issues.apache.org/jira/browse/DRILL-4161

On Tue, Jan 19, 2016 at 9:12 PM, Devender Yadav <[email protected]> wrote:
> Hi All,
>
> I am using hive with drill.
>
> *Storage Plugin* info:
>
> {
>   "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"
>   }
> }
>
> It's working fine for querying and all.
>
> *Then I wanted to check whether it automatically discover newly created
> tables in hive or not.*
>
> I started drill in embedded mode and used a particular database in hive
> using
>
> use hive.testDB;
>
> Here testDB is a database in Hive with tables t1 & t2. Then I queried:
>
> show tables;
>
> It gave me table names
>
> t1
> t2
>
> I created a table t3 in hive and again fired show tables; in Drill. It's
> still showing t1 t2. After 5-10 min I fired show tables; again and it's
> showing t1 t2 t3.
>
> I think it should show t3 immediately after adding t3 in hive.
>
> What can be reason for this behavior and how drill is handling it
> internally?
>
>
>
> Regards,
> Devender

Reply via email to