Documentation
¶
Index ¶
- Constants
- func AppendFloat64(buf []byte, value float64, bitSize int) []byte
- func AppendHex(dst []byte, src []byte) []byte
- func AppendInt64(buf []byte, value int64) []byte
- func AppendUint64(buf []byte, value uint64) []byte
- func AppendVectorSQLLiteral(ctx context.Context, vec *vector.Vector, row int, buf []byte) ([]byte, error)
- func BuildExactPkFilter(ctx context.Context, vec *vector.Vector) (string, error)
- func GetTxn(ctx context.Context, cnEngine engine.Engine, cnTxnClient client.TxnClient, ...) (client.TxnOperator, error)
- func RunSql(sqlproc *SqlProcess, sql string) (executor.Result, error)
- func RunStreamingSql(ctx context.Context, sqlproc *SqlProcess, sql string, ...) (executor.Result, error)
- func RunTxn(sqlproc *SqlProcess, execFunc func(executor.TxnExecutor) error) error
- func RunTxnWithSqlContext(ctx context.Context, cnEngine engine.Engine, cnTxnClient client.TxnClient, ...) (err error)
- func WaitUniqueJoinKeys(sqlproc *SqlProcess) ([]byte, error)
- type ConfigValue
- type Metadata
- type MetadataWriter
- type SqlContext
- func (s *SqlContext) GetResolveVariableFunc() func(varName string, isSystemVar, isGlobalVar bool) (interface{}, error)
- func (s *SqlContext) GetService() string
- func (s *SqlContext) SetResolveVariableFunc(f func(varName string, isSystemVar, isGlobalVar bool) (interface{}, error))
- func (s *SqlContext) Txn() client.TxnOperator
- type SqlProcess
Constants ¶
const ( Type_I8 = "I8" Type_I64 = "I" Type_F64 = "F" Type_String = "S" )
Variables ¶
This section is empty.
Functions ¶
func AppendFloat64 ¶
AppendFloat64 appends a float64 value, handling infinities.
func AppendInt64 ¶
AppendInt64 appends an int64 value as decimal text.
func AppendUint64 ¶
AppendUint64 appends a uint64 value as decimal text.
func AppendVectorSQLLiteral ¶
func AppendVectorSQLLiteral(ctx context.Context, vec *vector.Vector, row int, buf []byte) ([]byte, error)
AppendVectorSQLLiteral appends the SQL literal representation of vec[row] to buf.
func BuildExactPkFilter ¶
BuildExactPkFilter converts a vector of primary key values into a comma-separated SQL literal string suitable for use in an IN (...) clause.
func RunSql ¶
func RunSql(sqlproc *SqlProcess, sql string) (executor.Result, error)
run SQL in batch mode. Result batches will stored in memory and return once all result batches received.
func RunStreamingSql ¶
func RunStreamingSql( ctx context.Context, sqlproc *SqlProcess, sql string, stream_chan chan executor.Result, error_chan chan error, ) (executor.Result, error)
run SQL in WithStreaming() and pass the channel to SQL executor
func RunTxn ¶
func RunTxn(sqlproc *SqlProcess, execFunc func(executor.TxnExecutor) error) error
run SQL in batch mode. Result batches will stored in memory and return once all result batches received.
func RunTxnWithSqlContext ¶
func RunTxnWithSqlContext(ctx context.Context, cnEngine engine.Engine, cnTxnClient client.TxnClient, cnUUID string, accountId uint32, duration time.Duration, resolveVariableFunc func(varName string, isSystemVar, isGlobalVar bool) (interface{}, error), cbdata any, f func(sqlproc *SqlProcess, data any) error) (err error)
run SQL with SqlContext
func WaitUniqueJoinKeys ¶
func WaitUniqueJoinKeys(sqlproc *SqlProcess) ([]byte, error)
WaitUniqueJoinKeys blocks until it receives a RuntimeFilter_UNIQUEJOINKEYS message that matches sqlproc.RuntimeFilterSpecs (if any). It returns the raw serialized unique join key bytes from the build side.
The caller is responsible for deserializing the bytes and deciding how to use them (e.g. exact pk IN filter vs a membership filter based on its own threshold).
Types ¶
type ConfigValue ¶
type Metadata ¶
type Metadata struct {
// contains filtered or unexported fields
}
func NewMetadata ¶
func NewMetadataFromJson ¶
type MetadataWriter ¶
type MetadataWriter struct {
Cfg map[string]ConfigValue `json:"cfg"`
}
func NewMetadataWriter ¶
func NewMetadataWriter() *MetadataWriter
func (*MetadataWriter) AddFloat ¶
func (w *MetadataWriter) AddFloat(key string, value float64)
func (*MetadataWriter) AddInt ¶
func (w *MetadataWriter) AddInt(key string, value int64)
func (*MetadataWriter) AddInt8 ¶
func (w *MetadataWriter) AddInt8(key string, value int8)
func (*MetadataWriter) AddString ¶
func (w *MetadataWriter) AddString(key string, value string)
func (*MetadataWriter) Marshal ¶
func (w *MetadataWriter) Marshal() ([]byte, error)
type SqlContext ¶
type SqlContext struct {
Ctx context.Context
CNUuid string
TxnOperator client.TxnOperator
AccountId uint32
ResolveVariableFunc func(varName string, isSystemVar, isGlobalVar bool) (interface{}, error)
}
SqlContext stores required information for background SQLInternalExecutor
func NewSqlContext ¶
func NewSqlContext(ctx context.Context, cnuuid string, txnOperator client.TxnOperator, accountid uint32, resolveVariableFunc func(varName string, isSystemVar, isGlobalVar bool) (interface{}, error), ) *SqlContext
func (*SqlContext) GetResolveVariableFunc ¶
func (s *SqlContext) GetResolveVariableFunc() func(varName string, isSystemVar, isGlobalVar bool) (interface{}, error)
func (*SqlContext) GetService ¶
func (s *SqlContext) GetService() string
func (*SqlContext) SetResolveVariableFunc ¶
func (s *SqlContext) SetResolveVariableFunc(f func(varName string, isSystemVar, isGlobalVar bool) (interface{}, error))
func (*SqlContext) Txn ¶
func (s *SqlContext) Txn() client.TxnOperator
type SqlProcess ¶
type SqlProcess struct {
Proc *process.Process
SqlCtx *SqlContext
// Optional RuntimeFilterSpec
RuntimeFilterSpecs []*plan.RuntimeFilterSpec
// Optional doc_id membership-filter bytes (tagged docfilter payload) for the ivf entries scan.
IvfMembershipFilter []byte
// Optional doc_id membership-filter bytes (tagged docfilter payload) for the fulltext index scan.
FulltextMembershipFilter []byte
// Optional exact primary-key filter list (SQL literals, comma-separated).
// When set, ivf_search uses it to build "pk IN (...)" and skip centroid filtering.
ExactPkFilter string
// Optional IndexReaderParam attached by vector index runtime.
// Used to drive additional filtering in internal SQL executor (e.g. ivf entries scan).
IndexReaderParam *plan.IndexReaderParam
}
SqlProcess is the wrapper for both process.Process and background SQLContext SqlProcess enable the API to run in both frontend and background with InternalSQLExecutor process.Process always exists in frontend. However, process.Process does not exist in background job. SqlContext with required infos such as context.Context, CNUUID, TxnOperator and AccountId enable to run SQL with InternalSQLExecutor. Either process.Process or SqlContext is used in SqlProcess. We will look for process.Process first before SqlContext
func NewSqlProcess ¶
func NewSqlProcess(proc *process.Process) *SqlProcess
func NewSqlProcessWithContext ¶
func NewSqlProcessWithContext(ctx *SqlContext) *SqlProcess
func (*SqlProcess) GetContext ¶
func (s *SqlProcess) GetContext() context.Context
func (*SqlProcess) GetResolveVariableFunc ¶
func (s *SqlProcess) GetResolveVariableFunc() func(varName string, isSystemVar, isGlobalVar bool) (interface{}, error)
func (*SqlProcess) GetTopContext ¶
func (s *SqlProcess) GetTopContext() context.Context