Sha256: f6499a49bdef92c6a968d58c53e90e9f9fb2e266a3fc601e6a983ff5bee5a56a
Contents?: true
Size: 1.38 KB
Versions: 9
Compression:
Stored size: 1.38 KB
Contents
{ "sql": { "_producer": "https://github.com/OpenLineage/OpenLineage/tree/0.0.1/integration/dbt", "_schemaURL": "https://openlineage.io/spec/facets/1-0-0/SQLJobFacet.json", "query": "\n\nwith orders as (\n\n select * from \"postgres\".\"public\".\"stg_orders\"\n\n),\n\npayments as (\n\n select * from \"postgres\".\"public\".\"stg_payments\"\n\n),\n\norder_payments as (\n\n select\n order_id,\n\n sum(case when payment_method = 'credit_card' then amount else 0 end) as credit_card_amount,\n sum(case when payment_method = 'coupon' then amount else 0 end) as coupon_amount,\n sum(case when payment_method = 'bank_transfer' then amount else 0 end) as bank_transfer_amount,\n sum(case when payment_method = 'gift_card' then amount else 0 end) as gift_card_amount,\n sum(amount) as total_amount\n\n from payments\n\n group by order_id\n\n),\n\nfinal as (\n\n select\n orders.order_id,\n orders.customer_id,\n orders.order_date,\n orders.status,\n\n order_payments.credit_card_amount,\n\n order_payments.coupon_amount,\n\n order_payments.bank_transfer_amount,\n\n order_payments.gift_card_amount,\n\n order_payments.total_amount as amount\n\n from orders\n\n\n left join order_payments\n on orders.order_id = order_payments.order_id\n\n)\n\nselect * from final" } }
Version data entries
9 entries across 9 versions & 4 rubygems