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

Allow configuring the format of EventTimeFilter #11376

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

logicoffee
Copy link

@logicoffee logicoffee commented Mar 8, 2025

Resolves #11331

Problem

Currently, EventTimeFilter is formatted as YYYY-MM-DD HH:MM:SS+00:00. However this format is not suitable for the following cases:

referencing tables where event_time isn't of type timestamp (especially in BigQuery).
For BigQuery, it's addressed by dbt-labs/dbt-bigquery#1422.
But casting event_time to timestamp causes a full scan.
When event_time is of type date, it's preferable to filter referenced tables using event_time > 'YYYY-MM-DD'
referencing sharded tables (especially in BigQuery).
Daily sharded tables are usually have a suffix like 'YYYYMMDD'.
It's better to filter referenced tables using _table_suffix > 'YYYY-MM-DD'.

Solution

Added format configuration to EventTimeFilter.
This PR depends on dbt-labs/dbt-adapters#893.

Checklist

  • I have read the contributing guide and understand what's expected of me.
  • I have run this code in development, and it appears to resolve the stated issue.
  • This PR includes tests, or tests are not required or relevant for this PR.
  • This PR has no interface changes (e.g., macros, CLI, logs, JSON artifacts, config files, adapter interface, etc.) or this PR has already received feedback and approval from Product or DX.
  • This PR includes type annotations for new and modified functions.

@cla-bot cla-bot bot added the cla:yes label Mar 8, 2025
@logicoffee logicoffee marked this pull request as ready for review March 8, 2025 11:12
@logicoffee logicoffee requested a review from a team as a code owner March 8, 2025 11:12
@github-actions github-actions bot added the community This PR is from a community member label Mar 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla:yes community This PR is from a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Microbatch: Customize event_time_start/event_time_end format for referenced table filtering
1 participant