hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From demian rosas <demia...@gmail.com>
Subject Re: Is there any API that tells me what files comprise a hive table?
Date Mon, 07 Oct 2013 19:16:22 GMT
Hi Sanjay,

Thanks a lot for this. I am precisely looking at the available information
in the hive metastore db. This is going to be of great help.

Cheers.


On 7 October 2013 12:04, Sanjay Subramanian <
Sanjay.Subramanian@wizecommerce.com> wrote:

>   Perhaps a good thing to have in your Hive cheat sheet :-) '
> I use the following mySQL query to find out the locations of the Hive table
>
>  echo "select t.TBL_NAME, p.PART_NAME, s.LOCATION from PARTITIONS p, SDS
> s, TBLS t where t.TBL_ID=p.TBL_ID and p.SD_ID=s.SD_ID "| mysql -u*
> <hive_user>* -p*<password>* *<hive_metastore_table>* -A | grep "*
> <your_hive_table_name>*"
>
>
>
>   Thanks
> Regards
>
>  sanjay
>
>   email : sanjay.subramanian@wizecommerce.com
>    Irc : sanjaysub (channel #noc)
>  skype : sanjaysubramanian
> mobile : (925) 399 2692
>
>   From: Edward Capriolo <edlinuxguru@gmail.com>
> Reply-To: "user@hive.apache.org" <user@hive.apache.org>
> Date: Monday, October 7, 2013 11:52 AM
> To: "user@hive.apache.org" <user@hive.apache.org>
> Subject: Re: Is there any API that tells me what files comprise a hive
> table?
>
>   Not a direct API.
>
> What I do is this. From java/thrift:
> Table t = client.getTable("name_of_table");
>  Path p = new Path(t.getSd.getLocation());
> FileSystem fs = FileSystem.get(conf);
> List<FileStatus> f = fs.listFiles(p)
> /// your logic here.
>
>
>
>
> On Mon, Oct 7, 2013 at 2:01 PM, demian rosas <demianrh@gmail.com> wrote:
>
>> Hi all,
>>
>>  I want to track the changes made to the files of a Hive table.
>>
>>  I wounder whether there is any API that I can use to find out the
>> following:
>>
>>  1. What files in hdfs constitute a hive table.
>> 2. What is the size of each of these files.
>> 3. The time stamp of the creation/last update to each of these files.
>>
>>
>> Also in a wider view, is there any API that can do the above mentioned
>> for HDFS files in general (not only hive specific)?
>>
>>  Thanks a lot in advance.
>>
>>  Cheers.
>>
>>
>>
>
> CONFIDENTIALITY NOTICE
> ======================
> This email message and any attachments are for the exclusive use of the
> intended recipient(s) and may contain confidential and privileged
> information. Any unauthorized review, use, disclosure or distribution is
> prohibited. If you are not the intended recipient, please contact the
> sender by reply email and destroy all copies of the original message along
> with any attachments, from your computer system. If you are the intended
> recipient, please be advised that the content of this message is subject to
> access, review and disclosure by the sender's Email System Administrator.
>

Mime
View raw message