cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

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
 
1 REPLY 1

Krishnamatta
New Contributor III

Hi Harish,

Here is the documentation for this issue

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

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group