cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

How to check/list the tables which has CDF enabled?

Databrickguy
New Contributor II

How to list all the tables which has CDF enabled?

I can review a table to find out if CDF is enable with below code.

SHOW TBLPROPERTIES tableA(delta.enableChangeDataFeed)

The return

 
key                                                                    value
delta.enableChangeDataFeed                       true

Also, below code can list all the tables in databaseA

spark.catalog.listTables("databaseA")

How can I combine both to list all the tables which has delta.enableChangeDataFeed=== true?

2 REPLIES 2

Hubert-Dudek
Esteemed Contributor III

Just wrap it in Python code, add .collect() in the end of listTables and apply for each

jose_gonzalez
Moderator
Moderator

Hhi @Tim zhang​,

Just a friendly follow-up. Did any of the responses help you to resolve your question? if it did, please mark it as best. Otherwise, please let us know if you still need help.

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.