CTAS with literal NULL creates VOID type ----------------------------------------
Key: HIVE-2615 URL: https://issues.apache.org/jira/browse/HIVE-2615 Project: Hive Issue Type: Bug Reporter: David Phillips Create the table with a column that always contains NULL: {quote} hive> create table bad as select 1 x, null z from dual; {quote} Because there's no type, Hive gives it the VOID type: {quote} hive> describe bad; OK x int z void {quote} This seems weird, because AFAIK, there is no normal way to create a column of type VOID. The problem is that the table can't be queried: {quote} hive> select * from bad; OK Failed with exception java.io.IOException:java.lang.RuntimeException: Internal error: no LazyObject for VOID {quote} Worse, even if you don't select that field, the query fails at runtime: {quote} hive> select x from bad; ... FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.MapRedTask {quote} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira