What's the best way to implement Daily Snapshot using Sling? #346
-
In Functional Data Engineering concept, daily snapshot is useful for providing a historical record for analysis and reporting. How can Sling's snapshot mode be optimally utilized to create daily snapshots that align with BigQuery's daily partitioning for efficient historical data analysis and reporting? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hey, while testing the following replication example below, I found lacking logic, which has been fixed here. source: postgres
target: bigquery
streams:
public.table:
object: public.test_snapshot
mode: snapshot
target_options:
table_keys:
partition: [date(_sling_loaded_at)]
env:
SLING_LOADED_AT_COLUMN: timestamp |
Beta Was this translation helpful? Give feedback.
-
You could also do this (should work with current version): source: postgres
target: bigquery
streams:
public.table:
sql: "select *, current_date as snapshot_date from {stream_name}"
object: public.test_snapshot
mode: snapshot
target_options:
table_keys:
partition: [snapshot_date] |
Beta Was this translation helpful? Give feedback.
-
Thank you for your suggestions. |
Beta Was this translation helpful? Give feedback.
You could also do this (should work with current version):