query

package
v0.2.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2026 License: Unlicense Imports: 22 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

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

func FastPathEqual(ctx context.Context, arr arrow.Array, value string) (arrow.Array, error)

FastPathEqual applies equality filter directly without Arrow Compute overhead. Returns a boolean mask array where true indicates matching values.

func FastPathGreater

func FastPathGreater(ctx context.Context, arr arrow.Array, value string) (arrow.Array, error)

FastPathGreater applies greater-than filter directly without Arrow Compute overhead.

func FastPathGreaterEqual

func FastPathGreaterEqual(ctx context.Context, arr arrow.Array, value string) (arrow.Array, error)

FastPathGreaterEqual applies greater-than-or-equal filter directly without Arrow Compute overhead.

func FastPathLess

func FastPathLess(ctx context.Context, arr arrow.Array, value string) (arrow.Array, error)

FastPathLess applies less-than filter directly without Arrow Compute overhead.

func FastPathLessEqual

func FastPathLessEqual(ctx context.Context, arr arrow.Array, value string) (arrow.Array, error)

FastPathLessEqual applies less-than-or-equal filter directly without Arrow Compute overhead.

func FastPathNotEqual

func FastPathNotEqual(ctx context.Context, arr arrow.Array, value string) (arrow.Array, error)

FastPathNotEqual applies not-equal filter directly without Arrow Compute overhead. Returns a boolean mask array where true indicates non-matching values.

func FilterHash

func FilterHash(f core.Filter) string

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 ParseBool

func ParseBool(data []byte, pos int) (bool, int, error)

func ParseDatasetRequest

func ParseDatasetRequest(data []byte, dsName *string) error

func ParseFederatedSearchRequest

func ParseFederatedSearchRequest(data []byte, req *core.FederatedSearchRequest) error

ParseFederatedSearchRequest parses a JSON object into FederatedSearchRequest.

func ParseFilterArray

func ParseFilterArray(data []byte, pos int, filters *[]core.Filter) (int, error)

func ParseFilterArrayRecursive

func ParseFilterArrayRecursive(data []byte, pos int, filters *[]core.Filter, parser *ZeroAllocTicketParser) (int, error)

func ParseFilterRecursive

func ParseFilterRecursive(data []byte, pos int, parser *ZeroAllocTicketParser) (core.Filter, int, error)

func ParseFloat32

func ParseFloat32(data []byte, pos int) (float32, int, error)

func ParseGeoBoundingBox

func ParseGeoBoundingBox(data []byte, pos int, box *core.GeoBoundingBox) (int, error)

func ParseGeoPoint

func ParseGeoPoint(data []byte, pos int, point *core.GeoPoint) (int, error)

func ParseGeoSearchRequest

func ParseGeoSearchRequest(data []byte, req *core.GeoSearchRequest) error

func ParseInt64

func ParseInt64(data []byte, pos int) (int64, int, 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 ParseString

func ParseString(data []byte, pos int) (string, int, error)

func ParseTemporalSearchRequest

func ParseTemporalSearchRequest(data []byte, req *core.TemporalSearchRequest) error

func ParseWindowFunctionShared

func ParseWindowFunctionShared(data []byte, pos int) (core.WindowFunction, int, error)

func ParseWindowFunctionsShared

func ParseWindowFunctionsShared(data []byte, pos int) ([]core.WindowFunction, int, error)

func ParseWindowOrderShared

func ParseWindowOrderShared(data []byte, pos int) (core.WindowOrder, int, error)

func ParseWindowSpecShared

func ParseWindowSpecShared(data []byte, pos int) (core.WindowSpec, int, error)

func ProjectRecord

func ProjectRecord(mem memory.Allocator, rec arrow.RecordBatch, columns []string) (arrow.RecordBatch, error)

func SkipArray

func SkipArray(data []byte, pos int) (int, error)

func SkipLiteral

func SkipLiteral(data []byte, pos int) (int, error)

func SkipNumber

func SkipNumber(data []byte, pos int) (int, error)

func SkipObject

func SkipObject(data []byte, pos int) (int, error)

func SkipValue

func SkipValue(data []byte, pos int) (int, error)

func SkipWhitespace

func SkipWhitespace(data []byte, pos int) int

Types

type CTE

type CTE = core.CTE

type FederatedSearchRequest

type FederatedSearchRequest = core.FederatedSearchRequest

type Filter

type Filter = core.Filter

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 (e *FilterEvaluator) EvaluateToArrowBoolean(mem memory.Allocator, rows int) (*array.Boolean, error)

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 GeoPoint

type GeoPoint = core.GeoPoint

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

type ParserPoolStats struct {
	Gets uint64
	Puts uint64
}

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 (*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.

func (*StringDictionary) Lookup

func (d *StringDictionary) Lookup(s string) (uint16, bool)

Lookup returns the 16-bit integer ID for s if 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

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL