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

INSERT ... SELECT with no source table leads to NPE

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 0.13.1
    • 1.2.0
    • Query Processor
    • None

    Description

      When no source table is provided for an INSERT statement Hive fails with NPE.

      0: jdbc:hive2://localhost:11050/default> create table test_tbl(i int);
      No rows affected (0.333 seconds)
      0: jdbc:hive2://localhost:11050/default> insert into table test_tbl select 1;
      Error: Error while compiling statement: FAILED: NullPointerException null (state=42000,code=40000)
      
      -- Get a NPE even when using incorrect syntax (no TABLE keyword)
      0: jdbc:hive2://localhost:11050/default> insert into test_tbl select 1;
      Error: Error while compiling statement: FAILED: NullPointerException null (state=42000,code=40000)
      
      -- Works when a source table is provided
      0: jdbc:hive2://localhost:11050/default> insert into table test_tbl select 1 from foo;
      No rows affected (5.751 seconds)
      

      Attachments

        1. HIVE-7641.1.patch.txt
          5 kB
          Navis Ryu
        2. HIVE-7641.2.patch.txt
          6 kB
          Navis Ryu
        3. HIVE-7641.3.patch.txt
          9 kB
          Navis Ryu
        4. HIVE-7641.4.patch.txt
          9 kB
          Navis Ryu

        Issue Links

          Activity

            People

              navis Navis Ryu
              lskuff Lenni Kuff
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: