adding indexed created_at column to lineage events table#2299
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2299 +/- ##
=========================================
Coverage 77.01% 77.01%
Complexity 1166 1166
=========================================
Files 222 222
Lines 5307 5307
Branches 424 424
=========================================
Hits 4087 4087
Misses 747 747
Partials 473 473 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
c495a52 to
5d3185c
Compare
|
@prachim-collab, having a timestamp for when an OL event was received on the server is going to be very helpful. Mind also opening an issues to link to your PR about the timestamp usage and any changes to relevant APIs? |
@wslulciuc I have created this new issue #2304 |
6c15266 to
4897ff1
Compare
| @@ -0,0 +1,9 @@ | |||
| ALTER TABLE lineage_events ADD created_at TIMESTAMP; | |||
There was a problem hiding this comment.
TIMESTAMP WITH TIME ZONE. I think it's good practice to just always include the time zone in the timestamp.
There was a problem hiding this comment.
Thanks, i kept it as TIMESTAMP following other created_at columns in the schema. But i will update this one to TIMESTAMP WITH TIME ZONE.
Additionally , i was before backfilling old entries with event_time. I have removed that step now because it might be a costly operation during migration.
There was a problem hiding this comment.
updated the type to TIMESTAMP WITH TIME ZONE
Signed-off-by: Prachi Mishra <prachi.mishra@astronomer.io>
Signed-off-by: Prachi Mishra <prachi.mishra@astronomer.io>
Signed-off-by: Prachi Mishra <prachi.mishra@astronomer.io>
Signed-off-by: Prachi Mishra <prachi.mishra@astronomer.io>
Signed-off-by: Prachi Mishra <prachi.mishra@astronomer.io>
53b5cf7 to
dc70917
Compare
* adding indexed created_at column to lineage events table Signed-off-by: Prachi Mishra <prachi.mishra@astronomer.io> * populate default values in lineage_events.created_at column Signed-off-by: Prachi Mishra <prachi.mishra@astronomer.io> * removing backfill step Signed-off-by: Prachi Mishra <prachi.mishra@astronomer.io> * altering type to TIMESTAMP WITH TIME ZONE Signed-off-by: Prachi Mishra <prachi.mishra@astronomer.io> * adding NULLS LAST in desc index on lineage_events.created_at Signed-off-by: Prachi Mishra <prachi.mishra@astronomer.io> Signed-off-by: Prachi Mishra <prachi.mishra@astronomer.io>
Problem
For analytics use case we need to incrementally copy and export lineage_events to DWH. For this use case there is no good way to identify incrementally created events in database. The current event_time in lineage_events table is client generated and can be back dated.
Closes: #2300
Solution
Checklist
I have tested by deploying the changes in my local database and migration script ran successfully on top of existing schema.
CHANGELOG.mdwith details about your change under the "Unreleased" section (if relevant, depending on the change, this may not be necessary).sqldatabase schema migration according to Flyway's naming convention (if relevant)