Thanks for the prompt replies. I have gone through the code. But i am unable to understand how can I integrate my own class and compile the code in a jar to be executed later. I am undergraduate and have not worked on such big project.
Some hints will be very helpful. thanks again for the replies. regards, Abhinav Narain On Thu, Jan 20, 2011 at 1:02 PM, Carl Steinbach <c...@cloudera.com> wrote: > Hi Abhinav, > > 1. > > How does one have access to metastore of Hive, to retrieve the schema > > information from it. > > I cant find a file or other such thing in source code. > > > > Take a look at the IMetaStoreClient interface and HiveMetaStoreClient > class, > but bear in mind that the fundamental definition of the MetaStore interface > is contained in the Thrift IDL file located > here: metastore/if/hive_metastore.thrift. IMetaStoreClient actually defines > a wrapper interface around the code generated by the Thrift compiler based > on the definitions in hive_metastore.thrift > > You can also find some good code examples in TestHiveMetaStore. > > > > 2. > > How does one get the handle of the result that is produced after the > query. > > > > If someone can tell about where to look for the answers, that will also > > help > > > > Here are the relevant pieces of code that you should look at: > > service/if/hive_service.thrift > service/src/java/org/apache/hadoop/hive/service/HiveServer.java > service/src/test/org/apache/hadoop/hive/service/TestHiveServer.java > > The interface for executing queries and fetching results is defined in > hive_service.thrift and consists of the following methods: > > void execute(string query) > string fetchOne() > list<string> fetchN(i32 numRows) > list<string> fetchAll() > > Since execute() does not return a query ID the Thrift client is limited to > executing/fetching the results of a single query at a time. > > Hope this helps. > > Carl >