Documentation
¶
Overview ¶
Package tipb is a generated protocol buffer package.
It is generated from these files:
executor.proto expression.proto schema.proto select.proto
It has these top-level messages:
Executor TableScan IndexScan Selection Aggregation TopN Limit
Index ¶
- Variables
- type Aggregation
- func (m *Aggregation) GetAggFunc() []*Expr
- func (m *Aggregation) GetGroupBy() []*Expr
- func (m *Aggregation) Marshal() (data []byte, err error)
- func (m *Aggregation) MarshalTo(data []byte) (int, error)
- func (*Aggregation) ProtoMessage()
- func (m *Aggregation) Reset()
- func (m *Aggregation) Size() (n int)
- func (m *Aggregation) String() string
- func (m *Aggregation) Unmarshal(data []byte) error
- type ByItem
- func (m *ByItem) GetDesc() bool
- func (m *ByItem) GetExpr() *Expr
- func (m *ByItem) Marshal() (data []byte, err error)
- func (m *ByItem) MarshalTo(data []byte) (int, error)
- func (*ByItem) ProtoMessage()
- func (m *ByItem) Reset()
- func (m *ByItem) Size() (n int)
- func (m *ByItem) String() string
- func (m *ByItem) Unmarshal(data []byte) error
- type Chunk
- func (m *Chunk) GetRowsMeta() []RowMeta
- func (m *Chunk) Marshal() (data []byte, err error)
- func (m *Chunk) MarshalTo(data []byte) (int, error)
- func (*Chunk) ProtoMessage()
- func (m *Chunk) Reset()
- func (m *Chunk) Size() (n int)
- func (m *Chunk) String() string
- func (m *Chunk) Unmarshal(data []byte) error
- type ColumnInfo
- func (m *ColumnInfo) GetCollation() int32
- func (m *ColumnInfo) GetColumnId() int64
- func (m *ColumnInfo) GetColumnLen() int32
- func (m *ColumnInfo) GetDecimal() int32
- func (m *ColumnInfo) GetDefaultVal() []byte
- func (m *ColumnInfo) GetElems() []string
- func (m *ColumnInfo) GetFlag() int32
- func (m *ColumnInfo) GetPkHandle() bool
- func (m *ColumnInfo) GetTp() int32
- func (m *ColumnInfo) Marshal() (data []byte, err error)
- func (m *ColumnInfo) MarshalTo(data []byte) (int, error)
- func (*ColumnInfo) ProtoMessage()
- func (m *ColumnInfo) Reset()
- func (m *ColumnInfo) Size() (n int)
- func (m *ColumnInfo) String() string
- func (m *ColumnInfo) Unmarshal(data []byte) error
- type DAGRequest
- func (m *DAGRequest) GetExecutors() []*Executor
- func (m *DAGRequest) GetFlags() uint64
- func (m *DAGRequest) GetOutputOffsets() []uint32
- func (m *DAGRequest) GetStartTs() uint64
- func (m *DAGRequest) GetTimeZoneOffset() int64
- func (m *DAGRequest) Marshal() (data []byte, err error)
- func (m *DAGRequest) MarshalTo(data []byte) (int, error)
- func (*DAGRequest) ProtoMessage()
- func (m *DAGRequest) Reset()
- func (m *DAGRequest) Size() (n int)
- func (m *DAGRequest) String() string
- func (m *DAGRequest) Unmarshal(data []byte) error
- type Error
- func (m *Error) GetCode() int32
- func (m *Error) GetMsg() string
- func (m *Error) Marshal() (data []byte, err error)
- func (m *Error) MarshalTo(data []byte) (int, error)
- func (*Error) ProtoMessage()
- func (m *Error) Reset()
- func (m *Error) Size() (n int)
- func (m *Error) String() string
- func (m *Error) Unmarshal(data []byte) error
- type ExecType
- type Executor
- func (m *Executor) GetAggregation() *Aggregation
- func (m *Executor) GetIdxScan() *IndexScan
- func (m *Executor) GetLimit() *Limit
- func (m *Executor) GetSelection() *Selection
- func (m *Executor) GetTblScan() *TableScan
- func (m *Executor) GetTopN() *TopN
- func (m *Executor) GetTp() ExecType
- func (m *Executor) Marshal() (data []byte, err error)
- func (m *Executor) MarshalTo(data []byte) (int, error)
- func (*Executor) ProtoMessage()
- func (m *Executor) Reset()
- func (m *Executor) Size() (n int)
- func (m *Executor) String() string
- func (m *Executor) Unmarshal(data []byte) error
- type Expr
- func (m *Expr) GetChildren() []*Expr
- func (m *Expr) GetTp() ExprType
- func (m *Expr) GetVal() []byte
- func (m *Expr) Marshal() (data []byte, err error)
- func (m *Expr) MarshalTo(data []byte) (int, error)
- func (*Expr) ProtoMessage()
- func (m *Expr) Reset()
- func (m *Expr) Size() (n int)
- func (m *Expr) String() string
- func (m *Expr) Unmarshal(data []byte) error
- type ExprType
- type IndexInfo
- func (m *IndexInfo) GetColumns() []*ColumnInfo
- func (m *IndexInfo) GetIndexId() int64
- func (m *IndexInfo) GetTableId() int64
- func (m *IndexInfo) GetUnique() bool
- func (m *IndexInfo) Marshal() (data []byte, err error)
- func (m *IndexInfo) MarshalTo(data []byte) (int, error)
- func (*IndexInfo) ProtoMessage()
- func (m *IndexInfo) Reset()
- func (m *IndexInfo) Size() (n int)
- func (m *IndexInfo) String() string
- func (m *IndexInfo) Unmarshal(data []byte) error
- type IndexScan
- func (m *IndexScan) GetColumns() []*ColumnInfo
- func (m *IndexScan) GetDesc() bool
- func (m *IndexScan) GetIndexId() int64
- func (m *IndexScan) GetTableId() int64
- func (m *IndexScan) Marshal() (data []byte, err error)
- func (m *IndexScan) MarshalTo(data []byte) (int, error)
- func (*IndexScan) ProtoMessage()
- func (m *IndexScan) Reset()
- func (m *IndexScan) Size() (n int)
- func (m *IndexScan) String() string
- func (m *IndexScan) Unmarshal(data []byte) error
- type KeyRange
- func (m *KeyRange) GetHigh() []byte
- func (m *KeyRange) GetLow() []byte
- func (m *KeyRange) Marshal() (data []byte, err error)
- func (m *KeyRange) MarshalTo(data []byte) (int, error)
- func (*KeyRange) ProtoMessage()
- func (m *KeyRange) Reset()
- func (m *KeyRange) Size() (n int)
- func (m *KeyRange) String() string
- func (m *KeyRange) Unmarshal(data []byte) error
- type Limit
- type Row
- func (m *Row) GetData() []byte
- func (m *Row) GetHandle() []byte
- func (m *Row) Marshal() (data []byte, err error)
- func (m *Row) MarshalTo(data []byte) (int, error)
- func (*Row) ProtoMessage()
- func (m *Row) Reset()
- func (m *Row) Size() (n int)
- func (m *Row) String() string
- func (m *Row) Unmarshal(data []byte) error
- type RowMeta
- func (m *RowMeta) GetHandle() int64
- func (m *RowMeta) GetLength() int64
- func (m *RowMeta) Marshal() (data []byte, err error)
- func (m *RowMeta) MarshalTo(data []byte) (int, error)
- func (*RowMeta) ProtoMessage()
- func (m *RowMeta) Reset()
- func (m *RowMeta) Size() (n int)
- func (m *RowMeta) String() string
- func (m *RowMeta) Unmarshal(data []byte) error
- type SelectRequest
- func (m *SelectRequest) GetAggregates() []*Expr
- func (m *SelectRequest) GetDistinct() bool
- func (m *SelectRequest) GetFields() []*Expr
- func (m *SelectRequest) GetFlags() uint64
- func (m *SelectRequest) GetGroupBy() []*ByItem
- func (m *SelectRequest) GetHaving() *Expr
- func (m *SelectRequest) GetIndexInfo() *IndexInfo
- func (m *SelectRequest) GetLimit() int64
- func (m *SelectRequest) GetOrderBy() []*ByItem
- func (m *SelectRequest) GetRanges() []*KeyRange
- func (m *SelectRequest) GetStartTs() uint64
- func (m *SelectRequest) GetTableInfo() *TableInfo
- func (m *SelectRequest) GetTimeZoneOffset() int64
- func (m *SelectRequest) GetWhere() *Expr
- func (m *SelectRequest) Marshal() (data []byte, err error)
- func (m *SelectRequest) MarshalTo(data []byte) (int, error)
- func (*SelectRequest) ProtoMessage()
- func (m *SelectRequest) Reset()
- func (m *SelectRequest) Size() (n int)
- func (m *SelectRequest) String() string
- func (m *SelectRequest) Unmarshal(data []byte) error
- type SelectResponse
- func (m *SelectResponse) GetChunks() []Chunk
- func (m *SelectResponse) GetError() *Error
- func (m *SelectResponse) GetRows() []*Row
- func (m *SelectResponse) GetWarnings() []*Error
- func (m *SelectResponse) Marshal() (data []byte, err error)
- func (m *SelectResponse) MarshalTo(data []byte) (int, error)
- func (*SelectResponse) ProtoMessage()
- func (m *SelectResponse) Reset()
- func (m *SelectResponse) Size() (n int)
- func (m *SelectResponse) String() string
- func (m *SelectResponse) Unmarshal(data []byte) error
- type Selection
- func (m *Selection) GetConditions() []*Expr
- func (m *Selection) Marshal() (data []byte, err error)
- func (m *Selection) MarshalTo(data []byte) (int, error)
- func (*Selection) ProtoMessage()
- func (m *Selection) Reset()
- func (m *Selection) Size() (n int)
- func (m *Selection) String() string
- func (m *Selection) Unmarshal(data []byte) error
- type TableInfo
- func (m *TableInfo) GetColumns() []*ColumnInfo
- func (m *TableInfo) GetTableId() int64
- func (m *TableInfo) Marshal() (data []byte, err error)
- func (m *TableInfo) MarshalTo(data []byte) (int, error)
- func (*TableInfo) ProtoMessage()
- func (m *TableInfo) Reset()
- func (m *TableInfo) Size() (n int)
- func (m *TableInfo) String() string
- func (m *TableInfo) Unmarshal(data []byte) error
- type TableScan
- func (m *TableScan) GetColumns() []*ColumnInfo
- func (m *TableScan) GetDesc() bool
- func (m *TableScan) GetTableId() int64
- func (m *TableScan) Marshal() (data []byte, err error)
- func (m *TableScan) MarshalTo(data []byte) (int, error)
- func (*TableScan) ProtoMessage()
- func (m *TableScan) Reset()
- func (m *TableScan) Size() (n int)
- func (m *TableScan) String() string
- func (m *TableScan) Unmarshal(data []byte) error
- type TopN
- func (m *TopN) GetLimit() uint64
- func (m *TopN) GetOrderBy() []*ByItem
- func (m *TopN) Marshal() (data []byte, err error)
- func (m *TopN) MarshalTo(data []byte) (int, error)
- func (*TopN) ProtoMessage()
- func (m *TopN) Reset()
- func (m *TopN) Size() (n int)
- func (m *TopN) String() string
- func (m *TopN) Unmarshal(data []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidLengthExecutor = fmt.Errorf("proto: negative length found during unmarshaling")
)
View Source
var (
ErrInvalidLengthExpression = fmt.Errorf("proto: negative length found during unmarshaling")
)
View Source
var (
ErrInvalidLengthSchema = fmt.Errorf("proto: negative length found during unmarshaling")
)
View Source
var (
ErrInvalidLengthSelect = fmt.Errorf("proto: negative length found during unmarshaling")
)
View Source
var ExecType_name = map[int32]string{
0: "TypeTableScan",
1: "TypeIndexScan",
2: "TypeSelection",
3: "TypeAggregation",
4: "TypeTopN",
5: "TypeLimit",
}
View Source
var ExecType_value = map[string]int32{
"TypeTableScan": 0,
"TypeIndexScan": 1,
"TypeSelection": 2,
"TypeAggregation": 3,
"TypeTopN": 4,
"TypeLimit": 5,
}
View Source
var ExprType_name = map[int32]string{
0: "Null",
1: "Int64",
2: "Uint64",
3: "Float32",
4: "Float64",
5: "String",
6: "Bytes",
101: "MysqlBit",
102: "MysqlDecimal",
103: "MysqlDuration",
104: "MysqlEnum",
105: "MysqlHex",
106: "MysqlSet",
107: "MysqlTime",
151: "ValueList",
201: "ColumnRef",
1001: "Not",
1002: "Neg",
1003: "BitNeg",
2001: "LT",
2002: "LE",
2003: "EQ",
2004: "NE",
2005: "GE",
2006: "GT",
2007: "NullEQ",
2101: "BitAnd",
2102: "BitOr",
2103: "BitXor",
2104: "LeftShift",
2105: "RighShift",
2201: "Plus",
2202: "Minus",
2203: "Mul",
2204: "Div",
2205: "IntDiv",
2206: "Mod",
2301: "And",
2302: "Or",
2303: "Xor",
3001: "Count",
3002: "Sum",
3003: "Avg",
3004: "Min",
3005: "Max",
3006: "First",
3007: "GroupConcat",
3101: "Abs",
3102: "Pow",
3103: "Round",
3201: "Concat",
3202: "ConcatWS",
3203: "Left",
3204: "Length",
3205: "Lower",
3206: "Repeat",
3207: "Replace",
3208: "Upper",
3209: "Strcmp",
3210: "Convert",
3211: "Cast",
3212: "Substring",
3213: "SubstringIndex",
3214: "Locate",
3215: "Trim",
3301: "If",
3302: "NullIf",
3303: "IfNull",
3401: "Date",
3402: "DateAdd",
3403: "DateSub",
3411: "Year",
3412: "YearWeek",
3421: "Month",
3431: "Week",
3432: "Weekday",
3433: "WeekOfYear",
3441: "Day",
3442: "DayName",
3443: "DayOfYear",
3444: "DayOfMonth",
3445: "DayOfWeek",
3451: "Hour",
3452: "Minute",
3453: "Second",
3454: "Microsecond",
3461: "Extract",
3501: "Coalesce",
3502: "Greatest",
3503: "Least",
4001: "In",
4002: "IsTruth",
4003: "IsNull",
4004: "ExprRow",
4005: "Like",
4006: "RLike",
4007: "Case",
}
View Source
var ExprType_value = map[string]int32{
"Null": 0,
"Int64": 1,
"Uint64": 2,
"Float32": 3,
"Float64": 4,
"String": 5,
"Bytes": 6,
"MysqlBit": 101,
"MysqlDecimal": 102,
"MysqlDuration": 103,
"MysqlEnum": 104,
"MysqlHex": 105,
"MysqlSet": 106,
"MysqlTime": 107,
"ValueList": 151,
"ColumnRef": 201,
"Not": 1001,
"Neg": 1002,
"BitNeg": 1003,
"LT": 2001,
"LE": 2002,
"EQ": 2003,
"NE": 2004,
"GE": 2005,
"GT": 2006,
"NullEQ": 2007,
"BitAnd": 2101,
"BitOr": 2102,
"BitXor": 2103,
"LeftShift": 2104,
"RighShift": 2105,
"Plus": 2201,
"Minus": 2202,
"Mul": 2203,
"Div": 2204,
"IntDiv": 2205,
"Mod": 2206,
"And": 2301,
"Or": 2302,
"Xor": 2303,
"Count": 3001,
"Sum": 3002,
"Avg": 3003,
"Min": 3004,
"Max": 3005,
"First": 3006,
"GroupConcat": 3007,
"Abs": 3101,
"Pow": 3102,
"Round": 3103,
"Concat": 3201,
"ConcatWS": 3202,
"Left": 3203,
"Length": 3204,
"Lower": 3205,
"Repeat": 3206,
"Replace": 3207,
"Upper": 3208,
"Strcmp": 3209,
"Convert": 3210,
"Cast": 3211,
"Substring": 3212,
"SubstringIndex": 3213,
"Locate": 3214,
"Trim": 3215,
"If": 3301,
"NullIf": 3302,
"IfNull": 3303,
"Date": 3401,
"DateAdd": 3402,
"DateSub": 3403,
"Year": 3411,
"YearWeek": 3412,
"Month": 3421,
"Week": 3431,
"Weekday": 3432,
"WeekOfYear": 3433,
"Day": 3441,
"DayName": 3442,
"DayOfYear": 3443,
"DayOfMonth": 3444,
"DayOfWeek": 3445,
"Hour": 3451,
"Minute": 3452,
"Second": 3453,
"Microsecond": 3454,
"Extract": 3461,
"Coalesce": 3501,
"Greatest": 3502,
"Least": 3503,
"In": 4001,
"IsTruth": 4002,
"IsNull": 4003,
"ExprRow": 4004,
"Like": 4005,
"RLike": 4006,
"Case": 4007,
}
Functions ¶
This section is empty.
Types ¶
type Aggregation ¶
type Aggregation struct { // Group by clause. GroupBy []*Expr `protobuf:"bytes,1,rep,name=group_by" json:"group_by,omitempty"` // Aggregate functions. AggFunc []*Expr `protobuf:"bytes,2,rep,name=agg_func" json:"agg_func,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*Aggregation) GetAggFunc ¶
func (m *Aggregation) GetAggFunc() []*Expr
func (*Aggregation) GetGroupBy ¶
func (m *Aggregation) GetGroupBy() []*Expr
func (*Aggregation) Marshal ¶
func (m *Aggregation) Marshal() (data []byte, err error)
func (*Aggregation) ProtoMessage ¶
func (*Aggregation) ProtoMessage()
func (*Aggregation) Reset ¶
func (m *Aggregation) Reset()
func (*Aggregation) Size ¶
func (m *Aggregation) Size() (n int)
func (*Aggregation) String ¶
func (m *Aggregation) String() string
func (*Aggregation) Unmarshal ¶
func (m *Aggregation) Unmarshal(data []byte) error
type ByItem ¶
type ByItem struct { Expr *Expr `protobuf:"bytes,1,opt,name=expr" json:"expr,omitempty"` Desc bool `protobuf:"varint,2,opt,name=desc" json:"desc"` XXX_unrecognized []byte `json:"-"` }
ByItem type for group by and order by.
func (*ByItem) ProtoMessage ¶
func (*ByItem) ProtoMessage()
type Chunk ¶
type Chunk struct { // Data for all rows in the chunk. RowsData github_com_pingcap_tipb_sharedbytes.SharedBytes `protobuf:"bytes,3,opt,name=rows_data,customtype=github.com/pingcap/tipb/sharedbytes.SharedBytes" json:"rows_data"` // Meta data for every row. RowsMeta []RowMeta `protobuf:"bytes,4,rep,name=rows_meta" json:"rows_meta"` XXX_unrecognized []byte `json:"-"` }
Chunk contains multiple rows data and rows meta.
func (*Chunk) GetRowsMeta ¶
func (*Chunk) ProtoMessage ¶
func (*Chunk) ProtoMessage()
type ColumnInfo ¶
type ColumnInfo struct { ColumnId int64 `protobuf:"varint,1,opt,name=column_id" json:"column_id"` Tp int32 `protobuf:"varint,2,opt,name=tp" json:"tp"` Collation int32 `protobuf:"varint,3,opt,name=collation" json:"collation"` ColumnLen int32 `protobuf:"varint,4,opt,name=columnLen" json:"columnLen"` Decimal int32 `protobuf:"varint,5,opt,name=decimal" json:"decimal"` Flag int32 `protobuf:"varint,6,opt,name=flag" json:"flag"` Elems []string `protobuf:"bytes,7,rep,name=elems" json:"elems,omitempty"` DefaultVal []byte `protobuf:"bytes,8,opt,name=default_val" json:"default_val,omitempty"` PkHandle bool `protobuf:"varint,21,opt,name=pk_handle" json:"pk_handle"` XXX_unrecognized []byte `json:"-"` }
func (*ColumnInfo) GetCollation ¶
func (m *ColumnInfo) GetCollation() int32
func (*ColumnInfo) GetColumnId ¶
func (m *ColumnInfo) GetColumnId() int64
func (*ColumnInfo) GetColumnLen ¶
func (m *ColumnInfo) GetColumnLen() int32
func (*ColumnInfo) GetDecimal ¶
func (m *ColumnInfo) GetDecimal() int32
func (*ColumnInfo) GetDefaultVal ¶
func (m *ColumnInfo) GetDefaultVal() []byte
func (*ColumnInfo) GetElems ¶
func (m *ColumnInfo) GetElems() []string
func (*ColumnInfo) GetFlag ¶
func (m *ColumnInfo) GetFlag() int32
func (*ColumnInfo) GetPkHandle ¶
func (m *ColumnInfo) GetPkHandle() bool
func (*ColumnInfo) GetTp ¶
func (m *ColumnInfo) GetTp() int32
func (*ColumnInfo) Marshal ¶
func (m *ColumnInfo) Marshal() (data []byte, err error)
func (*ColumnInfo) ProtoMessage ¶
func (*ColumnInfo) ProtoMessage()
func (*ColumnInfo) Reset ¶
func (m *ColumnInfo) Reset()
func (*ColumnInfo) Size ¶
func (m *ColumnInfo) Size() (n int)
func (*ColumnInfo) String ¶
func (m *ColumnInfo) String() string
func (*ColumnInfo) Unmarshal ¶
func (m *ColumnInfo) Unmarshal(data []byte) error
type DAGRequest ¶
type DAGRequest struct { // Transaction start timestamp. StartTs uint64 `protobuf:"varint,1,opt,name=start_ts" json:"start_ts"` // It represents push down Executors. Executors []*Executor `protobuf:"bytes,2,rep,name=executors" json:"executors,omitempty"` // time zone offset in seconds TimeZoneOffset int64 `protobuf:"varint,3,opt,name=time_zone_offset" json:"time_zone_offset"` // flags are used to store flags that change the execution mode, it contains: // ignore_truncate = 1 // truncate error should be ignore if set. // truncate_as_warning = 1 << 1 // when ignored_truncate is not set, return warning instead of error if this flag is set. // ... // add more when needed. Flags uint64 `protobuf:"varint,4,opt,name=flags" json:"flags"` // It represents which columns we should output OutputOffsets []uint32 `protobuf:"varint,5,rep,name=output_offsets" json:"output_offsets,omitempty"` XXX_unrecognized []byte `json:"-"` }
DAGRequest represents the request that will be handled with DAG mode.
func (*DAGRequest) GetExecutors ¶
func (m *DAGRequest) GetExecutors() []*Executor
func (*DAGRequest) GetFlags ¶
func (m *DAGRequest) GetFlags() uint64
func (*DAGRequest) GetOutputOffsets ¶
func (m *DAGRequest) GetOutputOffsets() []uint32
func (*DAGRequest) GetStartTs ¶
func (m *DAGRequest) GetStartTs() uint64
func (*DAGRequest) GetTimeZoneOffset ¶
func (m *DAGRequest) GetTimeZoneOffset() int64
func (*DAGRequest) Marshal ¶
func (m *DAGRequest) Marshal() (data []byte, err error)
func (*DAGRequest) ProtoMessage ¶
func (*DAGRequest) ProtoMessage()
func (*DAGRequest) Reset ¶
func (m *DAGRequest) Reset()
func (*DAGRequest) Size ¶
func (m *DAGRequest) Size() (n int)
func (*DAGRequest) String ¶
func (m *DAGRequest) String() string
func (*DAGRequest) Unmarshal ¶
func (m *DAGRequest) Unmarshal(data []byte) error
type Error ¶
type Error struct { Code int32 `protobuf:"varint,1,opt,name=code" json:"code"` Msg string `protobuf:"bytes,2,opt,name=msg" json:"msg"` XXX_unrecognized []byte `json:"-"` }
func (*Error) ProtoMessage ¶
func (*Error) ProtoMessage()
type Executor ¶
type Executor struct { Tp ExecType `protobuf:"varint,1,opt,name=tp,enum=tipb.ExecType" json:"tp"` TblScan *TableScan `protobuf:"bytes,2,opt,name=tbl_scan" json:"tbl_scan,omitempty"` IdxScan *IndexScan `protobuf:"bytes,3,opt,name=idx_scan" json:"idx_scan,omitempty"` Selection *Selection `protobuf:"bytes,4,opt,name=selection" json:"selection,omitempty"` Aggregation *Aggregation `protobuf:"bytes,5,opt,name=aggregation" json:"aggregation,omitempty"` TopN *TopN `protobuf:"bytes,6,opt,name=topN" json:"topN,omitempty"` Limit *Limit `protobuf:"bytes,7,opt,name=limit" json:"limit,omitempty"` XXX_unrecognized []byte `json:"-"` }
It represents a Executor.
func (*Executor) GetAggregation ¶
func (m *Executor) GetAggregation() *Aggregation
func (*Executor) GetIdxScan ¶
func (*Executor) GetSelection ¶
func (*Executor) GetTblScan ¶
func (*Executor) ProtoMessage ¶
func (*Executor) ProtoMessage()
type Expr ¶
type Expr struct { Tp ExprType `protobuf:"varint,1,opt,name=tp,enum=tipb.ExprType" json:"tp"` Val []byte `protobuf:"bytes,2,opt,name=val" json:"val,omitempty"` Children []*Expr `protobuf:"bytes,3,rep,name=children" json:"children,omitempty"` XXX_unrecognized []byte `json:"-"` }
Evaluators should implement evaluation functions for every expression type.
func (*Expr) GetChildren ¶
func (*Expr) ProtoMessage ¶
func (*Expr) ProtoMessage()
type ExprType ¶
type ExprType int32
const ( // Values are encoded bytes. ExprType_Null ExprType = 0 ExprType_Int64 ExprType = 1 ExprType_Uint64 ExprType = 2 ExprType_Float32 ExprType = 3 ExprType_Float64 ExprType = 4 ExprType_String ExprType = 5 ExprType_Bytes ExprType = 6 // Mysql specific types. ExprType_MysqlBit ExprType = 101 ExprType_MysqlDecimal ExprType = 102 ExprType_MysqlDuration ExprType = 103 ExprType_MysqlEnum ExprType = 104 ExprType_MysqlHex ExprType = 105 ExprType_MysqlSet ExprType = 106 ExprType_MysqlTime ExprType = 107 // Encoded value list. ExprType_ValueList ExprType = 151 // Column reference. value is int64 column ID. ExprType_ColumnRef ExprType = 201 // Unary operations, children count 1. ExprType_Not ExprType = 1001 ExprType_Neg ExprType = 1002 ExprType_BitNeg ExprType = 1003 // Comparison operations. ExprType_LT ExprType = 2001 ExprType_LE ExprType = 2002 ExprType_EQ ExprType = 2003 ExprType_NE ExprType = 2004 ExprType_GE ExprType = 2005 ExprType_GT ExprType = 2006 ExprType_NullEQ ExprType = 2007 // Bit operations. ExprType_BitAnd ExprType = 2101 ExprType_BitOr ExprType = 2102 ExprType_BitXor ExprType = 2103 ExprType_LeftShift ExprType = 2104 ExprType_RighShift ExprType = 2105 // Arithmatic. ExprType_Plus ExprType = 2201 ExprType_Minus ExprType = 2202 ExprType_Mul ExprType = 2203 ExprType_Div ExprType = 2204 ExprType_IntDiv ExprType = 2205 ExprType_Mod ExprType = 2206 // Logic operations. ExprType_And ExprType = 2301 ExprType_Or ExprType = 2302 ExprType_Xor ExprType = 2303 // Aggregate functions. ExprType_Count ExprType = 3001 ExprType_Sum ExprType = 3002 ExprType_Avg ExprType = 3003 ExprType_Min ExprType = 3004 ExprType_Max ExprType = 3005 ExprType_First ExprType = 3006 ExprType_GroupConcat ExprType = 3007 // Math functions. ExprType_Abs ExprType = 3101 ExprType_Pow ExprType = 3102 ExprType_Round ExprType = 3103 // String functions. ExprType_Concat ExprType = 3201 ExprType_ConcatWS ExprType = 3202 ExprType_Left ExprType = 3203 ExprType_Length ExprType = 3204 ExprType_Lower ExprType = 3205 ExprType_Repeat ExprType = 3206 ExprType_Replace ExprType = 3207 ExprType_Upper ExprType = 3208 ExprType_Strcmp ExprType = 3209 ExprType_Convert ExprType = 3210 ExprType_Cast ExprType = 3211 ExprType_Substring ExprType = 3212 ExprType_SubstringIndex ExprType = 3213 ExprType_Locate ExprType = 3214 ExprType_Trim ExprType = 3215 // Control flow functions. ExprType_If ExprType = 3301 ExprType_NullIf ExprType = 3302 ExprType_IfNull ExprType = 3303 // Time functions. ExprType_Date ExprType = 3401 ExprType_DateAdd ExprType = 3402 ExprType_DateSub ExprType = 3403 ExprType_Year ExprType = 3411 ExprType_YearWeek ExprType = 3412 ExprType_Month ExprType = 3421 ExprType_Week ExprType = 3431 ExprType_Weekday ExprType = 3432 ExprType_WeekOfYear ExprType = 3433 ExprType_Day ExprType = 3441 ExprType_DayName ExprType = 3442 ExprType_DayOfYear ExprType = 3443 ExprType_DayOfMonth ExprType = 3444 ExprType_DayOfWeek ExprType = 3445 ExprType_Hour ExprType = 3451 ExprType_Minute ExprType = 3452 ExprType_Second ExprType = 3453 ExprType_Microsecond ExprType = 3454 ExprType_Extract ExprType = 3461 // Other functions; ExprType_Coalesce ExprType = 3501 ExprType_Greatest ExprType = 3502 ExprType_Least ExprType = 3503 // Other expressions. ExprType_In ExprType = 4001 ExprType_IsTruth ExprType = 4002 ExprType_IsNull ExprType = 4003 ExprType_ExprRow ExprType = 4004 ExprType_Like ExprType = 4005 ExprType_RLike ExprType = 4006 ExprType_Case ExprType = 4007 )
func (*ExprType) UnmarshalJSON ¶
type IndexInfo ¶
type IndexInfo struct { TableId int64 `protobuf:"varint,1,opt,name=table_id" json:"table_id"` IndexId int64 `protobuf:"varint,2,opt,name=index_id" json:"index_id"` Columns []*ColumnInfo `protobuf:"bytes,3,rep,name=columns" json:"columns,omitempty"` Unique bool `protobuf:"varint,4,opt,name=unique" json:"unique"` XXX_unrecognized []byte `json:"-"` }
func (*IndexInfo) GetColumns ¶
func (m *IndexInfo) GetColumns() []*ColumnInfo
func (*IndexInfo) GetIndexId ¶
func (*IndexInfo) GetTableId ¶
func (*IndexInfo) ProtoMessage ¶
func (*IndexInfo) ProtoMessage()
type IndexScan ¶
type IndexScan struct { TableId int64 `protobuf:"varint,1,opt,name=table_id" json:"table_id"` IndexId int64 `protobuf:"varint,2,opt,name=index_id" json:"index_id"` Columns []*ColumnInfo `protobuf:"bytes,3,rep,name=columns" json:"columns,omitempty"` Desc bool `protobuf:"varint,4,opt,name=desc" json:"desc"` XXX_unrecognized []byte `json:"-"` }
func (*IndexScan) GetColumns ¶
func (m *IndexScan) GetColumns() []*ColumnInfo
func (*IndexScan) GetIndexId ¶
func (*IndexScan) GetTableId ¶
func (*IndexScan) ProtoMessage ¶
func (*IndexScan) ProtoMessage()
type KeyRange ¶
type KeyRange struct { Low []byte `protobuf:"bytes,1,opt,name=low" json:"low,omitempty"` High []byte `protobuf:"bytes,2,opt,name=high" json:"high,omitempty"` XXX_unrecognized []byte `json:"-"` }
KeyRange is the encoded index key range, low is closed, high is open. (low <= x < high)
func (*KeyRange) ProtoMessage ¶
func (*KeyRange) ProtoMessage()
type Limit ¶
type Limit struct { // Limit the result to be returned. Limit uint64 `protobuf:"varint,1,opt,name=limit" json:"limit"` XXX_unrecognized []byte `json:"-"` }
func (*Limit) ProtoMessage ¶
func (*Limit) ProtoMessage()
type Row ¶
type Row struct { Handle []byte `protobuf:"bytes,1,opt,name=handle" json:"handle,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data" json:"data,omitempty"` XXX_unrecognized []byte `json:"-"` }
values are all in text format.
func (*Row) ProtoMessage ¶
func (*Row) ProtoMessage()
type RowMeta ¶
type RowMeta struct { Handle int64 `protobuf:"varint,1,opt,name=handle" json:"handle"` Length int64 `protobuf:"varint,2,opt,name=length" json:"length"` XXX_unrecognized []byte `json:"-"` }
RowMeta contains row handle and length of a row.
func (*RowMeta) ProtoMessage ¶
func (*RowMeta) ProtoMessage()
type SelectRequest ¶
type SelectRequest struct { // transaction start timestamp. StartTs uint64 `protobuf:"varint,1,opt,name=start_ts" json:"start_ts"` // If table_info is not null, it represents a table scan, index_info would be null. TableInfo *TableInfo `protobuf:"bytes,2,opt,name=table_info" json:"table_info,omitempty"` // If index_info is not null, it represents an index scan, table_info would be null. IndexInfo *IndexInfo `protobuf:"bytes,3,opt,name=index_info" json:"index_info,omitempty"` // fields to be selected, fields type can be column reference for simple scan. // or aggregation function. If no fields specified, only handle will be returned. Fields []*Expr `protobuf:"bytes,4,rep,name=fields" json:"fields,omitempty"` // disjoint handle ranges to be scanned. Ranges []*KeyRange `protobuf:"bytes,5,rep,name=ranges" json:"ranges,omitempty"` // distinct result. Distinct bool `protobuf:"varint,6,opt,name=distinct" json:"distinct"` // where condition. Where *Expr `protobuf:"bytes,7,opt,name=where" json:"where,omitempty"` // group by clause. GroupBy []*ByItem `protobuf:"bytes,8,rep,name=group_by" json:"group_by,omitempty"` // having clause. Having *Expr `protobuf:"bytes,9,opt,name=having" json:"having,omitempty"` // order by clause. OrderBy []*ByItem `protobuf:"bytes,10,rep,name=order_by" json:"order_by,omitempty"` // limit the result to be returned. Limit *int64 `protobuf:"varint,12,opt,name=limit" json:"limit,omitempty"` // aggregate functions Aggregates []*Expr `protobuf:"bytes,13,rep,name=aggregates" json:"aggregates,omitempty"` // time zone offset in seconds TimeZoneOffset int64 `protobuf:"varint,14,opt,name=time_zone_offset" json:"time_zone_offset"` // flags is used to store flags that change the execution mode, it contains: // ignore_truncate = 1 // truncate error should be ignore if set. // truncate_as_warning = 1 << 1 // when ignored_truncate is not set, return warning instead of error if this flag is set. // ... // add more when needed. Flags uint64 `protobuf:"varint,15,opt,name=flags" json:"flags"` XXX_unrecognized []byte `json:"-"` }
SelectRequest works like a simplified select statement.
func (*SelectRequest) GetAggregates ¶
func (m *SelectRequest) GetAggregates() []*Expr
func (*SelectRequest) GetDistinct ¶
func (m *SelectRequest) GetDistinct() bool
func (*SelectRequest) GetFields ¶
func (m *SelectRequest) GetFields() []*Expr
func (*SelectRequest) GetFlags ¶
func (m *SelectRequest) GetFlags() uint64
func (*SelectRequest) GetGroupBy ¶
func (m *SelectRequest) GetGroupBy() []*ByItem
func (*SelectRequest) GetHaving ¶
func (m *SelectRequest) GetHaving() *Expr
func (*SelectRequest) GetIndexInfo ¶
func (m *SelectRequest) GetIndexInfo() *IndexInfo
func (*SelectRequest) GetLimit ¶
func (m *SelectRequest) GetLimit() int64
func (*SelectRequest) GetOrderBy ¶
func (m *SelectRequest) GetOrderBy() []*ByItem
func (*SelectRequest) GetRanges ¶
func (m *SelectRequest) GetRanges() []*KeyRange
func (*SelectRequest) GetStartTs ¶
func (m *SelectRequest) GetStartTs() uint64
func (*SelectRequest) GetTableInfo ¶
func (m *SelectRequest) GetTableInfo() *TableInfo
func (*SelectRequest) GetTimeZoneOffset ¶
func (m *SelectRequest) GetTimeZoneOffset() int64
func (*SelectRequest) GetWhere ¶
func (m *SelectRequest) GetWhere() *Expr
func (*SelectRequest) Marshal ¶
func (m *SelectRequest) Marshal() (data []byte, err error)
func (*SelectRequest) ProtoMessage ¶
func (*SelectRequest) ProtoMessage()
func (*SelectRequest) Reset ¶
func (m *SelectRequest) Reset()
func (*SelectRequest) Size ¶
func (m *SelectRequest) Size() (n int)
func (*SelectRequest) String ¶
func (m *SelectRequest) String() string
func (*SelectRequest) Unmarshal ¶
func (m *SelectRequest) Unmarshal(data []byte) error
type SelectResponse ¶
type SelectResponse struct { Error *Error `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"` // Result rows. Rows []*Row `protobuf:"bytes,2,rep,name=rows" json:"rows,omitempty"` // Use multiple chunks to reduce memory allocation and // avoid allocating large contiguous memory. Chunks []Chunk `protobuf:"bytes,3,rep,name=chunks" json:"chunks"` Warnings []*Error `protobuf:"bytes,4,rep,name=warnings" json:"warnings,omitempty"` XXX_unrecognized []byte `json:"-"` }
Response for SelectRequest.
func (*SelectResponse) GetChunks ¶
func (m *SelectResponse) GetChunks() []Chunk
func (*SelectResponse) GetError ¶
func (m *SelectResponse) GetError() *Error
func (*SelectResponse) GetRows ¶
func (m *SelectResponse) GetRows() []*Row
func (*SelectResponse) GetWarnings ¶
func (m *SelectResponse) GetWarnings() []*Error
func (*SelectResponse) Marshal ¶
func (m *SelectResponse) Marshal() (data []byte, err error)
func (*SelectResponse) ProtoMessage ¶
func (*SelectResponse) ProtoMessage()
func (*SelectResponse) Reset ¶
func (m *SelectResponse) Reset()
func (*SelectResponse) Size ¶
func (m *SelectResponse) Size() (n int)
func (*SelectResponse) String ¶
func (m *SelectResponse) String() string
func (*SelectResponse) Unmarshal ¶
func (m *SelectResponse) Unmarshal(data []byte) error
type Selection ¶
type Selection struct { // Where conditions. Conditions []*Expr `protobuf:"bytes,1,rep,name=conditions" json:"conditions,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*Selection) GetConditions ¶
func (*Selection) ProtoMessage ¶
func (*Selection) ProtoMessage()
type TableInfo ¶
type TableInfo struct { TableId int64 `protobuf:"varint,1,opt,name=table_id" json:"table_id"` Columns []*ColumnInfo `protobuf:"bytes,2,rep,name=columns" json:"columns,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*TableInfo) GetColumns ¶
func (m *TableInfo) GetColumns() []*ColumnInfo
func (*TableInfo) GetTableId ¶
func (*TableInfo) ProtoMessage ¶
func (*TableInfo) ProtoMessage()
type TableScan ¶
type TableScan struct { TableId int64 `protobuf:"varint,1,opt,name=table_id" json:"table_id"` Columns []*ColumnInfo `protobuf:"bytes,2,rep,name=columns" json:"columns,omitempty"` Desc bool `protobuf:"varint,3,opt,name=desc" json:"desc"` XXX_unrecognized []byte `json:"-"` }
func (*TableScan) GetColumns ¶
func (m *TableScan) GetColumns() []*ColumnInfo
func (*TableScan) GetTableId ¶
func (*TableScan) ProtoMessage ¶
func (*TableScan) ProtoMessage()
type TopN ¶
type TopN struct { // Order by clause. OrderBy []*ByItem `protobuf:"bytes,1,rep,name=order_by" json:"order_by,omitempty"` Limit uint64 `protobuf:"varint,2,opt,name=limit" json:"limit"` XXX_unrecognized []byte `json:"-"` }
func (*TopN) GetOrderBy ¶
func (*TopN) ProtoMessage ¶
func (*TopN) ProtoMessage()
Click to show internal directories.
Click to hide internal directories.