engine

package
v0.0.44 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2023 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const TimeBucketName = "time_bucket"

Variables

View Source
var Columns, Indexed = func() (o []storev1.Column, idx map[string]storev1.Column) {
	idx = make(map[string]storev1.Column)
	for i := storev1.Column_bounce; i <= storev1.Column_utm_term; i++ {
		if i >= storev1.Column_timestamp {
			idx[i.String()] = i
		}
		o = append(o, i)
	}
	return
}()
View Source
var ErrNoFilter = errors.New("no filters")
View Source
var ErrSkipBlock = errors.New("skip block")

Functions

func BuildValueFilter added in v0.0.41

func BuildValueFilter(ctx context.Context,
	f []ValueFilter,
	source func(v1.Column) arrow.Array) (arrow.Array, error)

func Listen added in v0.0.24

func Listen(ctx context.Context) (*server.Server, error)

func NewTimeBucket added in v0.0.40

func NewTimeBucket(args ...sql.Expression) (sql.Expression, error)

Types

type DB added in v0.0.28

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

func NewDB added in v0.0.42

func NewDB(db db.Provider, rd b3.Reader) *DB

func (*DB) AllViews added in v0.0.42

func (db *DB) AllViews(ctx *sql.Context) ([]sql.ViewDefinition, error)

func (*DB) CreateView added in v0.0.42

func (db *DB) CreateView(ctx *sql.Context, name string, selectStatement, createViewStmt string) error

func (*DB) DropView added in v0.0.42

func (db *DB) DropView(ctx *sql.Context, name string) error

func (*DB) GetTableInsensitive added in v0.0.28

func (db *DB) GetTableInsensitive(ctx *sql.Context, tblName string) (table sql.Table, ok bool, err error)

func (*DB) GetTableNames added in v0.0.28

func (db *DB) GetTableNames(ctx *sql.Context) (names []string, err error)

func (*DB) GetViewDefinition added in v0.0.42

func (db *DB) GetViewDefinition(ctx *sql.Context, viewName string) (sql.ViewDefinition, bool, error)

func (DB) IsReadOnly added in v0.0.28

func (DB) IsReadOnly() bool

func (DB) Name added in v0.0.28

func (DB) Name() string

type Engine

type Engine struct {
	*sqle.Engine
}

func Get

func Get(ctx context.Context) *Engine

func New

func New(ctx context.Context) *Engine

func Open

func Open(ctx context.Context) (context.Context, *Engine)

type FilterIndex added in v0.0.41

type FilterIndex func(ctx context.Context, idx *blocksv1.ColumnIndex) (*RowGroups, error)

type FilterIndexFunc added in v0.0.44

type FilterIndexFunc func(ctx context.Context, idx *blocksv1.ColumnIndex) (*RowGroups, error)

type FilterValue added in v0.0.41

type FilterValue func(ctx context.Context, b *array.BooleanBuilder, value arrow.Array) (arrow.Array, error)

type Filters added in v0.0.42

type Filters struct {
	Index []IndexFilter
	Value []ValueFilter
}

type Index added in v0.0.38

type Index struct {
	TableName string
	Exprs     []sql.Expression

	PrefixLens []uint16
	// contains filtered or unexported fields
}

func (*Index) CanSupport added in v0.0.38

func (idx *Index) CanSupport(...sql.Range) bool

func (*Index) ColumnExpressionTypes added in v0.0.38

func (idx *Index) ColumnExpressionTypes() []sql.ColumnExpressionType

func (*Index) ColumnExpressions added in v0.0.38

func (idx *Index) ColumnExpressions() []sql.Expression

func (*Index) Comment added in v0.0.38

func (idx *Index) Comment() string

func (*Index) Database added in v0.0.38

func (idx *Index) Database() string

func (*Index) Expressions added in v0.0.38

func (idx *Index) Expressions() []string

func (*Index) ExtendedColumnExpressionTypes added in v0.0.38

func (idx *Index) ExtendedColumnExpressionTypes() []sql.ColumnExpressionType

func (*Index) ExtendedExpressions added in v0.0.38

func (idx *Index) ExtendedExpressions() []string

func (*Index) ID added in v0.0.38

func (idx *Index) ID() string

func (*Index) IndexType added in v0.0.38

func (idx *Index) IndexType() string

func (*Index) IsFullText added in v0.0.38

func (idx *Index) IsFullText() bool

func (*Index) IsGenerated added in v0.0.38

func (idx *Index) IsGenerated() bool

func (*Index) IsSpatial added in v0.0.38

func (idx *Index) IsSpatial() bool

func (*Index) IsUnique added in v0.0.38

func (idx *Index) IsUnique() bool

func (*Index) PrefixLengths added in v0.0.38

func (idx *Index) PrefixLengths() []uint16

func (*Index) Table added in v0.0.38

func (idx *Index) Table() string

type IndexFilter added in v0.0.41

type IndexFilter interface {
	Column() v1.Column
	FilterIndex(ctx context.Context, idx *blocksv1.ColumnIndex) (*RowGroups, error)
}

IndexFilter is an interface for choosing row groups and row group pages to read based on a column index.

This filter is first applied before values are read into arrow.Record. Only row groups and row group pages that matches across all IndexFilter are selected for reads

type IndexFilterResult added in v0.0.42

type IndexFilterResult struct {
	RowGroups []uint
	Pages     []*bitset.BitSet
}

type IndexMatchFuncs added in v0.0.41

type IndexMatchFuncs struct {
	Col             v1.Column
	Value           any
	FilterIndexFunc FilterIndexFunc
}

func (*IndexMatchFuncs) Column added in v0.0.41

func (i *IndexMatchFuncs) Column() v1.Column

func (*IndexMatchFuncs) FilterIndex added in v0.0.41

func (i *IndexMatchFuncs) FilterIndex(ctx context.Context, idx *blocksv1.ColumnIndex) (*RowGroups, error)

type IndexedTable added in v0.0.38

type IndexedTable struct {
	*Table
	Lookup sql.IndexLookup
}

func (*IndexedTable) LookupPartitions added in v0.0.38

func (t *IndexedTable) LookupPartitions(ctx *sql.Context, lookup sql.IndexLookup) (sql.PartitionIter, error)

func (*IndexedTable) PartitionRows added in v0.0.38

func (t *IndexedTable) PartitionRows(ctx *sql.Context, partition sql.Partition) (sql.RowIter, error)

PartitionRows implements the sql.PartitionRows interface.

type Op added in v0.0.41

type Op uint
const (
	Eq Op = 1 + iota
	Ne
	Gt
	GtEg
	Lt
	LtEq
	ReEq
	ReNe
)

func (Op) String added in v0.0.41

func (o Op) String() string

type Partition added in v0.0.28

type Partition struct {
	Info      blocksv1.BlockInfo
	Index     []IndexFilter
	Values    []ValueFilter
	Expr      sql.Expression
	RowGroups []uint
	Pages     []*bitset.BitSet
	Range     bool
}

func (*Partition) Key added in v0.0.28

func (p *Partition) Key() []byte

func (*Partition) Valid added in v0.0.44

func (p *Partition) Valid() error

type PlaintextAuthPluginFunc added in v0.0.42

type PlaintextAuthPluginFunc func(db *mysql_db.MySQLDb,
	user string, userEntry *mysql_db.User, pass string) (bool, error)

func (PlaintextAuthPluginFunc) Authenticate added in v0.0.42

func (f PlaintextAuthPluginFunc) Authenticate(db *mysql_db.MySQLDb,
	user string, userEntry *mysql_db.User, pass string) (bool, error)

type Provider

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

func (*Provider) AllDatabases

func (p *Provider) AllDatabases(_ *sql.Context) []sql.Database

func (*Provider) Database

func (p *Provider) Database(_ *sql.Context, name string) (sql.Database, error)

func (*Provider) Function added in v0.0.40

func (p *Provider) Function(ctx *sql.Context, name string) (sql.Function, error)

func (*Provider) HasDatabase

func (p *Provider) HasDatabase(_ *sql.Context, name string) bool

type RowGroups added in v0.0.42

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

func NewRowGroups added in v0.0.44

func NewRowGroups() *RowGroups

func (*RowGroups) Empty added in v0.0.44

func (g *RowGroups) Empty() bool

func (*RowGroups) SelectGroup added in v0.0.42

func (g *RowGroups) SelectGroup(groups *bitset.BitSet, f func(uint, *bitset.BitSet))

func (*RowGroups) Set added in v0.0.42

func (g *RowGroups) Set(index uint, pages []uint)

type Table

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

func (*Table) Collation added in v0.0.28

func (t *Table) Collation() sql.CollationID

func (*Table) GetIndexes added in v0.0.38

func (t *Table) GetIndexes(ctx *sql.Context) ([]sql.Index, error)

func (*Table) IndexedAccess added in v0.0.38

func (t *Table) IndexedAccess(i sql.IndexLookup) sql.IndexedTable

func (*Table) Name added in v0.0.28

func (t *Table) Name() string

func (*Table) PartitionRows added in v0.0.28

func (t *Table) PartitionRows(ctx *sql.Context, partition sql.Partition) (sql.RowIter, error)

func (*Table) Partitions added in v0.0.28

func (t *Table) Partitions(ctx *sql.Context) (sql.PartitionIter, error)

func (*Table) Projections added in v0.0.28

func (t *Table) Projections() (o []string)

func (*Table) Schema added in v0.0.28

func (t *Table) Schema() sql.Schema

func (*Table) String added in v0.0.28

func (t *Table) String() string

func (*Table) WithProjections added in v0.0.28

func (t *Table) WithProjections(colNames []string) sql.Table

type TimeBucket added in v0.0.40

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

func (*TimeBucket) Children added in v0.0.40

func (t *TimeBucket) Children() []sql.Expression

Children implements the sql.Expression interface.

func (*TimeBucket) Description added in v0.0.40

func (t *TimeBucket) Description() string

Description implements sql.FunctionExpression

func (*TimeBucket) Eval added in v0.0.40

func (t *TimeBucket) Eval(ctx *sql.Context, row sql.Row) (interface{}, error)

Eval implements the sql.Expression interface.

func (*TimeBucket) FunctionName added in v0.0.40

func (t *TimeBucket) FunctionName() string

FunctionName implements sql.FunctionExpression

func (*TimeBucket) IsNullable added in v0.0.40

func (t *TimeBucket) IsNullable() bool

IsNullable implements the sql.Expression interface.

func (*TimeBucket) Resolved added in v0.0.40

func (t *TimeBucket) Resolved() bool

Resolved implements the sql.Expression interface.

func (*TimeBucket) String added in v0.0.40

func (t *TimeBucket) String() string

func (*TimeBucket) Type added in v0.0.40

func (t *TimeBucket) Type() sql.Type

Type implements the sql.Expression interface.

func (*TimeBucket) WithChildren added in v0.0.40

func (t *TimeBucket) WithChildren(children ...sql.Expression) (sql.Expression, error)

WithChildren implements the Expression interface.

type Value added in v0.0.42

type Value interface {
	~int64 |
		float64 | string
}

type ValueFilter added in v0.0.41

type ValueFilter interface {
	Column() v1.Column
	FilterValue(ctx context.Context, value arrow.Array) (arrow.Array, error)
}

func Match added in v0.0.41

func Match[T Value](col v1.Column, matchValue T, op Op) ValueFilter

type ValueMatchFuncs added in v0.0.41

type ValueMatchFuncs struct {
	Col             v1.Column
	Value           any
	FilterValueFunc func(ctx context.Context, value arrow.Array) (arrow.Array, error)
}

func (*ValueMatchFuncs) Column added in v0.0.41

func (i *ValueMatchFuncs) Column() v1.Column

func (*ValueMatchFuncs) FilterValue added in v0.0.41

func (i *ValueMatchFuncs) FilterValue(ctx context.Context, value arrow.Array) (arrow.Array, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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