thanks

在 2014年08月01日 12:00, Devopam Mittra 写道:
If you have mySQL as your metastore , you may use something similar to below:

SELECT tbl.TBL_NAME,COUNT(DISTINCT part.PART_NAME) AS partition_count
FROM metastore_db.TBLS tbl, metastore_db.PARTITIONS part
WHERE tbl.TBL_ID = part.TBL_ID
AND tbl.TBL_TYPE = 'MANAGED_TABLE'
GROUP BY tbl.TBL_NAME;

Do remember to change the db name to yours before testing it out :)
regards
Dev



On Thu, Jul 31, 2014 at 6:34 PM, Dan Fan <[email protected] <mailto:[email protected]>> wrote:

    The easiest way is to go to hive,
    Show create table table_name.
    Then you can know when the table, if the it is partitioned

    From: Nitin Pawar <[email protected]
    <mailto:[email protected]>>
    Reply-To: "[email protected] <mailto:[email protected]>"
    <[email protected] <mailto:[email protected]>>
    Date: Thursday, July 31, 2014 at 3:50 AM
    To: "[email protected] <mailto:[email protected]>"
    <[email protected] <mailto:[email protected]>>
    Subject: Re: How can I know one table is a partitioned table in hive?

    what are the options you have?
    can you write a java code which can interact with hcatalog ?
    or you can do a describle table and check for partion column
    details in there


    On Thu, Jul 31, 2014 at 1:11 PM, 张甲超 <[email protected]
    <mailto:[email protected]>> wrote:

        dear all,
                I want know that one table is a partitioned table in
        hive, and return the result to shell.
                How can I do?




-- Nitin Pawar




--
Devopam Mittra
Life and Relations are not binary

Reply via email to