cancel
Showing results for 
Search instead for 
Did you mean: 
Machine Learning
cancel
Showing results for 
Search instead for 
Did you mean: 

Forum Posts

SRK
by Contributor III
  • 4793 Views
  • 6 replies
  • 3 kudos

How to apply Primary Key constraint in Delta Live Table?

In this blog I can see for dimension and fact tables, the primary key constraint has been applied. Following is the example:-- Store dimensionCREATE OR REPLACE TABLE dim_store( store_id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, business_key ...

  • 4793 Views
  • 6 replies
  • 3 kudos
Latest Reply
Oliver_Angelil
Valued Contributor II
  • 3 kudos

@SRK Please see a copy of this answer on stackoverflow here. You can use DLT Expectations to have this check (see my previous answer if you're using SQL and not Python):@dlt.table(name="table1",)def create_df():schema = T.StructType([T.StructField("i...

  • 3 kudos
5 More Replies
Labels