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:ย 

How to define DLT table with cyclic reference

hadoan
New Contributor

 

@Dlt.table
def table_A():
  return (
   dlt.read_stream(...)
  )

@dlt.table
def table_join_A_and_C():
  df_A = dlt.read_stream(table_A)
  df_C = dlt.read_stream(table_C)
  return (
   ....df_A.join(df_C)
  )

@dlt.table
def table_C():
  return (
   dlt.read_stream(table_join_A_and_C).....

  )

 

I got an error when defining DLT like above. Does DLT support cyclic reference?

Thanks in advance.

 

 

1 REPLY 1

Kaniz_Fatma
Community Manager
Community Manager

Hi @hadoanIt appears that youโ€™re encountering a cyclic reference issue when defining DLT tables. Unfortunately, DLT does not directly support cyclic references. However, you can work around this limitation by restructuring your code. One approach is to break the circular dependency by creating intermediate tables or using alternative logic. 

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!