Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Use of additional filters for limiting the data in stage macros #205

Open
yedu1985 opened this issue Aug 17, 2023 · 1 comment
Assignees
Labels
feature This is is requesting a new feature

Comments

@yedu1985
Copy link

yedu1985 commented Aug 17, 2023

Is your feature request related to a problem? Please describe.

Pulling the incremental data from the PSA area by comparing the Last_record_load_date/Specific date by applying the filter in the stage macro

Describe the solution you'd like
A clear and concise description of what you want to happen.

where
true {# minimize data usage for sandbox/cicd #}
{% if not target.name in ['dev', 'uat', 'prod'] or env_var(
'DBT_CICD_RUN',
'false'
) == 'true' %}
and date(updated_on) >= date_sub(current_date(), interval 1 month)
{% endif %}

{% if is_incremental() %}
    {# Note:

THE updated_on that used for incremental loading
),

    and date(updated_on) >= coalesce(
        (
            select date(max(updated_on))
            from {{ this }}
            where rsrc not in ('ERROR', 'SYSTEM')
        ),
        '1900-01-01'
    )
{% endif %}

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

AB#5358

@yedu1985 yedu1985 added the feature This is is requesting a new feature label Aug 17, 2023
@DVAlexHiggs
Copy link
Member

DVAlexHiggs commented Aug 17, 2023

Hi @yedu1985 Thanks for this. We're actually currently working on new loading features, this being one of them. v0.10.x releases are bringing Quality of life improvements for loading, the first of which was solving the long-standing limitation on Satellite loading.

In the meantime I recommend you look at incremental predicates, a dbt feature that already exists to do just this!

@DVAlexHiggs DVAlexHiggs added feature This is is requesting a new feature and removed feature This is is requesting a new feature labels May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This is is requesting a new feature
Projects
None yet
Development

No branches or pull requests

2 participants