Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-2615

CTAS with literal NULL creates VOID type

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 0.6.0, 0.7.0, 0.8.0, 0.9.0, 0.10.0, 0.11.0
    • 0.12.0
    • Query Processor
    • 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

      Attachments

        1. HIVE-2615.1.patch
          2 kB
          Zhuoluo Yang

        Issue Links

          Activity

            People

              clarkyzl Zhuoluo Yang
              electrum David Phillips
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: