mirror of
https://github.com/milvus-io/milvus.git
synced 2026-10-28 17:05:53 +08:00
Backport #52138 to 2.6: merge compatible same-column ARRAY contains
predicates into ContainsAny for OR chains and ContainsAll for AND
chains, preserving typed values, NULL behavior, and unrelated operands.
The 3.0 backport is already merged in #52365.
The first commit cherry-picks 95ea35866b
with 2.6 API/import adaptations. The follow-up processes homogeneous
logical chains once, balances remaining operands, and checks complete
column metadata and pending templates. This avoids repeated prefix
rewrites for filters containing thousands of leaves.
pr: #52138
issue: #51996
Design: [ARRAY contains compilation merge for
2.6](https://github.com/xiaofan-luan/milvus/blob/codex/array-contains-cp26-20261020/docs/design-docs/design_docs/20261020-array-contains-compilation-merge.md)
Validation:
- Full `go test -tags dynamic,test -gcflags='all=-N -l' -count=1
./internal/parser/planparserv2/...` passed, including 2,164/2,216-leaf
parser cases, existing rewrite regressions, typed conversions,
NULL/empty lists, templates, and metadata boundaries.
- Matched synthetic rewrite benchmark: 2,216 leaves become one;
cumulative allocation falls from 936,504,576 to 726,434 bytes per
rewrite. These are debug-build compilation measurements, not QueryNode
peak-memory or query-latency measurements. Shared-host timing noise
prevents a reliable speedup claim.
- The upstream Python query-equivalence case is retained verbatim by AST
comparison and passes Python AST parsing. Cluster e2e was not run
locally.
- Subsequent commits only adjust test formatting/import grouping. The
seven Go files pass gofmt, goimports, gci, and gofumpt with the
repository configuration; the Python case passes the CI Ruff version.
Production Go sources are unchanged from the tested version.
- `git diff --check` passes.
- Remote CI build and code-check passed. Integration run
[14845](https://jenkins-milvus-ci.milvus.io/job/MILVUS-CI-V2-PR-PIPELINES/job/milvus-ut-integration-pipeline/14845/)
failed only in `TestReplicas/TestDynamicUpdateLoadConfigs_WithoutRG`:
loading did not converge after a 5-to-3-to-5 replica change, and
`GetLoadingProgress` failed near the test's three-minute deadline. This
case uses only Int64 and FloatVector fields, with no ARRAY/filter/parser
execution; no evidence currently ties it to this change. The helper
discards the underlying RPC error, and no base rerun was performed, so
this is not labeled a proven pre-existing failure. CI is not yet fully
green.
- Update: same-head integration rerun
[14849](https://jenkins-milvus-ci.milvus.io/job/MILVUS-CI-V2-PR-PIPELINES/job/milvus-ut-integration-pipeline/14849/)
passed. The channel-generation handoff issue exposed by the earlier
failure is tracked separately in #54450.
---------
Signed-off-by: sunby <sunbingyi1992@gmail.com>
Signed-off-by: xiaofanluan <xf@hjjaq.com>
Co-authored-by: Bingyi Sun <sunbingyi1992@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: xiaofanluan <xf@hjjaq.com>