rowexec

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

View Source
const SavePointName = "__go_mysql_server_starting_savepoint__"

Variables

View Source
var DefaultBuilder = &BaseBuilder{}
View Source
var ErrMergeJoinExpectsComparerFilters = errors.New("merge join expects expression.Comparer filters, found: %T")
View Source
var ErrTableNotLockable = errors.NewKind("table %s is not lockable")

ErrTableNotLockable is returned whenever a lockable table can't be found.

Functions

func AddExpressionCloser added in v0.16.0

func AddExpressionCloser(node sql.Node, iter sql.RowIter) sql.RowIter

AddExpressionCloser returns a new iterator that ensures that any expressions that implement sql.Closer are closed. If there are no expressions that implement sql.Closer in the tree, then the original iterator is returned.

func GetColumnsAndPrepareExpressions

func GetColumnsAndPrepareExpressions(
	exprs []sql.Expression,
) ([]string, []sql.Expression, error)

GetColumnsAndPrepareExpressions extracts the unique columns required by all those expressions and fixes the indexes of the GetFields in the expressions to match a row with only the returned columns in that same order.

func NewLeftMergeJoin

func NewLeftMergeJoin(left, right sql.Node, cond sql.Expression) *plan.JoinNode

func NewMergeJoin

func NewMergeJoin(left, right sql.Node, cond sql.Expression) *plan.JoinNode

NewMergeJoin returns a node that performs a presorted merge join on two relations. We require 1) the join filter is an equality with disjoint join attributes, 2) the free attributes for a relation are a prefix for an index that will be used to return sorted rows.

func ProjectRow

func ProjectRow(
	ctx *sql.Context,
	projections []sql.Expression,
	row sql.Row,
) (sql.Row, error)

ProjectRow evaluates a set of projections.

Types

type BaseBuilder

type BaseBuilder struct{}

BaseBuilder converts a plan tree into a RowIter tree. All relational nodes have a build statement. Custom source nodes that provide rows that implement sql.ExecSourceRel are also built into the tree.

func (*BaseBuilder) Build

func (b *BaseBuilder) Build(ctx *sql.Context, n sql.Node, r sql.Row) (sql.RowIter, error)

type EvalPartitionKeyValueIter

type EvalPartitionKeyValueIter struct {
	// contains filtered or unexported fields
}

func NewEvalPartitionKeyValueIter

func NewEvalPartitionKeyValueIter(iter sql.PartitionIndexKeyValueIter, columns []string, exprs []sql.Expression) *EvalPartitionKeyValueIter

func (*EvalPartitionKeyValueIter) Close

func (i *EvalPartitionKeyValueIter) Close(ctx *sql.Context) error

func (*EvalPartitionKeyValueIter) Next

type ExecBuilderFunc

type ExecBuilderFunc func(ctx *sql.Context, n sql.Node, r sql.Row) (sql.RowIter, error)

type FulltextFilterTable added in v0.17.0

type FulltextFilterTable struct {
	MatchAgainst *expression.MatchAgainst
	Table        sql.TableNode
}

FulltextFilterTable handles row iteration for filters involving Full-Text indexes, as they behave differently than other indexes. This acts as a sort of wrapper, so that integrators do not need to implement special logic on their side.

This takes a MatchAgainst expression, as it will have already resolved the index and necessary tables, therefore we do not need to replicate the work here. Although they may seem similar in functionality, they are performing two different functions. This filter table determines if we need to calculate the relevancy of a word, by only returning rows that exist within our index tables. If a word does not exist within the tables, then we can assume that it has a relevancy of zero (for the default search mode). Therefore, we can skip processing that row altogether. The existence of a row does not imply that the relevancy value will be non-zero though, as the relevancy calculation can return a zero due to rounding (as is the case with the MyISAM backend, which we currently do not support).

func (*FulltextFilterTable) Collation added in v0.17.0

func (f *FulltextFilterTable) Collation() sql.CollationID

Collation implements the interface sql.IndexedTable.

func (*FulltextFilterTable) LookupPartitions added in v0.17.0

func (f *FulltextFilterTable) LookupPartitions(ctx *sql.Context, lookup sql.IndexLookup) (sql.PartitionIter, error)

LookupPartitions implements the interface sql.IndexedTable.

func (*FulltextFilterTable) Name added in v0.17.0

func (f *FulltextFilterTable) Name() string

Name implements the interface sql.IndexedTable.

func (*FulltextFilterTable) PartitionRows added in v0.17.0

func (f *FulltextFilterTable) PartitionRows(ctx *sql.Context, partition sql.Partition) (sql.RowIter, error)

PartitionRows implements the interface sql.IndexedTable.

func (*FulltextFilterTable) Partitions added in v0.17.0

func (f *FulltextFilterTable) Partitions(ctx *sql.Context) (sql.PartitionIter, error)

Partitions implements the interface sql.IndexedTable.

func (*FulltextFilterTable) Schema added in v0.17.0

func (f *FulltextFilterTable) Schema() sql.Schema

Schema implements the interface sql.IndexedTable.

func (*FulltextFilterTable) String added in v0.17.0

func (f *FulltextFilterTable) String() string

String implements the interface sql.IndexedTable.

type NameAndSchema

type NameAndSchema interface {
	sql.Nameable
	Schema() sql.Schema
}

Jump to

Keyboard shortcuts

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