Documentation
¶
Index ¶
- func ExtractPushablePredicate(expr types.FilterExpr, records []arrow.RecordBatch) types.HNSWPredicate
- func FastPathEqual(ctx context.Context, arr arrow.Array, value string) (arrow.Array, error)
- func FastPathGreater(ctx context.Context, arr arrow.Array, value string) (arrow.Array, error)
- func FastPathGreaterEqual(ctx context.Context, arr arrow.Array, value string) (arrow.Array, error)
- func FastPathLess(ctx context.Context, arr arrow.Array, value string) (arrow.Array, error)
- func FastPathLessEqual(ctx context.Context, arr arrow.Array, value string) (arrow.Array, error)
- func FastPathNotEqual(ctx context.Context, arr arrow.Array, value string) (arrow.Array, error)
- func FilterHash(f core.Filter) string
- func IsFastPathSupported(dt arrow.DataType, op FilterOperator) bool
- func ParseBool(data []byte, pos int) (bool, int, error)
- func ParseDatasetRequest(data []byte, dsName *string) error
- func ParseFederatedSearchRequest(data []byte, req *core.FederatedSearchRequest) error
- func ParseFilterArray(data []byte, pos int, filters *[]core.Filter) (int, error)
- func ParseFilterArrayRecursive(data []byte, pos int, filters *[]core.Filter, parser *ZeroAllocTicketParser) (int, error)
- func ParseFilterRecursive(data []byte, pos int, parser *ZeroAllocTicketParser) (core.Filter, int, error)
- func ParseFloat32(data []byte, pos int) (float32, int, error)
- func ParseGeoBoundingBox(data []byte, pos int, box *core.GeoBoundingBox) (int, error)
- func ParseGeoPoint(data []byte, pos int, point *core.GeoPoint) (int, error)
- func ParseGeoSearchRequest(data []byte, req *core.GeoSearchRequest) error
- func ParseInt64(data []byte, pos int) (int64, int, error)
- func ParseRangeSearchRequest(data []byte, req *core.RangeSearchRequest) error
- func ParseRecommendRequest(data []byte, req *core.RecommendRequest) error
- func ParseSearchByIDRequest(data []byte, req *core.VectorSearchByIDRequest) error
- func ParseString(data []byte, pos int) (string, int, error)
- func ParseTemporalSearchRequest(data []byte, req *core.TemporalSearchRequest) error
- func ParseWindowFunctionShared(data []byte, pos int) (core.WindowFunction, int, error)
- func ParseWindowFunctionsShared(data []byte, pos int) ([]core.WindowFunction, int, error)
- func ParseWindowOrderShared(data []byte, pos int) (core.WindowOrder, int, error)
- func ParseWindowSpecShared(data []byte, pos int) (core.WindowSpec, int, error)
- func ProjectRecord(mem memory.Allocator, rec arrow.RecordBatch, columns []string) (arrow.RecordBatch, error)
- func SkipArray(data []byte, pos int) (int, error)
- func SkipLiteral(data []byte, pos int) (int, error)
- func SkipNumber(data []byte, pos int) (int, error)
- func SkipObject(data []byte, pos int) (int, error)
- func SkipValue(data []byte, pos int) (int, error)
- func SkipWhitespace(data []byte, pos int) int
- type CTE
- type FederatedSearchRequest
- type Filter
- type FilterEvaluator
- func (e *FilterEvaluator) EvaluateToArrowBoolean(mem memory.Allocator, rows int) (*array.Boolean, error)
- func (e *FilterEvaluator) Matches(rowIdx int) bool
- func (e *FilterEvaluator) MatchesAll(batchLen int) ([]int, error)
- func (e *FilterEvaluator) MatchesBatch(rowIndices []int) []int
- func (e *FilterEvaluator) MatchesBatchFused(rowIndices []int) []int
- func (e *FilterEvaluator) Reset(rec arrow.RecordBatch) error
- func (e *FilterEvaluator) SetStringColumnCodes(colIdx int, codes []uint16, dict *StringDictionary)
- type FilterOperator
- type GeoBoundingBox
- type GeoPoint
- type GeoSearchRequest
- type HNSWSIMDPredicate
- type ParserPoolStats
- type Projection
- type ProjectionEvaluator
- type RangeSearchRequest
- type RecommendRequest
- type StringDictionary
- type TemporalAggregationRequest
- type TemporalSearchRequest
- type TemporalVersionHistoryRequest
- type TicketQuery
- type VectorSearchByIDRequest
- type VectorSearchRequest
- type VectorSearchResponse
- type VectorizedFilter
- type WindowFunction
- type WindowOperator
- type WindowOrder
- type WindowSpec
- type ZeroAllocTemporalParser
- type ZeroAllocTicketParser
- type ZeroAllocVectorSearchParser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractPushablePredicate ¶
func ExtractPushablePredicate(expr types.FilterExpr, records []arrow.RecordBatch) types.HNSWPredicate
ExtractPushablePredicate attempts to extract a SIMD-accelerated predicate from a FilterExpr. It currently handles simple numeric range comparisons.
func FastPathEqual ¶
FastPathEqual applies equality filter directly without Arrow Compute overhead. Returns a boolean mask array where true indicates matching values.
func FastPathGreater ¶
FastPathGreater applies greater-than filter directly without Arrow Compute overhead.
func FastPathGreaterEqual ¶
FastPathGreaterEqual applies greater-than-or-equal filter directly without Arrow Compute overhead.
func FastPathLess ¶
FastPathLess applies less-than filter directly without Arrow Compute overhead.
func FastPathLessEqual ¶
FastPathLessEqual applies less-than-or-equal filter directly without Arrow Compute overhead.
func FastPathNotEqual ¶
FastPathNotEqual applies not-equal filter directly without Arrow Compute overhead. Returns a boolean mask array where true indicates non-matching values.
func FilterHash ¶
Hash returns a unique string representation of a filter for caching purposes.
func IsFastPathSupported ¶
func IsFastPathSupported(dt arrow.DataType, op FilterOperator) bool
IsFastPathSupported returns true if the data type and operator can use the fast path that bypasses Arrow Compute overhead.
func ParseDatasetRequest ¶
func ParseFederatedSearchRequest ¶
func ParseFederatedSearchRequest(data []byte, req *core.FederatedSearchRequest) error
ParseFederatedSearchRequest parses a JSON object into FederatedSearchRequest.
func ParseFilterArray ¶
func ParseFilterRecursive ¶
func ParseGeoBoundingBox ¶
func ParseGeoSearchRequest ¶
func ParseGeoSearchRequest(data []byte, req *core.GeoSearchRequest) error
func ParseRangeSearchRequest ¶
func ParseRangeSearchRequest(data []byte, req *core.RangeSearchRequest) error
ParseRangeSearchRequest parses a JSON object into RangeSearchRequest.
func ParseRecommendRequest ¶
func ParseRecommendRequest(data []byte, req *core.RecommendRequest) error
func ParseSearchByIDRequest ¶
func ParseSearchByIDRequest(data []byte, req *core.VectorSearchByIDRequest) error
func ParseTemporalSearchRequest ¶
func ParseTemporalSearchRequest(data []byte, req *core.TemporalSearchRequest) error
func ParseWindowOrderShared ¶
func ParseWindowSpecShared ¶
func ProjectRecord ¶
func ProjectRecord(mem memory.Allocator, rec arrow.RecordBatch, columns []string) (arrow.RecordBatch, error)
func SkipWhitespace ¶
Types ¶
type FederatedSearchRequest ¶
type FederatedSearchRequest = core.FederatedSearchRequest
type FilterEvaluator ¶
type FilterEvaluator struct {
// contains filtered or unexported fields
}
func NewFilterEvaluator ¶
func NewFilterEvaluator(rec arrow.RecordBatch, filters []Filter) (*FilterEvaluator, error)
NewFilterEvaluator creates a new evaluator, pre-binding filters to RecordBatch columns. Supports compound expressions (AND/OR/NOT) with nested field paths (dot notation).
func (*FilterEvaluator) EvaluateToArrowBoolean ¶
func (*FilterEvaluator) Matches ¶
func (e *FilterEvaluator) Matches(rowIdx int) bool
func (*FilterEvaluator) MatchesAll ¶
func (e *FilterEvaluator) MatchesAll(batchLen int) ([]int, error)
MatchesAll evaluates all filters on the entire batch using SIMD and returns matching row indices. Compound filters (AND/OR/NOT) and flat filters are handled separately for optimal performance.
func (*FilterEvaluator) MatchesBatch ¶
func (e *FilterEvaluator) MatchesBatch(rowIndices []int) []int
MatchesBatch evaluates filters for a slice of row indices and returns a subset of matching indices. This uses vectorized FilterBatch operations for improved performance.
func (*FilterEvaluator) MatchesBatchFused ¶
func (e *FilterEvaluator) MatchesBatchFused(rowIndices []int) []int
MatchesBatchFused evaluates all filters in a single pass without creating intermediate slices. This reduces memory allocations and improves cache locality compared to MatchesBatch.
func (*FilterEvaluator) Reset ¶
func (e *FilterEvaluator) Reset(rec arrow.RecordBatch) error
Reset binds the evaluator to a new record batch, reusing the existing filter operations.
func (*FilterEvaluator) SetStringColumnCodes ¶
func (e *FilterEvaluator) SetStringColumnCodes(colIdx int, codes []uint16, dict *StringDictionary)
SetStringColumnCodes applies precomputed dictionary codes to all string filter operations targeting colIdx.
type FilterOperator ¶
type FilterOperator int
FilterOperator represents a vectorized filter comparison operator
const ( FilterOpEqual FilterOperator = iota FilterOpNotEqual FilterOpGreater FilterOpLess FilterOpGreaterEqual FilterOpLessEqual FilterOpIn FilterOpNotIn FilterOpContains )
func ParseFilterOperator ¶
func ParseFilterOperator(op string) (FilterOperator, error)
ParseFilterOperator parses a string operator into FilterOperator
func (FilterOperator) ComputeFunc ¶
func (op FilterOperator) ComputeFunc() string
ComputeFunc returns the Arrow compute function name for the operator
func (FilterOperator) String ¶
func (op FilterOperator) String() string
String returns the string representation of the operator
type GeoBoundingBox ¶
type GeoBoundingBox = core.GeoBoundingBox
type GeoSearchRequest ¶
type GeoSearchRequest = core.GeoSearchRequest
type HNSWSIMDPredicate ¶
type HNSWSIMDPredicate struct {
// contains filtered or unexported fields
}
HNSWSIMDPredicate implements types.HNSWPredicate using SIMD kernels for accelerated metadata filtering during HNSW traversal.
func NewHNSWSIMDPredicate ¶
func NewHNSWSIMDPredicate(records []arrow.RecordBatch, colName string, op simd.CompareOp, value any) *HNSWSIMDPredicate
NewHNSWSIMDPredicate creates a new SIMD-accelerated predicate for HNSW traversal. It returns nil if the column is not found or the type is not supported.
func (*HNSWSIMDPredicate) IsMatch ¶
func (p *HNSWSIMDPredicate) IsMatch(id uint32) bool
func (*HNSWSIMDPredicate) MatchBatch ¶
func (p *HNSWSIMDPredicate) MatchBatch(ids []uint32, dst []byte)
type ParserPoolStats ¶
func GetParserPoolStats ¶
func GetParserPoolStats() ParserPoolStats
type Projection ¶
type Projection struct {
Columns []string
// contains filtered or unexported fields
}
func NewProjection ¶
func NewProjection(schema *arrow.Schema, columns []string) (*Projection, error)
func (*Projection) Apply ¶
func (p *Projection) Apply(rec arrow.RecordBatch) (arrow.RecordBatch, error)
func (*Projection) CanPushdown ¶
func (p *Projection) CanPushdown(filters []Filter) bool
func (*Projection) RequiredColumns ¶
func (p *Projection) RequiredColumns() []string
type ProjectionEvaluator ¶
type ProjectionEvaluator struct {
// contains filtered or unexported fields
}
func NewProjectionEvaluator ¶
func NewProjectionEvaluator(proj *Projection, schema *arrow.Schema) (*ProjectionEvaluator, error)
func (*ProjectionEvaluator) ApplyToBatch ¶
func (pe *ProjectionEvaluator) ApplyToBatch(rec arrow.RecordBatch) (arrow.RecordBatch, error)
func (*ProjectionEvaluator) ApplyToRecord ¶
func (pe *ProjectionEvaluator) ApplyToRecord(rec arrow.RecordBatch) (arrow.RecordBatch, error)
type RangeSearchRequest ¶
type RangeSearchRequest = core.RangeSearchRequest
type RecommendRequest ¶
type RecommendRequest = core.RecommendRequest
type StringDictionary ¶
type StringDictionary struct {
// contains filtered or unexported fields
}
StringDictionary maps categorical string values to 16-bit unsigned integer IDs.
func NewStringDictionary ¶
func NewStringDictionary() *StringDictionary
NewStringDictionary creates an initialized StringDictionary. ID 0 is reserved for empty/null or unmapped.
func (*StringDictionary) EncodeArray ¶
func (d *StringDictionary) EncodeArray(arr *array.String) []uint16
EncodeArray encodes an Arrow String array into a contiguous slice of 16-bit integer IDs.
func (*StringDictionary) GetOrCreate ¶
func (d *StringDictionary) GetOrCreate(s string) uint16
GetOrCreate returns the 16-bit integer ID for s, allocating a new ID if not present.
type TemporalAggregationRequest ¶
type TemporalAggregationRequest = core.TemporalAggregationRequest
type TemporalSearchRequest ¶
type TemporalSearchRequest = core.TemporalSearchRequest
type TemporalVersionHistoryRequest ¶
type TemporalVersionHistoryRequest = core.TemporalVersionHistoryRequest
type TicketQuery ¶
type TicketQuery = core.TicketQuery
TicketQuery is also aliased for convenience
func ParseTicketQuerySafe ¶
func ParseTicketQuerySafe(data []byte) (TicketQuery, error)
ParseTicketQuerySafe uses a pool of parsers to thread-safely parse TicketQuery
type VectorSearchByIDRequest ¶
type VectorSearchByIDRequest = core.VectorSearchByIDRequest
type VectorSearchRequest ¶
type VectorSearchRequest = core.VectorSearchRequest
Type aliases to resolve circular dependencies and maintain backward compatibility
type VectorSearchResponse ¶
type VectorSearchResponse = core.VectorSearchResponse
type VectorizedFilter ¶
type VectorizedFilter struct {
// contains filtered or unexported fields
}
VectorizedFilter provides optimized Arrow Compute based filtering
func NewVectorizedFilter ¶
func NewVectorizedFilter(alloc memory.Allocator) *VectorizedFilter
NewVectorizedFilter creates a new vectorized filter
func (*VectorizedFilter) Apply ¶
func (vf *VectorizedFilter) Apply(ctx context.Context, rec arrow.RecordBatch, filters []Filter) (arrow.RecordBatch, error)
Apply applies filters to a record batch using vectorized Arrow Compute operations
type WindowFunction ¶
type WindowFunction = core.WindowFunction
type WindowOperator ¶
type WindowOperator struct{}
WindowOperator implements execution of analytical window functions
func NewWindowOperator ¶
func NewWindowOperator() *WindowOperator
NewWindowOperator creates a new operator for window functions
func (*WindowOperator) Execute ¶
func (o *WindowOperator) Execute(results []core.SearchResult, functions []WindowFunction) []core.SearchResult
Execute applies window functions to the search results
type WindowOrder ¶
type WindowOrder = core.WindowOrder
type WindowSpec ¶
type WindowSpec = core.WindowSpec
type ZeroAllocTemporalParser ¶
type ZeroAllocTemporalParser struct {
}
ZeroAllocTemporalParser parses TemporalSearchRequest and TemporalAggregationRequest JSON with minimal allocations.
func NewZeroAllocTemporalParser ¶
func NewZeroAllocTemporalParser() *ZeroAllocTemporalParser
func (*ZeroAllocTemporalParser) ParseAggregation ¶
func (p *ZeroAllocTemporalParser) ParseAggregation(data []byte) (TemporalAggregationRequest, error)
ParseAggregation parses the JSON data into a TemporalAggregationRequest.
func (*ZeroAllocTemporalParser) ParseSearch ¶
func (p *ZeroAllocTemporalParser) ParseSearch(data []byte) (TemporalSearchRequest, error)
ParseSearch parses the JSON data into a TemporalSearchRequest.
type ZeroAllocTicketParser ¶
type ZeroAllocTicketParser struct {
// contains filtered or unexported fields
}
ZeroAllocTicketParser parses TicketQuery JSON with zero allocations for the common case (no escape sequences).
func NewZeroAllocTicketParser ¶
func NewZeroAllocTicketParser(logger *zerolog.Logger) *ZeroAllocTicketParser
NewZeroAllocTicketParser creates a new reusable parser
func (*ZeroAllocTicketParser) Parse ¶
func (p *ZeroAllocTicketParser) Parse(data []byte) (TicketQuery, error)
Parse parses the JSON data into a TicketQuery
type ZeroAllocVectorSearchParser ¶
type ZeroAllocVectorSearchParser struct {
// contains filtered or unexported fields
}
ZeroAllocVectorSearchParser parses VectorSearchRequest JSON with minimal allocations. The parser pre-allocates a vector slice and reuses it across parse calls. For the common case (no escape sequences in dataset name), this achieves zero allocations beyond the initial pre-allocation.
func NewZeroAllocVectorSearchParser ¶
func NewZeroAllocVectorSearchParser(maxDims int, logger *zerolog.Logger) *ZeroAllocVectorSearchParser
NewZeroAllocVectorSearchParser creates a new reusable parser. maxDims specifies the maximum expected vector dimensions for pre-allocation.
func (*ZeroAllocVectorSearchParser) Parse ¶
func (p *ZeroAllocVectorSearchParser) Parse(data []byte) (VectorSearchRequest, error)
Parse parses the JSON data into a VectorSearchRequest. The returned VectorSearchRequest.Vector shares the parser's internal buffer, so the result is only valid until the next Parse call.
func (*ZeroAllocVectorSearchParser) ParseVectorField ¶
func (p *ZeroAllocVectorSearchParser) ParseVectorField(data []byte, pos int, outVec *[]float32) (int, error)
ParseVectorField parses a JSON array of numbers into the provided slice
Source Files
¶
- fast_path_filter.go
- filter_compound.go
- filter_evaluator.go
- filter_nested.go
- filter_numeric.go
- filter_text.go
- hnsw_predicate_adapter.go
- hnsw_simd_predicate.go
- projection.go
- requests.go
- simd_filter_amd64.go
- simd_filter_avx512_amd64.go
- simd_filter_neon_stub.go
- string_dict.go
- vectorized_filter.go
- window_operator.go
- zero_alloc_parser.go
- zero_alloc_temporal.go
- zero_alloc_utils.go
- zero_alloc_vector_search.go