You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by "Stephen R. Scaffidi" <ss...@tripadvisor.com> on 2012/07/02 13:46:35 UTC

Re: getting Hive table access times

On 06/28/2012 09:28 AM, Stephen R. Scaffidi wrote:
> I've written some code where I am trying to get the atime of my tables 
> in Hive. It's fairly simple - the method call in question is simply:
>
>   int atime = htable.getLastAccessTime();
>
> Where htable is an otherwise normal 
> org.apache.hadoop.hive.metastore.api.Table object.
>
> The question is this: does hive or hadoop store the atime of the table 
> in some metadata or does it rely on the filesystem?
>
> I ask this because I am getting 0 as the value for every table in my 
> cluster, and have just realized that the filesystem is mounted with 
> noatime!
>
> A secondary question is - if I can not get the atime using this API 
> call, is there another way to find out when a table was last accessed? 
> How?
>

Bump - should I be asking this on a different list?

Re: getting Hive table access times

Posted by "Stephen R. Scaffidi" <ss...@tripadvisor.com>.
Well, diving through the source code, that seems to be the case. It 
seems like an odd thing to have to set an access time manually, but I 
guess I can see how it could be useful :)

On 07/02/2012 02:24 PM, VanHuy Pham wrote:
> I think it only makes sense to use getLastAccessTime() when you have
> already used setLastAccessTime() MANUALLY, otherwise hive does not
> automatically set the access time in its metastore. Correct me if I am
> wrong!



Re: getting Hive table access times

Posted by VanHuy Pham <hu...@gmail.com>.
I think it only makes sense to use getLastAccessTime() when you have
already used setLastAccessTime() MANUALLY, otherwise hive does not
automatically set the access time in its metastore. Correct me if I am
wrong!

On Mon, Jul 2, 2012 at 4:46 AM, Stephen R. Scaffidi <
sscaffidi@tripadvisor.com> wrote:

> On 06/28/2012 09:28 AM, Stephen R. Scaffidi wrote:
>
>> I've written some code where I am trying to get the atime of my tables in
>> Hive. It's fairly simple - the method call in question is simply:
>>
>>   int atime = htable.getLastAccessTime();
>>
>> Where htable is an otherwise normal org.apache.hadoop.hive.**metastore.api.Table
>> object.
>>
>> The question is this: does hive or hadoop store the atime of the table in
>> some metadata or does it rely on the filesystem?
>>
>> I ask this because I am getting 0 as the value for every table in my
>> cluster, and have just realized that the filesystem is mounted with noatime!
>>
>> A secondary question is - if I can not get the atime using this API call,
>> is there another way to find out when a table was last accessed? How?
>>
>>
> Bump - should I be asking this on a different list?
>