David Doran created HIVE-22991:
----------------------------------
Summary: INSERT INTO with named field list and CBO=false fails
Key: HIVE-22991
URL: https://issues.apache.org/jira/browse/HIVE-22991
Project: Hive
Issue Type: Bug
Components: Query Planning
Affects Versions: 3.0.0
Reporter: David Doran
Attachments: INSERT INTO with named field list and CBO=false bug.txt
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]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)