Skip to content

Instantly share code, notes, and snippets.

@mshakhomirov
Created November 24, 2022 15:26
Show Gist options
  • Save mshakhomirov/35d956fa9db86b12b44ab62c00f42a40 to your computer and use it in GitHub Desktop.
Save mshakhomirov/35d956fa9db86b12b44ab62c00f42a40 to your computer and use it in GitHub Desktop.
select
target_id
,product_id
,product_type_id
,production.purchase_summary_udf()(
ARRAY_AGG(
STRUCT(
target_id
, user_id
, product_type_id
, product_id
, item_count
, days
, expire_time_after_purchase
, transaction_id
, purchase_created_at
, updated_at
)
order by purchase_created_at
)
) AS processed
from new_batch
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment