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

INSERT INTO with named field list and CBO=false fails

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.0.0
    • None
    • Query Planning
    • None

    Description

      Queries that insert into tables using a named field list fail when CBO is disabled.

      Here's an example to illustrate what I mean:

      INSERT INTO dd_insert_values_test(field1, field2) VALUES ('hive.cbo.enable=false', 'With named fields');

      Notice that it names the fields (field1, field2) into which the values should be inserted.

      With CBO disabled this query fails with error:

      – Error: Error while compiling statement: FAILED: SemanticException 0:0 Expected 2 columns for insclause-0/daved@dd_insert_values_test; select produces 1 columns. Error encountered near token ''With named fields'' (state=42000,code=40000)

      With CBO enabled it works.

      And without the named field list, it works with either CBO enabled or disabled. Please see the attached repro script: INSERT INTO with named field list and CBO=false bug.txt

      Attachments

        Activity

          People

            nisgoel Nishant Goel
            david.doran David Doran
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: