mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
issue: https://github.com/milvus-io/milvus/issues/46517 ref: https://github.com/milvus-io/milvus/issues/42148 This PR supports match operator family with struct array and brute force search only. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> - Core invariant: match operators only target struct-array element-level predicates and assume callers provide a correct row_start so element indices form a contiguous range; IArrayOffsets implementations convert row-level bitmaps/rows (starting at row_start) into element-level bitmaps or a contiguous element-offset vector used by brute-force evaluation. - New capability added: end-to-end support for MATCH_* semantics (match_any, match_all, match_least, match_most, match_exact) — parser (grammar + proto), planner (ParseMatchExprs), expr model (expr::MatchExpr), compilation (Expr→PhyMatchFilterExpr), execution (PhyMatchFilterExpr::Eval uses element offsets/bitmaps), and unit tests (MatchExprTest + parser tests). Implementation currently works for struct-array inputs and uses brute-force element counting via RowBitsetToElementOffsets/RowBitsetToElementBitset. - Logic removed or simplified and why: removed the ad-hoc DocBitsetToElementOffsets helper and consolidated offset/bitset derivation into IArrayOffsets::RowBitsetToElementOffsets and a row_start-aware RowBitsetToElementBitset, and removed EvalCtx overloads that embedded ExprSet (now EvalCtx(exec_ctx, offset_input)). This centralizes array-layout logic in ArrayOffsets and removes duplicated offset conversion and EvalCtx variants that were redundant for element-level evaluation. - No data loss / no behavior regression: persistent formats are unchanged (no proto storage or on-disk layout changed); callers were updated to supply row_start and now route through the centralized ArrayOffsets APIs which still use the authoritative row_to_element_start_ mapping, preserving exact element index mappings. Eval logic changes are limited to in-memory plumbing (how offsets/bitmaps are produced and how EvalCtx is constructed); expression evaluation still invokes exprs_->Eval where needed, so existing behavior and stored data remain intact. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: SpadeA <tangchenjie1210@gmail.com> Signed-off-by: SpadeA-Tang <tangchenjie1210@gmail.com>
233 lines
6.3 KiB
Go
233 lines
6.3 KiB
Go
// Code generated from Plan.g4 by ANTLR 4.13.2. DO NOT EDIT.
|
|
|
|
package planparserv2 // Plan
|
|
import "github.com/antlr4-go/antlr/v4"
|
|
|
|
type BasePlanVisitor struct {
|
|
*antlr.BaseParseTreeVisitor
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitString(ctx *StringContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitMatchAny(ctx *MatchAnyContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitFloating(ctx *FloatingContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitIsNotNull(ctx *IsNotNullContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitIdentifier(ctx *IdentifierContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitSTIntersects(ctx *STIntersectsContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitLike(ctx *LikeContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitEquality(ctx *EqualityContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitBoolean(ctx *BooleanContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitShift(ctx *ShiftContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitTimestamptzCompareForward(ctx *TimestamptzCompareForwardContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitReverseRange(ctx *ReverseRangeContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitEmptyArray(ctx *EmptyArrayContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitPhraseMatch(ctx *PhraseMatchContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitMatchLeast(ctx *MatchLeastContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitArrayLength(ctx *ArrayLengthContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitSTTouches(ctx *STTouchesContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitTerm(ctx *TermContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitJSONContains(ctx *JSONContainsContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitSTWithin(ctx *STWithinContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitRange(ctx *RangeContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitMatchAll(ctx *MatchAllContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitSTIsValid(ctx *STIsValidContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitBitXor(ctx *BitXorContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitElementFilter(ctx *ElementFilterContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitBitAnd(ctx *BitAndContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitSTOverlaps(ctx *STOverlapsContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitMatchMost(ctx *MatchMostContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitJSONIdentifier(ctx *JSONIdentifierContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitRandomSample(ctx *RandomSampleContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitParens(ctx *ParensContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitMatchExact(ctx *MatchExactContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitJSONContainsAll(ctx *JSONContainsAllContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitLogicalOr(ctx *LogicalOrContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitMulDivMod(ctx *MulDivModContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitLogicalAnd(ctx *LogicalAndContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitTemplateVariable(ctx *TemplateVariableContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitTimestamptzCompareReverse(ctx *TimestamptzCompareReverseContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitSTDWithin(ctx *STDWithinContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitCall(ctx *CallContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitSTCrosses(ctx *STCrossesContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitBitOr(ctx *BitOrContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitAddSub(ctx *AddSubContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitRelational(ctx *RelationalContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitTextMatch(ctx *TextMatchContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitSTContains(ctx *STContainsContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitUnary(ctx *UnaryContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitInteger(ctx *IntegerContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitArray(ctx *ArrayContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitJSONContainsAny(ctx *JSONContainsAnyContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitExists(ctx *ExistsContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitSTEuqals(ctx *STEuqalsContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitIsNull(ctx *IsNullContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitStructSubField(ctx *StructSubFieldContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitPower(ctx *PowerContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|
|
|
|
func (v *BasePlanVisitor) VisitTextMatchOption(ctx *TextMatchOptionContext) interface{} {
|
|
return v.VisitChildren(ctx)
|
|
}
|