engine

package
v0.0.49 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2023 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const TimeBucketName = "time_bucket"

Variables

View Source
var Columns, Indexed = func() (o []string, 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.String())
	}
	return
}()
View Source
var ErrNoFilter = errors.New("no filters")
View Source
var ErrSkipBlock = errors.New("skip block")
View Source
var VinceFuncs = []sql.Function{
	sql.FunctionN{Name: TimeBucketName, Fn: NewTimeBucket},
}

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 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

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) 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 Domains added in v0.0.45

type Domains []string

func (Domains) Len added in v0.0.45

func (h Domains) Len() int

func (Domains) Less added in v0.0.45

func (h Domains) Less(i, j int) bool

func (*Domains) Pop added in v0.0.45

func (h *Domains) Pop() any

func (*Domains) Push added in v0.0.45

func (h *Domains) Push(x any)

func (Domains) Swap added in v0.0.45

func (h Domains) Swap(i, j int)

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 FilterContext added in v0.0.45

type FilterContext struct {
	Domains Domains
	Index   []IndexFilter
	Values  []ValueFilter
}

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 {
	Lookup sql.IndexLookup
	// contains filtered or unexported fields
}

func (IndexedTable) Collation added in v0.0.46

func (t IndexedTable) Collation() sql.CollationID

func (IndexedTable) GetIndexes added in v0.0.46

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

func (IndexedTable) IndexedAccess added in v0.0.46

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

func (*IndexedTable) LookupPartitions added in v0.0.38

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

func (IndexedTable) Name added in v0.0.46

func (IndexedTable) Name() string

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.

func (IndexedTable) Partitions added in v0.0.46

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

func (IndexedTable) Projections added in v0.0.46

func (t IndexedTable) Projections() (o []string)

func (IndexedTable) Schema added in v0.0.46

func (t IndexedTable) Schema() sql.Schema

func (IndexedTable) String added in v0.0.46

func (IndexedTable) String() string

func (IndexedTable) WithProjections added in v0.0.46

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

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 Provider

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

func NewProvider added in v0.0.45

func NewProvider() *Provider

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) ExternalStoredProcedure added in v0.0.45

func (p *Provider) ExternalStoredProcedure(_ *sql.Context, name string, numOfParams int) (*sql.ExternalStoredProcedureDetails, error)

ExternalStoredProcedure implements the sql.ExternalStoredProcedureProvider interface

func (*Provider) ExternalStoredProcedures added in v0.0.45

func (p *Provider) ExternalStoredProcedures(_ *sql.Context, name string) ([]sql.ExternalStoredProcedureDetails, error)

ExternalStoredProcedures implements the sql.ExternalStoredProcedureProvider interface

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

func (*Provider) TableFunction added in v0.0.46

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

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 Server added in v0.0.24

type Server struct {
	Listener *mysql.Listener
}

func Listen added in v0.0.24

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

func (*Server) Close added in v0.0.24

func (s *Server) Close() error

func (*Server) Shutdown added in v0.0.45

func (s *Server) Shutdown(_ context.Context) error

func (*Server) Start added in v0.0.24

func (s *Server) Start() error

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 ValueFilter added in v0.0.41

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

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 Match added in v0.0.41

func Match(col v1.Column, matchValue any, op Op) *ValueMatchFuncs

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