index

package
v0.40.4 Latest Latest
Warning

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

Go to latest
Published: May 19, 2022 License: Apache-2.0 Imports: 25 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllRange

func AllRange() *noms.ReadRange

func ClosedRange

func ClosedRange(tpl1, tpl2 types.Tuple) *noms.ReadRange

func CustomRange

func CustomRange(tpl1, tpl2 types.Tuple, bt1, bt2 sql.RangeBoundType) *noms.ReadRange

func DoltIndexesFromTable

func DoltIndexesFromTable(ctx context.Context, db, tbl string, t *doltdb.Table) (indexes []sql.Index, err error)

func GetField

func GetField(td val.TupleDesc, i int, tup val.Tuple) (v interface{}, err error)

GetField reads the value from the ith field of the Tuple as an interface{}.

func GetGetFuncForMapIter

func GetGetFuncForMapIter(nbf *types.NomsBinFormat, mapItr types.MapIterator) func(ctx context.Context) (types.Tuple, types.Tuple, error)

func GreaterOrEqualRange

func GreaterOrEqualRange(tpl types.Tuple) *noms.ReadRange

func GreaterThanRange

func GreaterThanRange(tpl types.Tuple) *noms.ReadRange

func LessOrEqualRange

func LessOrEqualRange(tpl types.Tuple) *noms.ReadRange

func LessThanRange

func LessThanRange(tpl types.Tuple) *noms.ReadRange

func NewIndexLookupRowIterAdapter

func NewIndexLookupRowIterAdapter(ctx *sql.Context, idx DoltIndex, tableData durable.Index, keyIter nomsKeyIter) (*indexLookupRowIterAdapter, error)

NewIndexLookupRowIterAdapter returns a new indexLookupRowIterAdapter.

func NewProllyRowIter

func NewProllyRowIter(
	ctx context.Context,
	sch schema.Schema,
	rows prolly.Map,
	iter prolly.MapIter,
	projections []string,
) (sql.RowIter, error)

func NewRangePartitionIter

func NewRangePartitionIter(ctx *sql.Context, t *doltdb.Table, lookup sql.IndexLookup) (sql.PartitionIter, error)

func NomsRangesFromIndexLookup

func NomsRangesFromIndexLookup(lookup sql.IndexLookup) []*noms.ReadRange

func NotNullRange

func NotNullRange() *noms.ReadRange

func NullRange

func NullRange() *noms.ReadRange

func OpenRange

func OpenRange(tpl1, tpl2 types.Tuple) *noms.ReadRange

func PartitionIndexedTableRows

func PartitionIndexedTableRows(ctx *sql.Context, idx sql.Index, part sql.Partition, pkSch sql.PrimaryKeySchema, columns []string) (sql.RowIter, error)

func ProllyRangesFromIndexLookup

func ProllyRangesFromIndexLookup(lookup sql.IndexLookup) []prolly.Range

func PutField

func PutField(tb *val.TupleBuilder, i int, v interface{}) error

PutField writes an interface{} to the ith field of the Tuple being built.

func ReadRangesEqual

func ReadRangesEqual(nr1, nr2 *noms.ReadRange) bool

func RowIterForIndexLookup

func RowIterForIndexLookup(ctx *sql.Context, t *doltdb.Table, ilu sql.IndexLookup, pkSch sql.PrimaryKeySchema, columns []string) (sql.RowIter, error)

func RowIterForNomsRanges

func RowIterForNomsRanges(ctx *sql.Context, idx DoltIndex, ranges []*noms.ReadRange, columns []string, primary, secondary durable.Index) (sql.RowIter, error)

func RowIterForProllyRange

func RowIterForProllyRange(ctx *sql.Context, idx DoltIndex, ranges prolly.Range, pkSch sql.PrimaryKeySchema, columns []string, primary, secondary durable.Index) (sql.RowIter2, error)

Types

type CoveringIndexRowIterAdapter

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

func NewCoveringIndexRowIterAdapter

func NewCoveringIndexRowIterAdapter(ctx *sql.Context, idx DoltIndex, keyIter *noms.NomsRangeReader, resultCols []string) *CoveringIndexRowIterAdapter

func (*CoveringIndexRowIterAdapter) Close

func (*CoveringIndexRowIterAdapter) Next

func (ci *CoveringIndexRowIterAdapter) Next(ctx *sql.Context) (sql.Row, error)

Next returns the next row from the iterator.

type DoltIndex

type DoltIndex interface {
	sql.FilteredIndex
	Schema() schema.Schema
	IndexSchema() schema.Schema
	Format() *types.NomsBinFormat
	GetDurableIndexes(*sql.Context, *doltdb.Table) (durable.Index, durable.Index, error)
}

func DoltIndexFromLookup

func DoltIndexFromLookup(lookup sql.IndexLookup) DoltIndex

func IndexFromIndexLookup

func IndexFromIndexLookup(lookup sql.IndexLookup) DoltIndex

type DoltMapIter

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

DoltMapIter uses a types.MapIterator to iterate over a types.Map and returns sql.Row instances that it reads and converts

func NewDoltMapIter

func NewDoltMapIter(keyValGet KVGetFunc, closeKVGetter func() error, conv *KVToSqlRowConverter) *DoltMapIter

NewDoltMapIter returns a new DoltMapIter

func (*DoltMapIter) Close

func (dmi *DoltMapIter) Close(*sql.Context) error

func (*DoltMapIter) Next

func (dmi *DoltMapIter) Next(ctx *sql.Context) (sql.Row, error)

Next returns the next sql.Row until all rows are returned at which point (nil, io.EOF) is returned.

type IndexLookupKeyIterator

type IndexLookupKeyIterator interface {
	// NextKey returns the next key if it exists, and io.EOF if it does not.
	NextKey(ctx *sql.Context) (row.TaggedValues, error)
}

type KVGetFunc

type KVGetFunc func(ctx context.Context) (types.Tuple, types.Tuple, error)

KVGetFunc defines a function that returns a Key Value pair

type KVToSqlRowConverter

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

KVToSqlRowConverter takes noms types.Value key value pairs and converts them directly to a sql.Row. It can be configured to only process a portion of the columns and map columns to desired output columns.

func NewKVToSqlRowConverter

func NewKVToSqlRowConverter(nbf *types.NomsBinFormat, tagToSqlColIdx map[uint64]int, cols []schema.Column, rowSize int) *KVToSqlRowConverter

func NewKVToSqlRowConverterForCols

func NewKVToSqlRowConverterForCols(nbf *types.NomsBinFormat, sch schema.Schema) *KVToSqlRowConverter

NewKVToSqlRowConverterForCols returns a KVToSqlConverter instance based on the list of columns passed in

func (*KVToSqlRowConverter) ConvertKVToSqlRow

func (conv *KVToSqlRowConverter) ConvertKVToSqlRow(k, v types.Value) (sql.Row, error)

ConvertKVToSqlRow returns a sql.Row generated from the key and value provided.

func (*KVToSqlRowConverter) ConvertKVTuplesToSqlRow

func (conv *KVToSqlRowConverter) ConvertKVTuplesToSqlRow(k, v types.Tuple) (sql.Row, error)

ConvertKVToSqlRow returns a sql.Row generated from the key and value provided.

type SinglePartition

type SinglePartition struct {
	RowData durable.Index
}

func (SinglePartition) Key

func (sp SinglePartition) Key() []byte

Key returns the key for this partition, which must uniquely identity the partition. We have only a single partition per table, so we use a constant.

type SinglePartitionIter

type SinglePartitionIter struct {
	RowData durable.Index
	// contains filtered or unexported fields
}

func SinglePartitionIterFromNomsMap

func SinglePartitionIterFromNomsMap(rowData durable.Index) SinglePartitionIter

func (SinglePartitionIter) Close

func (itr SinglePartitionIter) Close(*sql.Context) error

Close is required by the sql.PartitionIter interface. Does nothing.

func (SinglePartitionIter) Next

Next returns the next partition if there is one, or io.EOF if there isn't.

Jump to

Keyboard shortcuts

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