Documentation
¶
Index ¶
- func ColumnsToProto(columns []*model.ColumnInfo, pkIsHandle bool) []*tipb.ColumnInfo
- func FieldTypeFromPBColumn(col *tipb.ColumnInfo) *types.FieldType
- func IndexToProto(t *model.TableInfo, idx *model.IndexInfo) *tipb.IndexInfo
- func ProtoColumnsToFieldTypes(pColumns []*tipb.ColumnInfo) []*types.FieldType
- func SupportExpression(client kv.Client, expr *tipb.Expr) bool
- type PartialResult
- type SelectResult
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 ¶
IndexToProto converts a model.IndexInfo to a tipb.IndexInfo.
func ProtoColumnsToFieldTypes ¶
func ProtoColumnsToFieldTypes(pColumns []*tipb.ColumnInfo) []*types.FieldType
ProtoColumnsToFieldTypes converts tipb column info slice to FieldTyps slice.
Types ¶
type PartialResult ¶
type PartialResult interface {
// Next returns the next row of the sub result.
// If no more row to return, data would be nil.
Next() (handle int64, data []types.Datum, 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)
// SetFields sets the expected result type.
SetFields(fields []*types.FieldType)
// Close closes the iterator.
Close() error
// Fetch fetches partial results from client.
// The caller should call SetFields() before call Fetch().
Fetch()
// IgnoreData sets ignore data attr to true.
// For index double scan, we do not need row data when scanning index.
IgnoreData()
}
SelectResult is an iterator of coprocessor partial results.
func Select ¶
func Select(client kv.Client, req *tipb.SelectRequest, keyRanges []kv.KeyRange, concurrency int, keepOrder bool) (SelectResult, error)
Select do a select request, returns SelectResult. conncurrency: 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.
Click to show internal directories.
Click to hide internal directories.