Can a not null constraint be applied on a identity column

harish446
New Contributor

I had a table creation script as follows for example:

 CREATE TABLE default.test2
          (  id BIGINT GENERATED BY DEFAULT AS IDENTITY(),
                name  String)
using delta
location "/mnt/datalake/xxxx"
 
 
What are the possible ways to apply not null constraint on the existing delta table on id column
 

Krishnamatta
Contributor

Hi Harish,

Here is the documentation for this issue

https://docs.databricks.com/en/tables/constraints.html