Louis_Frolio
Databricks Employee
Databricks Employee

Greetings @gerard_gv , there isn’t currently a direct SQL equivalent to the readChangeFeed option. This option is only supported in streaming through the Python and Scala DataFrame APIs.

As a workaround, take a look at the table_changes SQL function. For example:

 

-- Read changes between specific versions

SELECT * FROM table_changes('table_name', 5, 10);

 

-- Read changes starting from a timestamp

SELECT * FROM table_changes('table_name', '2023-01-01T00:00:00.000Z');

It is not exactly what you are looking for but it may be a viable work around.

I hope this helps, Louis.

View solution in original post