Hive uses thrift in two places 1) HiveServer 2)Metastore . Search in the metastore directory for the thrift interface file and compile that.
Then you should get a class generated for hive_metastore.Schema Edward On Tue, May 29, 2012 at 11:46 AM, Stephen Sprague <sprag...@gmail.com> wrote: > Hi Good People, > I am totally stumped on this one. Wondered if a "perl" bindings chap on > this list might be able to help me. > > I generated the ThrftHive.pm class as follows (see below) from my download > area. I've tested some basic examples of querying - and it works well. > The one thing that i can't get to work, though, is a call to > "$client->getSchema()" in order to ascertain the schema of a result set. > > * this built ThriftHIve.pm > > $ thrift -r \ > -I $HOME/downloads/hive-0.9.0/src/ql \ > -I $HOME/downloads/hive-0.9.0/src \ > -I $HOME/downloads/thrift-0.8.0 \ > \ > -gen perl \ > \ > $HOME/downloads/hive-0.9.0/src/service/if/hive_service.thrift > > > > > * in hive_service.thrift here are the relevant lines (that i can tell) > > #the includes > include "contrib/fb303/if/fb303.thrift" > include "metastore/if/hive_metastore.thrift" > include "ql/if/queryplan.thrift" > namespace java org.apache.hadoop.hive.service > namespace cpp Apache.Hadoop.Hive > > <snip> > #the getSchema() reference > service ThriftHive extends hive_metastore.ThriftHiveMetastore { > <snip> > # Get a schema object with fields represented with native Hive types > hive_metastore.Schema getSchema() throws(1:HiveServerException ex) > > > * the relevant line in ThriftHive.pm that throws an undefined method call: > > Undefined subroutine &ThriftHive_getSchema_result::Schema called at > /home/spragues/downloads/thrift-0.8.0/gen-perl/ThriftHive.pm line 672. > > $self->{success} = new Schema(); > $xfer += $self->{success}->read($input); > > > Where 'o where is this "Schema" class supposed to be? Any pointers, clues, > suggestions, bread crumbs most welcome! > > Thanks > Stephen