Running DBR 11.3 / Azure Databricks
Table definition below:
%sql
CREATE OR REPLACE TABLE demo2 (
id BIGINT GENERATED BY DEFAULT AS IDENTITY,
product_type STRING,
sales BIGINT
)
USING DELTA
LOCATION '/folderlocation/'
TBLPROPERTIES (
'delta.columnMapping.mode' = 'name',
'delta.minReaderVersion' = '2',
'delta.minWriterVersion' = '5')
Inserting 1 row works fine
%sql
INSERT INTO demo2 (product_type, sales)
VALUES ("cell", 130000);
On attempting to insert a new row I get this error:
"AnalysisException: Column id is not specified in INSERT"
I can insert columns explicitly as follows:
%sql
INSERT INTO demo2 (id,product_type, sales)
VALUES (3,"batt", 130000);
I can even insert duplicate column values like so
I have tried changing the identity definition to "GENERATED ALWAYS AS IDENTITY" however get the same result. Am I doing this incorrectly or missing something?