newfront/hitchhikers_guide_to_deltalake_streaming

Fix Errata : lastModified on Delta table properties is last "metadata" modification not last Update to the table (add rows)

Opened this issue · 0 comments

https://github.com/newfront/hitchhikers_guide_to_deltalake_streaming/blob/main/hitchhikers_guide/notebooks/101-first-steps/101-dl-streaming.ipynb

Under:

Calculate Table Freshness: abs(current_time()-{table.lastModified}): To answer the universal question of - "How Fresh Is It?".

  • I was using the table.lastModified timestamp. While this works on a new table, you quickly come to realize that unless there are "modifications" to the structure of the table, or table properties, then the modification timestamp is not useful to calculate the freshness of a table.

  • instead you can use the dt.history() to gather the last operation that added or otherwise "effectively" modified the table.