hive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sean Colgan <Sean.Col...@nasdaqomx.com>
Subject Automatic creation of Hive output table based on SELECT statement
Date Fri, 20 Dec 2013 23:01:17 GMT
Hi all,
I'm looking for a way to automatically generate an output table schema based on the input
and query.  Basically, a given input schema and SELECT statement produce a deterministic result
schema.  And Hive will complain if a given output table does not have a matching schema. 
Like so:

FAILED: SemanticException [Error 10044]: Line 3:23 Cannot insert into target table because
column number/types are different 'test_out': Table insclause-0 has 1 columns, but query has
3 columns.

I am developing a process that will accept input data with an arbitrary known schema, and
an HQL SELECT statement to query that data.  I'm looking for a way to automatically generate
the correct output table schema.  I'm starting to poke through the code in SemanticAnalyzer.java
(which generates the above error string) to see if I can use something in there.  But I certainly
welcome any thoughts or suggestions on this topic.

Thanks!
Sean

--

sean.colgan@nasdaqomx.com<mailto:sean.colgan@nasdaqomx.com>
www.nasdaqomx.com/finqloud<http://www.nasdaqomx.com/finqloud>

Mime
View raw message