Repository navigation
fix: preserve prepared temporal result types and values - #30224
mergify[bot] merged 2 commits into
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Preserve calendar precision and result ABI; retain CTAS execution requirements through folding, view expansion, serialization and rollback.
0c2e415 to
ef416ed
Compare
|
mo-bot review · Commit: Review completed. Read the assessment. |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-xupeng · review
Commit: ef416ed211fcda8f0e8838f66fd7289da61bf8d8
Assessment: approve
Reviewed the complete 41-file delta, callers, ownership, compatibility, failure paths and test quality. The prior TIMESTAMP ABI concern is addressed by appended overloads and protocol-122 admission. No actionable findings remain.
Model: gpt-6-astra / xhigh
Session: 01a14d34-4e51-79a3-a62d-6c9c16279dc8 · slot 0 · generation 0
Validation:
-
108 top-level tests passed: 57 protobuf-plan tests, 24 focused temporal/planner/compile tests, and 27 adjacent temporal and optimizer controls. All used the supplied isolated executor.
-
Test logs and exact-head exit-zero receipts are reconciled in /home/xupeng/.local/state/mo-bot/jobs/52bb0c0d3230c99a387d7a0d/attempt-1/validation-audit.json.
-
Recovered native prerequisites through repository make cgo using 192 matching inputs; retained input and artifact hashes. The initial prerequisite failure occurred before test compilation.
-
Descriptor audit confirmed only additive CreateTable field 19. Patch contents, whitespace checks and unchanged source status were verified.
-
Frozen exact-head CI metadata reports successful build, UT, SCA, coverage and BVT checks.
Limitations:
-
No local SQL BVT, live mixed-binary cluster or throughput benchmark was run.
-
CI statuses and author reports were distinguished from independently verified local execution; author raw logs were not supplied.
-
Linked issue bodies were not bundled; their stated contracts were assessed through the supplied PR text, comments and regression tests.
Merge Queue Status
This pull request spent 1 hour 46 minutes 44 seconds in the queue, including 57 minutes 14 seconds running CI. Required conditions to merge
|
What type of PR is this?
Which issue(s) this PR fixes:
Please leave these issues open for reporter verification after merge.
What this PR does / why we need it:
Prepared temporal expressions could expose string result types, discard time-of-day before CTAS materialization, or select an executor with an incompatible TIME result vector. Unary TIMESTAMP also lost fractional precision and introduced timezone-dependent materialization.
Preserve direct parameter provenance and consume calendar operands before provisional casts truncate them. DATE_ADD/DATE_SUB use the original interval unit for DATE versus DATETIME(6); TIMESTAMPADD preserves full calendar inputs. Unary TIMESTAMP binds to appended DATETIME overloads 6–10, while released overloads 0–4 retain their original execution ABI and pair overload 5 stays unchanged. Dynamic ADDTIME/SUBTIME compute calendar arithmetic before extracting TIME(6), preserving genuine durations over 24 hours and explicit SQL casts. The FROM_UNIXTIME reproduction already passes on base; retain source-type and reuse regressions without an unnecessary kernel change.
MORPC 122 protects the changed result contracts after released main epochs 114–121. Reuse existing expression classification, worker placement, actual-destination validation, receiver/persisted gates and execution-stream handshake. Cached Compile/Run rejects capability rollback before effects. Borrowed CREATE plans are checked before name refresh and after rebuilding.
Ordinary CTAS releases its bound query, so retain an execution-only protocol scalar before folding/query release, including nested and stored-view binding scopes. Prepared CTAS retains its authoritative query and leaves the scalar zero. The scalar survives protobuf/clone operations and is cleared with population SQL/query from temporary schema-only plans. It is not a catalog storage floor. This adds bounded planning observation and an O(1) execution check, with no per-row work, new handshake, cache or parallel execution path.
Prior validation on head 70093d9 includes focused planner tests plus normal/race owning-package tests, incremental SCA across eight affected/consumer packages, repeated canonical protobuf generation, and the actual public prepared-temporal SQL suite with golden-result comparison (130 statements). Controls include precision, NULL/masks, invalid/overflow inputs, native TIME durations, explicit casts, folded/nested/prepared/temporary CTAS, stored views, wire/clone preservation, pre-catalog rejection and rollback before execution.
The design is documented in the versioned compatibility design, maintenance revision 5. Full CI, live mixed-binary rollout and TP throughput are not claimed. Epoch 120 retains official main's KILL authorization and proxy cleanup contract; epoch 121 retains the exact unsigned DECIMAL DIV contract; this temporal capability appends epoch 122. The allocation is checked against official main again before delivery.
Rebased onto official main
873282742714436bff407dfcdbbe879147162bd3. Current validation passed focused temporal/CTAS/lifecycle admission tests, six complete owning packages, vet and incremental lint. Compatibility controls reject predecessor 121, admit 122, reject 122-to-121 rollback before effects, and reject future CTAS requirement 123. Main's epoch-120 authorization and epoch-121 DECIMAL DIV consumers, and the existing plan wire schema, remain unchanged. Mixed-feature placement, sending, receiving and persisted requirements compose to 122; pure DECIMAL DIV remains available at 121. Mixed folded CTAS and stored-view expansion retain DATETIME(3) and unsigned INT schema contracts. On a default-SIMD standalone service, normal golden comparison passed the 130-statement prepared-temporal suite and the 29-statement upstream DECIMAL DIV domain suite twice each, with database teardown verified after every round. Additional public SQL checks passed mixed direct/folded CTAS and stored-view expansion: DATETIME(3), unsigned INT, exact values, and UTC/+08 behavior. The isolated service shut down cleanly and its temporary binary was removed.