Repository navigation
fix(sql): align signed-zero index and vector HLL semantics - #29122
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? |
6092b56 to
096cdeb
Compare
XuPeng-SH
left a comment
There was a problem hiding this comment.
COMMENT — PASS at exact head 096cdebcf9b3e7988984dd8efcbc964c23593eb9; self-authored PR, so comment only. No actionable P0–P2 findings.
Traced index access/residual/order paths and vector HLL signed-zero canonicalization, serialization, compatibility, scratch ownership and cleanup. FLOAT/DOUBLE index access remains conservatively rejected; vector HLL inputs are not mutated; incompatible nonempty v2/v4 merges reject; MORPC v88 gates new producers. Exact-head CI is green.
Evidence gaps remain around individual regression execution, mixed-version deployment, repeated prepared/index-DDL execution, and NaN/BF16/F16 boundary behavior. Historical nonempty v2 vector sketches require rebuilding before merging with new v4 sketches.
What type of PR is this?
Which issue(s) this PR fixes:
Fixes #28695
Fixes #28861
What this PR does / why we need it:
Root cause
-0.0and+0.0as different physical bytes, while SQL predicates equate them. Index access conditions could therefore omit one SQL-equal row.HLL_ADD_AGGhashed raw vector bytes, while vector equality, GROUP BY, exact DISTINCT, and approximate DISTINCT use canonical vector keys.Design and implementation
in_range, and OR combinations; retain the existing physical index encoding and evaluate the predicate on the base row.HLL_ADD_AGGstates (v4 wire). Restored v2 states retain their raw hash domain; mixed non-empty v2/v4 merges are rejected instead of silently changing semantics. Rebuild from source rows is the migration path for historical v2 vector states.Validation evidence
git diff --check: PASSgofmt -lon all changed Go files: PASSGOWORK=off go list -mod=readonly ./pkg/sql/plan ./pkg/sql/colexec/aggexec ./pkg/sql/colexec/group ./pkg/sql/compile ./pkg/defines: PASSroaring.h,usearch.h,xxhash.h, andjemalloc.h.pkg/defines,pkg/sql/plan,pkg/sql/colexec/aggexec,pkg/sql/colexec/group,pkg/sql/compile.go vet: NOT VERIFIED; the same missing native headers block package loading.golangci-lint: NOT VERIFIED; local v2.5.0 binary was built with Go 1.24.4 while the repository targets Go 1.26.4.mo-testeris available in the environment. Added and format-checked:test/distributed/cases/optimizer/issue_28695_signed_zero_index.test/.resulttest/distributed/cases/function/issue_28861_vector_signed_zero.test/.resultQA, rollback, and remaining risk
Review