Hi, I've came across the same problem when developing jdbc for hive( https://issues.apache.org/jira/browse/HIVE-576). it had nothing to do with HiveServer and jdbc. I thought currently there is no good way solving it. SenmanticAnalyzer needs to get the result's type returned by udf/udaf for building the schema you mentioned. we should also consider the user defined type .
Regards, Min On Mon, Jun 29, 2009 at 1:53 AM, Prasad Chakka <[email protected]> wrote: > I think you need to try using HiveServer or a JDBC client. > > > ------------------------------ > *From: *David Lerman <[email protected]> > *Reply-To: *<[email protected]> > *Date: *Sun, 28 Jun 2009 09:07:22 -0700 > *To: *<[email protected]> > *Subject: *getting the field types of a query result > > > I'm trying to build a tool which runs a query and writes the results into > an > automatically generated Hive table. It's all very straightforward, except > that I can't find a good way to determine the type of the results in order > to create the table. For example, if someone runs "select intField, > stringField, sum(intField) from ...", I'd like to automatically create a > Hive table with an int column, a string column, and an int column and then > do a load into that table. Driver.getSchema looks promising but returns > strings for all three columns ("struct result { string intField, string > stringField, string _c2}"). Any suggestions? Thanks! > > > -- My research interests are distributed systems, parallel computing and bytecode based virtual machine. My profile: http://www.linkedin.com/in/coderplay My blog: http://coderplay.javaeye.com
