Repository navigation
feat(app): infer a materialized view's minimum date from when it was created - #3740
alex-fedotyev wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: eb4e092 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
E2E Test Results✅ All tests passed • 473 passed • 1 skipped • 1051s
Tests ran across 4 shards in parallel. |
Duplicate code analysisNo new duplicate code introduced by this PR. jscpd compared this branch against |
…created A materialized view only captures rows inserted after it exists. Without a minimum date the optimizer treats it as complete for any range, so charts over earlier ranges read a view that started empty and undercounted. Inferring the configuration in the source form now sets the minimum date to the first whole bucket after the view's creation time, so those ranges read the source table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1ca69b3 to
eb4e092
Compare
|
Closing this. Views can be backfilled, so the time a view was created doesn't say where its data starts. Minimum Date stays a manual setting, as it is today. |
Stack
Layer 5 of 5 in a GitHub stack (stack #3741). GitHub shows each layer's base as the branch below it, but the stack's base is
main: merging any PR lands it and every PR below it onmain, one squashed commit each. Each PR's diff is only its own layer, and CI runs as if each targetsmain:The layers are independent fixes to how charts read materialized views, ordered so the smallest land first. They prepare for a default trace rollup, which comes in a follow-up stack.
Summary
A materialized view only captures rows inserted after it's created. Without a minimum date, the optimizer treats a view as complete for any range, so a chart that starts before the view existed reads a view that started empty, and undercounts. Registering a view right after creating it, which is the usual flow, hits this every time.
When the source form infers a view's configuration, it now sets Minimum Date to the first whole bucket after the view was created (the view's
metadata_modification_timeinsystem.tables), so earlier ranges read the source table. The field stays editable: clear it if the view was backfilled.Test plan
tsc, lint and unit tests.Part of HDX-6120.