Incremental
Examples of using Sling to incrementally load data from databases to files
source: postgres
target: aws_s3
# applies to all streams
defaults:
object: tables/{stream_schema}/{stream_table}/{part_year}/{part_month}
mode: incremental # mode applies to all streams
target_options: # target_options applies to all streams
format: parquet
streams:
# all tables in schema main
main.*:
primary_key: id
update_key: created_dt
target_options: # overwrites default target_options (write as csv)
format: csv
public.transactions:
primary_key: tx_id
update_key: created_dt
public.orders:
primary_key: order_id
update_key: timestamp
sql: |
select *
from public.orders
where status not in ('voided')
and {incremental_where_cond}
env:
# uses the `path/to/folder` in the same AWS_S3 connection
SLING_STATE: AWS_S3/path/to/folderLast updated
Was this helpful?