Get Table Properties out of Hive using Java API

后端 未结 3 1102
别跟我提以往
别跟我提以往 2020-12-07 05:23

I\'m trying to get table properties like table db, name, owner, and hdfs location out of the hive metastore using the metastore client in java. I think I can get the table d

3条回答
  •  盖世英雄少女心
    2020-12-07 06:18

    Could be something like that:

    org.apache.hadoop.hive.metastore.api.Table table=..........;
    org.apache.hadoop.hive.metastore.api.StorageDescriptor sd=table.getSd();
    String loc=sd.getLocation();
    String own=sd.getOwner();
    

    https://hive.apache.org/javadocs/r1.2.2/api/org/apache/hadoop/hive/metastore/api/Table.html https://hive.apache.org/javadocs/r1.2.2/api/org/apache/hadoop/hive/metastore/api/StorageDescriptor.html

提交回复
热议问题