distsql

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColumnsToProto

func ColumnsToProto(columns []*model.ColumnInfo, pkIsHandle bool) []*tipb.ColumnInfo

ColumnsToProto converts a slice of model.ColumnInfo to a slice of tipb.ColumnInfo.

func FieldTypeFromPBColumn

func FieldTypeFromPBColumn(col *tipb.ColumnInfo) *types.FieldType

FieldTypeFromPBColumn creates a types.FieldType from tipb.ColumnInfo.

func IndexToProto

func IndexToProto(t *model.TableInfo, idx *model.IndexInfo) *tipb.IndexInfo

IndexToProto converts a model.IndexInfo to a tipb.IndexInfo.

Types

type NewPartialResult

type NewPartialResult interface {
	// Next returns the next rowData of the sub result.
	// If no more row to return, rowData would be nil.
	Next() (rowData []types.Datum, err error)
	// Close closes the partial result.
	Close() error
}

NewPartialResult is the result from a single region server.

type NewSelectResult

type NewSelectResult interface {
	// Next gets the next partial result.
	Next() (NewPartialResult, error)
	// NextRaw gets the next raw result.
	NextRaw() ([]byte, error)
	// Close closes the iterator.
	Close() error
	// Fetch fetches partial results from client.
	// The caller should call SetFields() before call Fetch().
	Fetch(ctx goctx.Context)
}

NewSelectResult is an iterator of coprocessor partial results.

func NewAnalyze

func NewAnalyze(ctx goctx.Context, client kv.Client, kvReq *kv.Request) (NewSelectResult, error)

NewAnalyze do a analyze request.

func NewSelectDAG

func NewSelectDAG(ctx goctx.Context, client kv.Client, kvReq *kv.Request, colLen int) (NewSelectResult, error)

NewSelectDAG sends a DAG request, returns SelectResult. In kvReq, KeyRanges is required, Concurrency/KeepOrder/Desc/IsolationLevel/Priority are optional.

type PartialResult

type PartialResult interface {
	// Next returns the next rowData of the sub result.
	// If no more row to return, rowData would be nil.
	Next() (handle int64, rowData []byte, err error)
	// Close closes the partial result.
	Close() error
}

PartialResult is the result from a single region server.

type SelectResult

type SelectResult interface {
	// Next gets the next partial result.
	Next() (PartialResult, error)
	// NextRaw gets the next raw result.
	NextRaw() ([]byte, error)
	// Close closes the iterator.
	Close() error
	// Fetch fetches partial results from client.
	// The caller should call SetFields() before call Fetch().
	Fetch(ctx goctx.Context)
}

SelectResult is an iterator of coprocessor partial results.

func Select

func Select(client kv.Client, ctx goctx.Context, req *tipb.SelectRequest, keyRanges []kv.KeyRange, concurrency int, keepOrder bool, isolationLevel kv.IsoLevel, priority int) (SelectResult, error)

Select do a select request, returns SelectResult. concurrency: The max concurrency for underlying coprocessor request. keepOrder: If the result should returned in key order. For example if we need keep data in order by

scan index, we should set keepOrder to true.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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