Repository navigation
implement:implements full support for DECIMAL(M, D) with M up to 65 - #23916
Conversation
Extend the DECIMAL(65,30)/decimal256 type to cover all core numeric operators and functions: - Arithmetic: +, -, *, /, %, div with scale-aware Decimal256.Add/Sub/Mul/Div/Mod methods - Aggregation: SUM, AVG, MIN, MAX with dedicated decimal256 exec paths - Math functions: ABS, SIGN, CEIL, FLOOR, ROUND, TRUNCATE - Predicates: =, !=, <, >, <=, >=, <=>, BETWEEN, IN, NOT IN - Conditional: CASE WHEN, COALESCE, IFF - Sorting: ORDER BY via pkg/sort - Implicit type coercion rules updated in type_check.go - Return type inference for all arithmetic operators updated in list_operator.go All affected unit tests pass. BVT cases updated and verified with mo-tester (10/10). Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
|
|
|
I fixed the clear issue-level gaps in this round:
I also added focused tests for both changes. ZoneMap bypass for decimal256 is a real performance limitation, but I did not address it in this patch. The The cast-gap report is only partially applicable now. I fixed the missing decimal256 integral cast paths Decimal256 Format() using big.Int is a valid performance concern. I agree it is worth optimizing, but I I do not see evidence that Decimal128.Mod128 behavior changed in this branch. The branch adds decimal256- FROM_UNIXTIME behavior did change for very large numeric literals after decimal256 widened the literal There is still duplicated decimal256 code across the decimal64/128/256 paths. That is real technical debt, Some result-file churn in this branch is broader than the core decimal256 behavior change. I agree that is |
… issue/23910 # Conflicts: # pkg/sql/colexec/aggexec/sumavg2.go
The resultType-based early return handles cross-type promotions (e.g. decimal128 + int64 → decimal256), while the paramType switch case handles inputs already typed as decimal256. Both are reachable. Co-authored-by: Copilot <[email protected]>
Merge Queue Status
This pull request spent 6 seconds in the queue, with no time running CI. ReasonThe pull request can't be updated
HintYou should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again. |
Merge Queue Status
This pull request spent 10 seconds in the queue, with no time running CI. Required conditions to merge
|
What type of PR is this?
Which issue(s) this PR fixes:
issue #23910
What this PR does / why we need it:
This PR extends DECIMAL(M, D) support up to M = 65 by wiring the decimal256 type through parser, planner, execution, output, and test coverage, and then closes the remaining correctness and performance gaps found during review.
What was added across the branch
Commit 1 — d9a6e16: Basic query path
Commit 2 — fa7995f: Core operator and function support
Commit 3 — 8f5453d: Reviewer follow-up fixes
Commit 4 — 1195159: Edge-case correctness fixes
Commit 5 — 18e35cf: Decimal256 format hot-path optimization
Validation
GOCACHE=/tmp/go-build-23910 go test ./pkg/container/types -count=1GOCACHE=/tmp/go-build-23910 go test ./pkg/container/types -run '^$' -bench '^BenchmarkDecimal256Format$' -benchmem -count=1GOCACHE=/tmp/go-build-23910 go test ./pkg/frontend -run '^$' -count=1GOCACHE=/tmp/go-build-23910 go test ./pkg/sql/compile ./pkg/cdc ./pkg/iscp ./pkg/vm/engine/tae/common -run '^$' -count=1GOCACHE=/tmp/go-build-23910 SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk CPATH=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include CPLUS_INCLUDE_PATH=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1 make build CMAKE_POLICY_VERSION_MINIMUM=3.5cd /Users/moukeyu/mo-tester./run.sh -p /Users/moukeyu/matrixone-23910/test/distributed/cases/dtype/decimal_256.test -g[SUMMARY] COST : 0s, TOTAL :10, SUCCESS : 10, FAILED :0, IGNORED :0, ABNORAML :0, SUCCESS RATE : 100%Known Risks and Limitations