Title: feat(bigquery): Support DATE-type event timestamp columns by Jwrede · Pull Request #6362 · feast-dev/feast · GitHub
Open Graph Title: feat(bigquery): Support DATE-type event timestamp columns by Jwrede · Pull Request #6362 · feast-dev/feast
X Title: feat(bigquery): Support DATE-type event timestamp columns by Jwrede · Pull Request #6362 · feast-dev/feast
Description: What this PR does / why we need it: When the event_timestamp column in BigQuery is a DATE type (not TIMESTAMP), the generated SQL wraps comparison values in TIMESTAMP(), causing a type mismatch error. This makes DATE-partitioned summary tables unusable without creating views or duplicate tables. This PR adds an optional timestamp_field_type parameter to BigQuerySource. When set to "DATE", SQL generation uses DATE('YYYY-MM-DD') comparisons instead of TIMESTAMP('...'), both in direct queries (pull_latest_from_table_or_query, pull_all_from_table_or_query) and in the point-in-time join Jinja template. Usage: BigQuerySource( table="project:dataset.daily_features", timestamp_field="event_date", timestamp_field_type="DATE", ) Changes: Proto: add timestamp_field_type string field (field 28) to DataSource DataSource base class: add timestamp_field_type attribute, equality check, and __init__ parameter BigQuerySource: wire timestamp_field_type through __init__, from_proto, and _to_proto_impl get_timestamp_filter_sql(): add "date_func" cast style that generates DATE('YYYY-MM-DD') BigQueryOfflineStore: select cast style based on timestamp_field_type Jinja template: conditional DATE() comparisons for DATE-type timestamp fields FeatureViewQueryContext: propagate timestamp_field_type to template context Backward-compatible: when timestamp_field_type is unset, behavior is unchanged. Which issue(s) this PR fixes: Fixes #2530 (part 2 -- DATE type event_timestamp support; part 1 was addressed by #6076) How to test: python -m pytest sdk/python/tests/unit/infra/offline_stores/test_bigquery.py -v 4 new tests added: test_pull_latest_date_type_timestamp_field -- verifies DATE() cast in pull_latest test_pull_all_date_type_timestamp_field -- verifies DATE() cast in pull_all test_pull_latest_date_type_with_partition_column -- DATE type combined with partition pruning test_bigquery_source_date_type_proto_roundtrip -- proto serialization roundtrip
Open Graph Description: What this PR does / why we need it: When the event_timestamp column in BigQuery is a DATE type (not TIMESTAMP), the generated SQL wraps comparison values in TIMESTAMP(), causing a type mismatch err...
X Description: What this PR does / why we need it: When the event_timestamp column in BigQuery is a DATE type (not TIMESTAMP), the generated SQL wraps comparison values in TIMESTAMP(), causing a type mismatch err...
Opengraph URL: https://github.com/feast-dev/feast/pull/6362
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:9c39f159-2389-832d-0b12-185539462237 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C14E:CA906:F03B2:15C07C:6A4E256D |
| html-safe-nonce | c13ec814a64396ea23146030f2ea1a49efcd4aa4d8d0f4c00fa8aaafb44974e9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMTRFOkNBOTA2OkYwM0IyOjE1QzA3Qzo2QTRFMjU2RCIsInZpc2l0b3JfaWQiOiI3MjUyMTQ1MzM1ODQwOTQxNDIxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b6dc3414ad5166add322ee0f230faf7b6686a36628f71db8931dcc6d4eda6242 |
| hovercard-subject-tag | pull_request:3619670750 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/feast-dev/feast/pull/6362/files |
| twitter:image | https://avatars.githubusercontent.com/u/62910358?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/62910358?s=400&v=4 |
| og:image:alt | What this PR does / why we need it: When the event_timestamp column in BigQuery is a DATE type (not TIMESTAMP), the generated SQL wraps comparison values in TIMESTAMP(), causing a type mismatch err... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 030096ee0db095447bfe77409d33bfac127ca7128299c58deef27c52eaa1b1f0 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/feast-dev/feast git https://github.com/feast-dev/feast.git |
| octolytics-dimension-user_id | 57027613 |
| octolytics-dimension-user_login | feast-dev |
| octolytics-dimension-repository_id | 161133770 |
| octolytics-dimension-repository_nwo | feast-dev/feast |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 161133770 |
| octolytics-dimension-repository_network_root_nwo | feast-dev/feast |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d9dd20d38f8ae3c4cb6b597807431db300d0bd2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width