I'm trying to do an insert into a table using only specified columns as described here:
https://spark.apache.org/docs/3.1.2/sql-ref-syntax-dml-insert-into.html
If I run the queries below, I get the error shown below. What do I need to do to get this to work?
Code:
create table foo as (
select
'foo' as col1,
'bar' as col2
);
insert into foo (col1) values('col1_val');
Error Message:
Error in SQL statement: DeltaAnalysisException: Column col2 is not specified in INSERT