Hive
  1. Hive
  2. HIVE-2615

CTAS with literal NULL creates VOID type

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 0.6.0, 0.7.0, 0.8.0, 0.9.0, 0.10.0, 0.11.0
    • Fix Version/s: 0.12.0
    • Component/s: Query Processor
    • Labels:
      None

      Description

      Create the table with a column that always contains NULL:

      hive> create table bad as select 1 x, null z from dual;

      Because there's no type, Hive gives it the VOID type:

      hive> describe bad;
      OK
      x int
      z void

      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:

      hive> select * from bad;
      OK
      Failed with exception java.io.IOException:java.lang.RuntimeException: Internal error: no LazyObject for VOID

      Worse, even if you don't select that field, the query fails at runtime:

      hive> select x from bad;
      ...
      FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.MapRedTask

        Issue Links

          Activity

          No work has yet been logged on this issue.

            People

            • Assignee:
              Zhuoluo Yang
              Reporter:
              David Phillips
            • Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development