Open tmirko opened 1 year ago
Yes I did, when I comment out the is_incremental() function block Compiled dbt preview works as expected.
The issue what you see means that an exception has happened and the transaction is rolled back.
Could you figure out what queries are sent to the database and understand what caused the exception?
Data model runs successfully. In logs for this data model run I can see a few things being done, here are some notable ones that I would expect to see in the compiled dbt preview:
create global temporary table o$pt_stg_payments125228
on commit preserve rows
as
with payments as (
select
id as payment_id,
orderid as order_id,
paymentmethod as payment_method,
status,
-- amount is stored in cents, convert it to dollars
amount / 100 as amount,
created as created_at
from <source>.payment_src
where created > (select max(created_at) from <user>.stg_payments)
)
select * from payments;
merge into <user>.stg_payments target
using o$pt_stg_payments125228 temp
on (
temp.PAYMENT_ID = target.PAYMENT_ID
)
when matched then
update set
target.ORDER_ID = temp.ORDER_ID,
target.PAYMENT_METHOD = temp.PAYMENT_METHOD,
target.STATUS = temp.STATUS,
target.AMOUNT = temp.AMOUNT,
target.CREATED_AT = temp.CREATED_AT
when not matched then
insert(PAYMENT_ID, ORDER_ID, PAYMENT_METHOD, STATUS, AMOUNT, CREATED_AT)
values(
temp.PAYMENT_ID,
temp.ORDER_ID,
temp.PAYMENT_METHOD,
temp.STATUS,
temp.AMOUNT,
temp.CREATED_AT
)
I don't know how to check which queries are sent to the database when compiled dbt preview is executed.
I can confirm that the same behaviour is present in our environment with trino as the query engine.
Should is_incremental()
be recognised by dbt-power-user?
Can confirm same problem for us using snowflake - removing the {% if is_incremental() %}
block allows it to run just fine.
I can confirm the same issue. Does anyone have a solution for this already? :)
Expected behavior
Expected to see result of compiled dbt preview
Actual behavior
I get an error:
Steps To Reproduce
Run a Compiled dbt preview on a the dbt model:
Log output/Screenshots
No response
Operating System
Windows-10-10.0.19041-SP0
dbt version
1.3.0
dbt Adapter
dbt-oracle
dbt Power User version
v0.10.1
Are you willing to submit PR?