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

Add EventTimeFilter and BaseRelation.render_event_time_filtered #285

Merged
merged 10 commits into from
Sep 10, 2024

Conversation

MichelleArk
Copy link
Contributor

@MichelleArk MichelleArk commented Aug 22, 2024

Resolves: #294

  • Introduces the EventTimeFilter class, which contains properties necessary to render a where filter on a given event time field
  • BaseRelation has an optional EventTimeFilter attribute
  • BaseRelation.__str__ renders EventTimeFilter, if present to wrap the ref call in a select * from ... where event_time >= lower_bound and event_time < upper_bound
    • if limit also provided, resolve limit first before event-time filter to prioritize performance of input data scans

Postgres testing: https://github.com/dbt-labs/dbt-postgres/actions/runs/10775130606

@cla-bot cla-bot bot added the cla:yes label Aug 22, 2024
Copy link

Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the contributing guide.

@MichelleArk MichelleArk force-pushed the event-time-ref-filtering branch from 826d4c9 to ee51afc Compare September 5, 2024 19:54
@MichelleArk MichelleArk marked this pull request as ready for review September 9, 2024 14:23
@MichelleArk MichelleArk requested a review from a team as a code owner September 9, 2024 14:23
@colin-rogers-dbt colin-rogers-dbt enabled auto-merge (squash) September 9, 2024 21:22
dbt/adapters/base/relation.py Show resolved Hide resolved
@colin-rogers-dbt colin-rogers-dbt merged commit cffa724 into main Sep 10, 2024
15 checks passed
@colin-rogers-dbt colin-rogers-dbt deleted the event-time-ref-filtering branch September 10, 2024 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Accept and render EventTimeFilter in BaseRelation
3 participants