Repository navigation
fix(agg): preserve nullable groups in AP MergeGroup - #24223
Merged
mergify[bot] merged 8 commits intoApr 29, 2026
Merged
mergify[bot] merged 8 commits into
mergify[bot] merged 8 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes type inference for same-type INT/UINT division so that the / operator casts operands to decimal128 (instead of float64), improving precision for boundary comparisons (e.g., ... / ... > 1.2) and addressing issue #24208.
Changes:
- Update fixed cast rules so same-type integer division uses
decimal128operands. - Add unit tests validating the new cast inference and
/return type for same-type integer operands. - Add a distributed (BVT) SQL repro case + expected result for the boundary-mismatch scenario.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
pkg/sql/plan/function/type_check.go |
Changes fixed cast rules for same-type int*/uint* division to cast operands to decimal128. |
pkg/sql/plan/function/function_test.go |
Adds unit coverage asserting same-type integer / uses decimal128 casts and returns decimal128(38,6). |
test/distributed/cases/benchmark/tpcds/01_issue_24208.sql |
Adds a minimal SQL repro for the boundary precision problem using BIGINT division in a filter. |
test/distributed/cases/benchmark/tpcds/01_issue_24208.result |
Adds the expected output for the new BVT case. |
ghost
approved these changes
Apr 28, 2026
aunjgr
approved these changes
Apr 28, 2026
Contributor
Merge Queue Status
This pull request spent 58 minutes 24 seconds in the queue, including 58 minutes 8 seconds running CI. Required conditions to merge
|
This was referenced May 6, 2026
This was referenced May 15, 2026
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
Which issue(s) this PR fixes:
Closes #24208
What this PR does / why we need it:
This PR fixes the real root cause behind the unstable
q34result on MatrixOne.On the AP one-CN parallel merge path,
MergeGrouprebuilt its hash table from partial-group batches without restoring nullable group-key metadata. When the first merged partial batch only contained non-nullss_customer_sk, the merge hash table was initialized as if the group key had no nulls, and later partial batches carrying theNULLcustomer group could be dropped.This PR:
keyNullablein the partial-group payloadMergeGroupbuilds its hash tablePreparetest/distributed/cases/benchmark/tpcds/01_issue_24208.sqlinto a focused BVT for this regressionValidation:
go test ./pkg/sql/colexec/group -count=1go test ./pkg/sql/plan/function -run 'Test_fixedTypeCastRule2|Test_GetFunctionByName' -count=1mo-tester genrs -i issue_24208mo-tester run -i issue_24208 -t 3q34recheck:4726, final rows =513~5175065, final rows =471Note:
q34