You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Something Something <ma...@gmail.com> on 2014/07/22 09:51:59 UTC

Get 'TBLPROPERTIES' of a Hive table in Java

I am writing a custom InputFormat class in which I need to get the
'TBLPROPETIES' of a Hive Table. This InputFormat will extend the
HiveInputFormat.

I thought the table properties will be available to me in the 'JobConf',
but they are not there.

What's the best way to get TBLPROPERTIES of a Hive table in a Java class
such as InputFormat?

Would greatly appreciate any help.  Thanks.

Re: Get 'TBLPROPERTIES' of a Hive table in Java

Posted by "Tuong Tr." <ir...@yahoo.com>.
Hi,

You should be able to find what you need to do in the getSchema() method inside  hive/ql/src/java/org/apache/hadoop/hive/ql/io/avro/AvroGenericRecordReader.java.

The table properties does not get copied into the jobconf in M/R job's passedin jobconf.  so there is some complex logic to track it down.

Good luck,
Tuong 


On Tuesday, July 22, 2014 12:52 AM, Something Something <ma...@gmail.com> wrote:
  


I am writing a custom InputFormat class in which I need to 
get the 'TBLPROPETIES' of a Hive Table.  This InputFormat will extend 
the HiveInputFormat. 
I thought the table properties will be available to me in the 'JobConf', but they are not there. 
What's the best way to get TBLPROPERTIES of a Hive table in a Java class such as InputFormat? 
Would greatly appreciate any help.  Thanks.