haleemur_ali
09/11/2024, 9:49 PMorder_items
table from snowflake.
the order_items
has a relationship to the orders
table, but does not have an updated_at
column (which exists on the orders
table).
I'm not sure if there is any existing meltano tooling to handle this, something that would use a query such as below to extract data
select oi.*, o.updated_at
from order_items oi
join orders o on o.order_id = oi.order_id
-- filter for incremental ingestion
where
o.updated_at > {last-updated-at}
and in the target, I would have to implement some more machinery to handle cases where an order_item is deleted
something like an incremental delete+insert approach to merge from stg:
delete from order_items where order_id in (select distinct order_id from stg_order_items);
insert into order_items select * from stg_order_items;
haleemur_ali
09/11/2024, 10:35 PMCharles Feduke
09/11/2024, 11:22 PMorder_items
table have an autoincrementing integer field? If so you can use that instead of relying on timestamps to bookmark state.haleemur_ali
09/11/2024, 11:29 PMCharles Feduke
09/12/2024, 12:17 AM