LaurentLeturgez
Databricks Employee
Databricks Employee

Hi @Kory Skistad​ 

Please find below the table schema definition to use in a python dlt pipeline. You can see it mentions the identity column definition.

@dlt.table(

comment="Raw data on sales",

schema="""

customer_id STRING,

customer_name STRING,

number_of_line_items STRING,

order_datetime STRING,

order_number LONG,

order_day_of_week STRING GENERATED ALWAYS AS (dayofweek(order_datetime))

""",

partition_cols = ["order_day_of_week"])

def sales():

return ("...")

This example has been taken from this page: https://docs.databricks.com/workflows/delta-live-tables/delta-live-tables-python-ref.html

By the way, be careful about how it is generated regarding you are dealing with a streaming table or not: https://docs.databricks.com/workflows/delta-live-tables/delta-live-tables-faqs-issues.html#how-do-i-...

HTH

Laurent

View solution in original post