You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having trouble executing models with materialzed=incremental in dbt with glue spark. Incremental condition is not adding to sql query in is_incremental block.
Profile:
aws_demo_proj:
target: aws_devoutputs:
aws_dev:
type: gluequery-comment: This is a glue dbt examplerole_arn: arn:aws:iam::xxxxxxxx:role/dbt-demo-roleregion: eu-central-1workers: 5worker_type: G.2Xschema: "det"database: "det_landing_data_platform"session_provisioning_timeout_in_seconds: 120location: "s3a://det-landing-data-lake"idle_timeout: 120
Incremental Model Config and SQL:
{{ config(
materialized='incremental',
custom_location='s3a://det-published-data-lake/booking-solutions/fulfilment_view_data',
incremental_strategy='insert_overwrite',
schema='published_booking_solutions',
file_format='parquet',
partition_by=['business_date']
) }}
SELECT new_process_id, booking_source,
((booked_restored_gross_price_hotel - new_restored_gross_price_hotel) * new_restored_gross_price_customer / new_restored_gross_price_hotel) as savings,
(booked_restored_gross_price_hotel * new_restored_gross_price_customer / new_restored_gross_price_hotel) as booked_restored_gross_price_customer,
new_restored_gross_price_customer,
booked_price_rate_type,
init_booking_multisourced,
rebooking_multisourced,
initial_crs_type,
DATE(concat_ws('-', year, month, day)) as business_date
FROMprod_landing_booking_solutions.fulfilment_viewWHERE-- REQUIRED TO OMIT DIVISION BY ZERO value of new_restored_gross_price_hotel
new_restored_gross_price_hotel >0AND new_process_id IS NOT NULLAND booked_restored_gross_price_hotel > new_restored_gross_price_hotel
{% if is_incremental() %}
andDATE(concat_ws('-', year,month, day)) >= (selectmax(business_date) from {{this}} )
{% endif %}
Steps To Reproduce
Rerun the dbt model and check the query generated.
Expected behavior
Incremental conditions need to be added to the SQL query from the next of table creation.
#45
Hello team,
I have tried to debug the issue and found that is_incremental macro is get the table relation from impl.py as list instead of dict type/object type.
I have created a fix for it and available in PR 45
Describe the bug
I'm having trouble executing models with materialzed=incremental in dbt with glue spark. Incremental condition is not adding to sql query in is_incremental block.
Profile:
Incremental Model Config and SQL:
Steps To Reproduce
Rerun the dbt model and check the query generated.
Expected behavior
Incremental conditions need to be added to the SQL query from the next of table creation.
Screenshots and log output
incremental_first_load.log
incremental_second_load.log
System information
The output of
dbt --version
:The operating system you're using: Mac Os
The output of
python --version
:Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: