Details
Description
Hi,
When performing a INSERT INTO with a defined incomplete column list, the missing columns should get a NULL value. However, an error is thrown indicating that the column is missing.
Case simulation:
drop table if exists default.TVTest;
create table default.TVTest
( col1 int NOT NULL
, col2 int
);
insert into default.TVTest select 1,2;
insert into default.TVTest select 2,NULL; --> col2 can contain NULL values
insert into default.TVTest (col1) select 3; – Error in SQL statement: DeltaAnalysisException: Column col2 is not specified in INSERT
insert into default.TVTest (col1) VALUES (3); – Error in SQL statement: DeltaAnalysisException: Column col2 is not specified in INSERT
select * from default.TVTest;
Attachments
Issue Links
- duplicates
-
SPARK-42521 Add NULL values for INSERT commands with user-specified lists of fewer columns than the target table
- Resolved