Documentation ¶
Overview ¶
Package plan is a generated GoMock package.
Index ¶
- Constants
- Variables
- func AddColumn(ctx CompilerContext, alterPlan *plan.AlterTable, spec *tree.AlterAddCol, ...) error
- func AddPrimaryKey(ctx CompilerContext, alterPlan *plan.AlterTable, spec *tree.PrimaryKeyIndex, ...) error
- func AlterColumn(ctx CompilerContext, alterPlan *plan.AlterTable, ...) error
- func AssignAuxIdForExpr(expr *plan.Expr, start int32) int32
- func BuildVectorsByData(datas [][2]any, dataTypes []uint8, mp *mpool.MPool) []*vector.Vector
- func ChangeColumn(ctx CompilerContext, alterPlan *plan.AlterTable, ...) error
- func CheckColumnNameValid(ctx context.Context, colName string) error
- func CheckExprIsMonotonic(ctx context.Context, expr *plan.Expr) bool
- func CheckFunctionFilter(expr *plan.Expr) (b bool, col *ColRef, constExpr *Const, childFuncName string)
- func CheckModifyColumnForeignkeyConstraint(ctx CompilerContext, tbInfo *TableDef, originalCol, newCol *ColDef) error
- func CheckStrictFilter(expr *plan.Expr) (b bool, col *ColRef, constExpr *Const, funcName string)
- func ConstantFold(bat *batch.Batch, e *plan.Expr, proc *process.Process, varAndParamIsConst bool) (*plan.Expr, error)
- func DeepCopyAnalyzeInfo(analyzeinfo *plan.AnalyzeInfo) *plan.AnalyzeInfo
- func DeepCopyClusterTable(cluster *plan.ClusterTable) *plan.ClusterTable
- func DeepCopyColData(col *plan.ColData) *plan.ColData
- func DeepCopyColDef(col *plan.ColDef) *plan.ColDef
- func DeepCopyDataDefinition(old *plan.DataDefinition) *plan.DataDefinition
- func DeepCopyDefault(def *plan.Default) *plan.Default
- func DeepCopyDeleteCtx(ctx *plan.DeleteCtx) *plan.DeleteCtx
- func DeepCopyIndexDef(indexDef *plan.IndexDef) *plan.IndexDef
- func DeepCopyInsertCtx(ctx *plan.InsertCtx) *plan.InsertCtx
- func DeepCopyLockTarget(target *plan.LockTarget) *plan.LockTarget
- func DeepCopyNode(node *plan.Node) *plan.Node
- func DeepCopyNumberList[T constraints.Integer](src []T) []T
- func DeepCopyObjectRef(ref *plan.ObjectRef) *plan.ObjectRef
- func DeepCopyOnDupliateKeyCtx(ctx *plan.OnDuplicateKeyCtx) *plan.OnDuplicateKeyCtx
- func DeepCopyOnUpdate(old *plan.OnUpdate) *plan.OnUpdate
- func DeepCopyOrderBy(orderBy *plan.OrderBySpec) *plan.OrderBySpec
- func DeepCopyPreDeleteCtx(ctx *plan.PreDeleteCtx) *plan.PreDeleteCtx
- func DeepCopyPreInsertCtx(ctx *plan.PreInsertCtx) *plan.PreInsertCtx
- func DeepCopyPreInsertUkCtx(ctx *plan.PreInsertUkCtx) *plan.PreInsertUkCtx
- func DeepCopyPrimaryKeyDef(pkeyDef *plan.PrimaryKeyDef) *plan.PrimaryKeyDef
- func DeepCopyQuery(qry *plan.Query) *plan.Query
- func DeepCopyStats(stats *plan.Stats) *plan.Stats
- func DeepCopyStringList(src []string) []string
- func DeepCopyTableDef(table *plan.TableDef) *plan.TableDef
- func DeepCopyTableDefList(src []*plan.TableDef) []*plan.TableDef
- func DeepCopyType(typ *plan.Type) *plan.Type
- func DefaultHugeStats() *plan.Stats
- func DefaultStats() *plan.Stats
- func DefaultValueIsNull(Default *plan.Default) bool
- func DropColumn(ctx CompilerContext, alterPlan *plan.AlterTable, colName string, ...) error
- func DropPrimaryKey(ctx CompilerContext, alterPlan *plan.AlterTable, alterCtx *AlterTableContext) error
- func EvalFilterExpr(ctx context.Context, expr *plan.Expr, bat *batch.Batch, proc *process.Process) (bool, error)
- func EvalPlanExpr(ctx context.Context, expr *plan.Expr, process *process.Process) (*plan.Expr, error)
- func ExtractToDateReturnType(format string) (tp types.T, fsp int)
- func FormatExpr(expr *plan.Expr) string
- func GetBindings(expr *plan.Expr) []int32
- func GetColumnMapByExpr(expr *plan.Expr, tableDef *plan.TableDef, columnMap *map[int]int)
- func GetColumnMapByExprs(exprs []*plan.Expr, tableDef *plan.TableDef, columnMap *map[int]int)
- func GetColumnsByExpr(expr *plan.Expr, tableDef *plan.TableDef) (columnMap map[int]int, defColumns, exprColumns []int, maxCol int)
- func GetForETLWithType(param *tree.ExternParam, prefix string) (res fileservice.ETLFileService, readPath string, err error)
- func GetHashColumn(expr *plan.Expr) (*plan.ColRef, int32)
- func GetRangeShuffleIndexForZM(minVal, maxVal int64, zm objectio.ZoneMap, upplerLimit uint64) uint64
- func GetRangeShuffleIndexSigned(minVal, maxVal, currentVal int64, upplerLimit uint64) uint64
- func GetRangeShuffleIndexUnsigned(minVal, maxVal, currentVal uint64, upplerLimit uint64) uint64
- func GetShuffleDop() (dop int)
- func GetSortOrder(tableDef *plan.TableDef, colName string) int
- func GetUniqueColAndIdxFromTableDef(tableDef *TableDef) []map[string]int
- func GetVarValue(ctx context.Context, compCtx CompilerContext, proc *process.Process, ...) (*plan.Expr, error)
- func HasColExpr(expr *plan.Expr, pos int32) int32
- func InitInfileParam(param *tree.ExternParam) error
- func InitNullMap(param *tree.ExternParam, ctx CompilerContext) error
- func InitS3Param(param *tree.ExternParam) error
- func IsEquiJoin2(exprs []*plan.Expr) bool
- func IsTpQuery(qry *plan.Query) bool
- func MakePlan2Decimal128ExprWithType(v types.Decimal128, typ *Type) *plan.Expr
- func MakePlan2Decimal64ExprWithType(v types.Decimal64, typ *Type) *plan.Expr
- func MakePlan2NullTextConstExprWithType(v string) *plan.Expr
- func ModifyColumn(ctx CompilerContext, alterPlan *plan.AlterTable, ...) error
- func OrderByColumn(ctx CompilerContext, alterPlan *plan.AlterTable, ...) error
- func PrintStats(qry *plan.Query) string
- func ReCalcNodeStats(nodeID int32, builder *QueryBuilder, recursive bool, leafNode bool)
- func ReCalcQueryStats(builder *QueryBuilder, query *plan.Query)
- func ReadDir(param *tree.ExternParam) (fileList []string, fileSize []int64, err error)
- func RenameColumn(ctx CompilerContext, alterPlan *plan.AlterTable, ...) error
- func ResetAuxIdForExpr(expr *plan.Expr)
- func ResolveAlterTableAlgorithm(ctx context.Context, validAlterSpecs []tree.AlterTableOption) (algorithm plan.AlterTable_AlgorithmType)
- func SimpleCharHashToRange(bytes []byte, upperLimit uint64) uint64
- func SimpleInt64HashToRange(i uint64, upperLimit uint64) uint64
- func SupportedJoinCondition(id int64) bool
- func UpdateStatsInfoMap(info *InfoFromZoneMap, blockNumTotal int, tableDef *plan.TableDef, ...)
- type AlterTableContext
- type BaseOptimizer
- type BindContext
- type Binder
- type Binding
- type BindingTreeNode
- type CTERef
- type ClusterByDef
- type ClusterTable
- type ColDef
- func FindColumn(cols []*ColDef, name string) *ColDef
- func FindColumnByColId(cols []*ColDef, colId uint64) *ColDef
- func GetColDefFromTable(Cols []*ColDef, hidenColName string) *ColDef
- func GetResultColumnsFromPlan(p *Plan) []*ColDef
- func MakeHiddenColDefByName(name string) *ColDef
- func MakeRowIdColDef() *ColDef
- type ColRef
- type ColRefRemapping
- type CompilerContext
- type Const
- type ConstantFoldRule
- type DefaultBinder
- func (b *DefaultBinder) BindAggFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)
- func (b *DefaultBinder) BindColRef(astExpr *tree.UnresolvedName, depth int32, isRoot bool) (*plan.Expr, error)
- func (b *DefaultBinder) BindExpr(astExpr tree.Expr, depth int32, isRoot bool) (*plan.Expr, error)
- func (b *DefaultBinder) BindSubquery(astExpr *tree.Subquery, isRoot bool) (*plan.Expr, error)
- func (b *DefaultBinder) BindWinFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)
- func (b *DefaultBinder) GetContext() context.Context
- type ExecInfo
- type ExecType
- type ExpandAliasMode
- type Expr
- func DeepCopyExpr(expr *Expr) *Expr
- func DeepCopyExprList(list []*Expr) []*Expr
- func GenUniqueColCheckExpr(ctx context.Context, tableDef *TableDef, uniqueCols []map[string]int, ...) ([]*Expr, error)
- func GenUniqueColJoinExpr(ctx context.Context, tableDef *TableDef, uniqueCols []map[string]int, ...) (*Expr, error)
- type FkColName
- type ForeignKeyDef
- type GetParamRule
- type GroupBinder
- func (b *GroupBinder) BindAggFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)
- func (b *GroupBinder) BindColRef(astExpr *tree.UnresolvedName, depth int32, isRoot bool) (*plan.Expr, error)
- func (b *GroupBinder) BindExpr(astExpr tree.Expr, depth int32, isRoot bool) (*plan.Expr, error)
- func (b *GroupBinder) BindSubquery(astExpr *tree.Subquery, isRoot bool) (*plan.Expr, error)
- func (b *GroupBinder) BindWinFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)
- func (b *GroupBinder) GetContext() context.Context
- type HavingBinder
- func (b *HavingBinder) BindAggFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)
- func (b *HavingBinder) BindColRef(astExpr *tree.UnresolvedName, depth int32, isRoot bool) (*plan.Expr, error)
- func (b *HavingBinder) BindExpr(astExpr tree.Expr, depth int32, isRoot bool) (*plan.Expr, error)
- func (b *HavingBinder) BindSubquery(astExpr *tree.Subquery, isRoot bool) (*plan.Expr, error)
- func (b *HavingBinder) BindWinFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)
- func (b *HavingBinder) GetContext() context.Context
- type IndexDef
- type InfoFromZoneMap
- type LimitBinder
- func (b *LimitBinder) BindAggFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)
- func (b *LimitBinder) BindColRef(astExpr *tree.UnresolvedName, depth int32, isRoot bool) (*plan.Expr, error)
- func (b *LimitBinder) BindExpr(astExpr tree.Expr, depth int32, isRoot bool) (*plan.Expr, error)
- func (b *LimitBinder) BindSubquery(astExpr *tree.Subquery, isRoot bool) (*plan.Expr, error)
- func (b *LimitBinder) BindWinFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)
- func (b *LimitBinder) GetContext() context.Context
- type MaxValue
- type MockBinder
- func (m *MockBinder) BindAggFunc(arg0 string, arg1 *tree.FuncExpr, arg2 int32, arg3 bool) (*plan.Expr, error)
- func (m *MockBinder) BindColRef(arg0 *tree.UnresolvedName, arg1 int32, arg2 bool) (*plan.Expr, error)
- func (m *MockBinder) BindExpr(arg0 tree.Expr, arg1 int32, arg2 bool) (*plan.Expr, error)
- func (m *MockBinder) BindSubquery(arg0 *tree.Subquery, arg1 bool) (*plan.Expr, error)
- func (m *MockBinder) BindWinFunc(arg0 string, arg1 *tree.FuncExpr, arg2 int32, arg3 bool) (*plan.Expr, error)
- func (m *MockBinder) EXPECT() *MockBinderMockRecorder
- func (m *MockBinder) GetContext() context.Context
- type MockBinderMockRecorder
- func (mr *MockBinderMockRecorder) BindAggFunc(arg0, arg1, arg2, arg3 interface{}) *gomock.Call
- func (mr *MockBinderMockRecorder) BindColRef(arg0, arg1, arg2 interface{}) *gomock.Call
- func (mr *MockBinderMockRecorder) BindExpr(arg0, arg1, arg2 interface{}) *gomock.Call
- func (mr *MockBinderMockRecorder) BindSubquery(arg0, arg1 interface{}) *gomock.Call
- func (mr *MockBinderMockRecorder) BindWinFunc(arg0, arg1, arg2, arg3 interface{}) *gomock.Call
- func (mr *MockBinderMockRecorder) GetContext() *gomock.Call
- type MockCompilerContext
- func (m *MockCompilerContext) CheckSubscriptionValid(subName, accName string, pubName string) error
- func (m *MockCompilerContext) DatabaseExists(name string) bool
- func (m *MockCompilerContext) DefaultDatabase() string
- func (m *MockCompilerContext) GetAccountId() uint32
- func (m *MockCompilerContext) GetBuildingAlterView() (bool, string, string)
- func (m *MockCompilerContext) GetContext() context.Context
- func (m *MockCompilerContext) GetDatabaseId(dbName string) (uint64, error)
- func (m *MockCompilerContext) GetPrimaryKeyDef(dbName string, tableName string) []*ColDef
- func (m *MockCompilerContext) GetProcess() *process.Process
- func (m *MockCompilerContext) GetQueryResultMeta(uuid string) ([]*ColDef, string, error)
- func (m *MockCompilerContext) GetQueryingSubscription() *SubscriptionMeta
- func (m *MockCompilerContext) GetRootSql() string
- func (m *MockCompilerContext) GetStatsCache() *StatsCache
- func (m *MockCompilerContext) GetSubscriptionMeta(dbName string) (*SubscriptionMeta, error)
- func (m *MockCompilerContext) GetUserName() string
- func (m *MockCompilerContext) IsPublishing(dbName string) (bool, error)
- func (m *MockCompilerContext) Resolve(dbName string, tableName string) (*ObjectRef, *TableDef)
- func (m *MockCompilerContext) ResolveAccountIds(accountNames []string) ([]uint32, error)
- func (m *MockCompilerContext) ResolveById(tableId uint64) (*ObjectRef, *TableDef)
- func (m *MockCompilerContext) ResolveUdf(name string, ast []*plan.Expr) (string, error)
- func (m *MockCompilerContext) ResolveVariable(varName string, isSystemVar, isGlobalVar bool) (interface{}, error)
- func (m *MockCompilerContext) SetBuildingAlterView(yesOrNo bool, dbName, viewName string)
- func (m *MockCompilerContext) SetQueryingSubscription(*SubscriptionMeta)
- func (m *MockCompilerContext) Stats(obj *ObjectRef) bool
- type MockCompilerContext2
- func (m *MockCompilerContext2) CheckSubscriptionValid(subName, accName, pubName string) error
- func (m *MockCompilerContext2) DatabaseExists(name string) bool
- func (m *MockCompilerContext2) DefaultDatabase() string
- func (m *MockCompilerContext2) EXPECT() *MockCompilerContext2MockRecorder
- func (m *MockCompilerContext2) GetAccountId() uint32
- func (m *MockCompilerContext2) GetBuildingAlterView() (bool, string, string)
- func (m *MockCompilerContext2) GetContext() context.Context
- func (m *MockCompilerContext2) GetDatabaseId(dbName string) (uint64, error)
- func (m *MockCompilerContext2) GetPrimaryKeyDef(dbName, tableName string) []*ColDef
- func (m *MockCompilerContext2) GetProcess() *process.Process
- func (m *MockCompilerContext2) GetQueryResultMeta(uuid string) ([]*ColDef, string, error)
- func (m *MockCompilerContext2) GetQueryingSubscription() *SubscriptionMeta
- func (m *MockCompilerContext2) GetRootSql() string
- func (m *MockCompilerContext2) GetStatsCache() *StatsCache
- func (m *MockCompilerContext2) GetSubscriptionMeta(dbName string) (*SubscriptionMeta, error)
- func (m *MockCompilerContext2) GetUserName() string
- func (m *MockCompilerContext2) IsPublishing(dbName string) (bool, error)
- func (m *MockCompilerContext2) Resolve(schemaName, tableName string) (*ObjectRef, *TableDef)
- func (m *MockCompilerContext2) ResolveAccountIds(accountNames []string) ([]uint32, error)
- func (m *MockCompilerContext2) ResolveById(tableId uint64) (*ObjectRef, *TableDef)
- func (m *MockCompilerContext2) ResolveUdf(name string, args []*Expr) (string, error)
- func (m *MockCompilerContext2) ResolveVariable(varName string, isSystemVar, isGlobalVar bool) (interface{}, error)
- func (m *MockCompilerContext2) SetBuildingAlterView(yesOrNo bool, dbName, viewName string)
- func (m *MockCompilerContext2) SetQueryingSubscription(meta *SubscriptionMeta)
- func (m *MockCompilerContext2) Stats(obj *ObjectRef) bool
- type MockCompilerContext2MockRecorder
- func (mr *MockCompilerContext2MockRecorder) CheckSubscriptionValid(subName, accName, pubName interface{}) *gomock.Call
- func (mr *MockCompilerContext2MockRecorder) DatabaseExists(name interface{}) *gomock.Call
- func (mr *MockCompilerContext2MockRecorder) DefaultDatabase() *gomock.Call
- func (mr *MockCompilerContext2MockRecorder) GetAccountId() *gomock.Call
- func (mr *MockCompilerContext2MockRecorder) GetBuildingAlterView() *gomock.Call
- func (mr *MockCompilerContext2MockRecorder) GetContext() *gomock.Call
- func (mr *MockCompilerContext2MockRecorder) GetDatabaseId(dbName interface{}) *gomock.Call
- func (mr *MockCompilerContext2MockRecorder) GetPrimaryKeyDef(dbName, tableName interface{}) *gomock.Call
- func (mr *MockCompilerContext2MockRecorder) GetProcess() *gomock.Call
- func (mr *MockCompilerContext2MockRecorder) GetQueryResultMeta(uuid interface{}) *gomock.Call
- func (mr *MockCompilerContext2MockRecorder) GetQueryingSubscription() *gomock.Call
- func (mr *MockCompilerContext2MockRecorder) GetRootSql() *gomock.Call
- func (mr *MockCompilerContext2MockRecorder) GetStatsCache() *gomock.Call
- func (mr *MockCompilerContext2MockRecorder) GetSubscriptionMeta(dbName interface{}) *gomock.Call
- func (mr *MockCompilerContext2MockRecorder) GetUserName() *gomock.Call
- func (mr *MockCompilerContext2MockRecorder) IsPublishing(dbName interface{}) *gomock.Call
- func (mr *MockCompilerContext2MockRecorder) Resolve(schemaName, tableName interface{}) *gomock.Call
- func (mr *MockCompilerContext2MockRecorder) ResolveAccountIds(accountNames interface{}) *gomock.Call
- func (mr *MockCompilerContext2MockRecorder) ResolveById(tableId interface{}) *gomock.Call
- func (mr *MockCompilerContext2MockRecorder) ResolveUdf(name, args interface{}) *gomock.Call
- func (mr *MockCompilerContext2MockRecorder) ResolveVariable(varName, isSystemVar, isGlobalVar interface{}) *gomock.Call
- func (mr *MockCompilerContext2MockRecorder) SetBuildingAlterView(yesOrNo, dbName, viewName interface{}) *gomock.Call
- func (mr *MockCompilerContext2MockRecorder) SetQueryingSubscription(meta interface{}) *gomock.Call
- func (mr *MockCompilerContext2MockRecorder) Stats(obj interface{}) *gomock.Call
- type MockOptimizer
- type MockOptimizer2
- type MockOptimizer2MockRecorder
- type MockRule
- type MockRuleMockRecorder
- type NameTuple
- type Node
- type ObjectRef
- type Optimizer
- type OrderBinder
- type OrderBySpec
- type PartitionBinder
- func (p *PartitionBinder) BindAggFunc(s string, expr *tree.FuncExpr, i int32, b bool) (*plan.Expr, error)
- func (p *PartitionBinder) BindColRef(name *tree.UnresolvedName, i int32, b bool) (*plan.Expr, error)
- func (p *PartitionBinder) BindExpr(expr tree.Expr, i int32, b bool) (*plan.Expr, error)
- func (p *PartitionBinder) BindSubquery(subquery *tree.Subquery, b bool) (*plan.Expr, error)
- func (p *PartitionBinder) BindWinFunc(s string, expr *tree.FuncExpr, i int32, b bool) (*plan.Expr, error)
- func (b *PartitionBinder) GetContext() context.Context
- type PartitionByDef
- type Plan
- type Plan_Query
- type PrimaryKeyDef
- type ProjectionBinder
- func (b *ProjectionBinder) BindAggFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)
- func (b *ProjectionBinder) BindColRef(astExpr *tree.UnresolvedName, depth int32, isRoot bool) (*plan.Expr, error)
- func (b *ProjectionBinder) BindExpr(astExpr tree.Expr, depth int32, isRoot bool) (*plan.Expr, error)
- func (b *ProjectionBinder) BindSubquery(astExpr *tree.Subquery, isRoot bool) (*plan.Expr, error)
- func (b *ProjectionBinder) BindWinFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)
- func (b *ProjectionBinder) GetContext() context.Context
- type PropertiesDef
- type Property
- type Query
- type QueryBuilder
- type RecomputeRealTimeRelatedFuncRule
- type ResetParamOrderRule
- type ResetParamRefRule
- type ResetVarRefRule
- type RowsetData
- type Rule
- type Schema
- type SetBinder
- func (s *SetBinder) BindAggFunc(_ string, expr *tree.FuncExpr, i int32, b bool) (*plan.Expr, error)
- func (s *SetBinder) BindColRef(name *tree.UnresolvedName, i int32, b bool) (*plan.Expr, error)
- func (s *SetBinder) BindExpr(expr tree.Expr, i int32, b bool) (*plan.Expr, error)
- func (s *SetBinder) BindSubquery(subquery *tree.Subquery, b bool) (*plan.Expr, error)
- func (s *SetBinder) BindWinFunc(_ string, expr *tree.FuncExpr, i int32, b bool) (*plan.Expr, error)
- func (b *SetBinder) GetContext() context.Context
- type Stats
- type StatsCache
- type StatsInfoMap
- type SubscriptionMeta
- type TableBinder
- func (b *TableBinder) BindAggFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)
- func (b *TableBinder) BindColRef(astExpr *tree.UnresolvedName, depth int32, isRoot bool) (*plan.Expr, error)
- func (b *TableBinder) BindExpr(astExpr tree.Expr, depth int32, isRoot bool) (*plan.Expr, error)
- func (b *TableBinder) BindSubquery(astExpr *tree.Subquery, isRoot bool) (*plan.Expr, error)
- func (b *TableBinder) BindWinFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)
- func (b *TableBinder) GetContext() context.Context
- type TableDef
- type TableDefType
- type TableDef_DefType_Properties
- type Type
- type UpdateBinder
- func (b *UpdateBinder) BindAggFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)
- func (b *UpdateBinder) BindColRef(astExpr *tree.UnresolvedName, depth int32, isRoot bool) (*plan.Expr, error)
- func (b *UpdateBinder) BindExpr(astExpr tree.Expr, depth int32, isRoot bool) (*plan.Expr, error)
- func (b *UpdateBinder) BindSubquery(astExpr *tree.Subquery, isRoot bool) (*plan.Expr, error)
- func (b *UpdateBinder) BindWinFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)
- func (b *UpdateBinder) GetContext() context.Context
- type ViewData
- type ViewDef
- type VisitPlan
- type VisitPlanRule
- type WhereBinder
- func (b *WhereBinder) BindAggFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)
- func (b *WhereBinder) BindColRef(astExpr *tree.UnresolvedName, depth int32, isRoot bool) (*plan.Expr, error)
- func (b *WhereBinder) BindExpr(astExpr tree.Expr, depth int32, isRoot bool) (*plan.Expr, error)
- func (b *WhereBinder) BindSubquery(astExpr *tree.Subquery, isRoot bool) (*plan.Expr, error)
- func (b *WhereBinder) BindWinFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)
- func (b *WhereBinder) GetContext() context.Context
Constants ¶
const ( // INTERVAL_MICROSECOND is the time or timestamp unit MICROSECOND. INTERVAL_MICROSECOND = "MICROSECOND" // INTERVAL_SECOND is the time or timestamp unit SECOND. INTERVAL_SECOND = "SECOND" // INTERVAL_MINUTE is the time or timestamp unit MINUTE. INTERVAL_MINUTE = "MINUTE" // INTERVAL_HOUR is the time or timestamp unit HOUR. INTERVAL_HOUR = "HOUR" // INTERVAL_DAY is the time or timestamp unit DAY. INTERVAL_DAY = "DAY" // INTERVAL_WEEK is the time or timestamp unit WEEK. INTERVAL_WEEK = "WEEK" // INTERVAL_MONTH is the time or timestamp unit MONTH. INTERVAL_MONTH = "MONTH" // INTERVAL_QUARTER is the time or timestamp unit QUARTER. INTERVAL_QUARTER = "QUARTER" // INTERVAL_YEAR is the time or timestamp unit YEAR. INTERVAL_YEAR = "YEAR" // INTERVAL_SECOND_MICROSECOND is the time unit SECOND_MICROSECOND. INTERVAL_SECOND_MICROSECOND = "SECOND_MICROSECOND" // INTERVAL_MINUTE_MICROSECOND is the time unit MINUTE_MICROSECOND. INTERVAL_MINUTE_MICROSECOND = "MINUTE_MICROSECOND" // INTERVAL_MINUTE_SECOND is the time unit MINUTE_SECOND. INTERVAL_MINUTE_SECOND = "MINUTE_SECOND" // INTERVAL_HOUR_MICROSECOND is the time unit HOUR_MICROSECOND. INTERVAL_HOUR_MICROSECOND = "HOUR_MICROSECOND" // INTERVAL_HOUR_SECOND is the time unit HOUR_SECOND. INTERVAL_HOUR_SECOND = "HOUR_SECOND" // INTERVAL_HOUR_MINUTE is the time unit HOUR_MINUTE. INTERVAL_HOUR_MINUTE = "HOUR_MINUTE" // INTERVAL_DAY_MICROSECOND is the time unit DAY_MICROSECOND. INTERVAL_DAY_MICROSECOND = "DAY_MICROSECOND" // INTERVAL_DAY_SECOND is the time unit DAY_SECOND. INTERVAL_DAY_SECOND = "DAY_SECOND" // INTERVAL_DAY_MINUTE is the time unit DAY_MINUTE. INTERVAL_DAY_MINUTE = "DAY_MINUTE" // INTERVAL_DAY_HOUR is the time unit DAY_HOUR. INTERVAL_DAY_HOUR = "DAY_HOUR" // INTERVAL_YEAR_MONTH is the time unit YEAR_MONTH. INTERVAL_YEAR_MONTH = "YEAR_MONTH" )
The following code shows the expected form of the expr argument for each unit value. see link: https://dev.mysql.com/doc/refman/8.0/en/expressions.html#temporal-intervals
const ( InFilterCardLimit = 1024 BloomFilterCardLimit = 1000 * InFilterCardLimit MinProbeTableRows = 8192 * 20 // Don't generate runtime filter for small tables SelectivityThreshold = 0.5 )
const ( HashMapSizeForShuffle = 250000 MAXShuffleDOP = 64 ShuffleThreshHold = 50000 ShuffleTypeThreshHoldLowerLimit = 32 ShuffleTypeThreshHoldUpperLimit = 1024 )
const ( ShuffleToRegIndex int32 = 0 ShuffleToLocalMatchedReg int32 = 1 ShuffleToMultiMatchedReg int32 = 2 )
const ( JoinSideNone int8 = 0 JoinSideLeft = 1 << 1 JoinSideRight = 1 << 2 JoinSideBoth = JoinSideLeft | JoinSideRight JoinSideMark = 1 << 3 )
const BlockNumForceOneCN = 200
const INFORMATION_SCHEMA = "information_schema"
const MO_CATALOG_DB_NAME = "mo_catalog"
const MO_DEFUALT_HOSTNAME = "localhost"
const (
// MaxFsp is the maximum digit of fractional seconds part.
MaxFsp = 6
)
const ( /* Identifier Length Limits See MySQL: https://dev.mysql.com/doc/refman/8.0/en/identifiers.html */ // MaxKeyParts is max length of key parts. MaxKeyParts = 16 )
const NameGroupConcat = "group_concat"
const (
/*
https://dev.mysql.com/doc/refman/8.0/en/create-table.html
PARTITION BY
If used, a partition_options clause begins with PARTITION BY. This clause contains the function that is used
to determine the partition; the function returns an integer value ranging from 1 to num, where num is
the number of partitions. (The maximum number of user-defined partitions which a table may contain is 1024;
the number of subpartitions—discussed later in this section—is included in this maximum.)
*/
PartitionCountLimit = 1024
)
const (
// PrimaryKeyName defines primary key name.
PrimaryKeyName = "PRIMARY"
)
const SF float64 = 1
const (
/*
https://dev.mysql.com/doc/refman/8.0/en/column-count-limit.html
MySQL has hard limit of 4096 columns per table, but the effective maximum may be less for a given table.
*/
TableColumnCountLimit = 4096
)
const UnKnownColId uint64 = math.MaxUint64
Variables ¶
var ( MetadataScanColDefs = []*plan.ColDef{} MetadataScanColTypes = []types.Type{} Metadata_Rows_Cnt_Pos int32 )
var AllowedPartitionBinaryOpMap = map[tree.BinaryOp]string{ tree.PLUS: "+", tree.MINUS: "-", tree.MULTI: "*", tree.INTEGER_DIV: "div", tree.MOD: "%", }
AllowedPartitionBinaryOpMap store the operators of Binary operation expression link ref:https://dev.mysql.com/doc/refman/8.0/en/partitioning-limitations.html
var AllowedPartitionFuncMap = map[string]int{
"to_days": 1,
"to_seconds": 1,
"dayofmonth": 1,
"month": 1,
"dayofyear": 1,
"quarter": 1,
"yearweek": 1,
"year": 1,
"weekday": 1,
"dayofweek": 1,
"day": 1,
"hour": 1,
"minute": 1,
"second": 1,
"time_to_sec": 1,
"microsecond": 1,
"unix_timestamp": 1,
"from_days": 1,
"extract": 1,
"abs": 1,
"ceiling": 1,
"ceil": 1,
"datediff": 1,
"floor": 1,
"mod": 1,
}
AllowedPartitionFuncMap stores functions which can be used in the partition expression. See Link: https://dev.mysql.com/doc/refman/8.0/en/partitioning-limitations-functions.html
var AllowedPartitionUnaryOpMap = map[tree.UnaryOp]string{ tree.UNARY_PLUS: "+", tree.UNARY_MINUS: "-", }
AllowedPartitionUnaryOpMap store the operators of Unary expression link ref:https://dev.mysql.com/doc/refman/8.0/en/partitioning-limitations.html
var BindFuncExprImplByPlanExpr = bindFuncExprImplByPlanExpr
var CNPrimaryCheck = false
var ForceCastExpr = forceCastExpr
var (
GSColDefs = [3][]*plan.ColDef{}
)
var MakePlan2Float64ConstExprWithType = makePlan2Float64ConstExprWithType
var MakePlan2Int64ConstExprWithType = makePlan2Int64ConstExprWithType
var MakePlan2StringConstExprWithType = makePlan2StringConstExprWithType
var MakePlan2Type = makePlan2Type
var MakeTypeByPlan2Expr = makeTypeByPlan2Expr
var MakeTypeByPlan2Type = makeTypeByPlan2Type
var ( MetaColDefs = []*plan.ColDef{ { Name: catalog.MetaColNames[catalog.QUERY_ID_IDX], Typ: &plan.Type{ Id: int32(catalog.MetaColTypes[catalog.QUERY_ID_IDX].Oid), NotNullable: false, }, }, { Name: catalog.MetaColNames[catalog.STATEMENT_IDX], Typ: &plan.Type{ Id: int32(catalog.MetaColTypes[catalog.STATEMENT_IDX].Oid), NotNullable: false, }, }, { Name: catalog.MetaColNames[catalog.ACCOUNT_ID_IDX], Typ: &plan.Type{ Id: int32(catalog.MetaColTypes[catalog.ACCOUNT_ID_IDX].Oid), NotNullable: false, }, }, { Name: catalog.MetaColNames[catalog.ROLE_ID_IDX], Typ: &plan.Type{ Id: int32(catalog.MetaColTypes[catalog.ROLE_ID_IDX].Oid), NotNullable: false, }, }, { Name: catalog.MetaColNames[catalog.RESULT_PATH_IDX], Typ: &plan.Type{ Id: int32(catalog.MetaColTypes[catalog.RESULT_PATH_IDX].Oid), NotNullable: false, Width: 4, }, }, { Name: catalog.MetaColNames[catalog.CREATE_TIME_IDX], Typ: &plan.Type{ Id: int32(catalog.MetaColTypes[catalog.CREATE_TIME_IDX].Oid), NotNullable: false, }, }, { Name: catalog.MetaColNames[catalog.RESULT_SIZE_IDX], Typ: &plan.Type{ Id: int32(catalog.MetaColTypes[catalog.RESULT_SIZE_IDX].Oid), NotNullable: false, }, }, { Name: catalog.MetaColNames[catalog.TABLES_IDX], Typ: &plan.Type{ Id: int32(catalog.MetaColTypes[catalog.TABLES_IDX].Oid), NotNullable: false, }, }, { Name: catalog.MetaColNames[catalog.USER_ID_IDX], Typ: &plan.Type{ Id: int32(catalog.MetaColTypes[catalog.USER_ID_IDX].Oid), NotNullable: false, }, }, { Name: catalog.MetaColNames[catalog.EXPIRED_TIME_IDX], Typ: &plan.Type{ Id: int32(catalog.MetaColTypes[catalog.EXPIRED_TIME_IDX].Oid), NotNullable: false, }, }, { Name: catalog.MetaColNames[catalog.COLUMN_MAP_IDX], Typ: &plan.Type{ Id: int32(catalog.MetaColTypes[catalog.COLUMN_MAP_IDX].Oid), NotNullable: false, }, }, } )
var (
STATEMENT_ACCOUNT = "account"
)
var Sequence_cols_name = []string{"last_seq_num", "min_value", "max_value", "start_value", "increment_value", "cycle", "is_called"}
var SessionsColTypes []types.Type
Functions ¶
func AddColumn ¶ added in v1.0.0
func AddColumn(ctx CompilerContext, alterPlan *plan.AlterTable, spec *tree.AlterAddCol, alterCtx *AlterTableContext) error
AddColumn will add a new column to the table.
func AddPrimaryKey ¶ added in v1.0.0
func AddPrimaryKey(ctx CompilerContext, alterPlan *plan.AlterTable, spec *tree.PrimaryKeyIndex, alterCtx *AlterTableContext) error
AddPrimaryKey will add a new column to the table.
func AlterColumn ¶ added in v1.0.0
func AlterColumn(ctx CompilerContext, alterPlan *plan.AlterTable, spec *tree.AlterTableAlterColumnClause, alterCtx *AlterTableContext) error
AlterColumn ALTER ... SET DEFAULT or ALTER ... DROP DEFAULT specify a new default value for a column or remove the old default value, respectively. If the old default is removed and the column can be NULL, the new default is NULL. If the column cannot be NULL, MySQL assigns a default value
func AssignAuxIdForExpr ¶ added in v0.8.0
func BuildVectorsByData ¶ added in v0.7.0
func ChangeColumn ¶ added in v1.0.0
func ChangeColumn(ctx CompilerContext, alterPlan *plan.AlterTable, spec *tree.AlterTableChangeColumnClause, alterCtx *AlterTableContext) error
ChangeColumn Can rename a column and change its definition, or both. Has more capability than MODIFY or RENAME COLUMN, but at the expense of convenience for some operations. CHANGE requires naming the column twice if not renaming it, and requires respecifying the column definition if only renaming it. With FIRST or AFTER, can reorder columns.
func CheckColumnNameValid ¶ added in v1.0.0
Check if the column name is valid and conflicts with internal hidden columns
func CheckExprIsMonotonic ¶ added in v0.7.0
func CheckFunctionFilter ¶ added in v0.8.0
func CheckFunctionFilter(expr *plan.Expr) (b bool, col *ColRef, constExpr *Const, childFuncName string)
function filter means func(col) compared to const. for example year(col1)>1991
func CheckModifyColumnForeignkeyConstraint ¶ added in v1.0.0
func CheckModifyColumnForeignkeyConstraint(ctx CompilerContext, tbInfo *TableDef, originalCol, newCol *ColDef) error
CheckModifyColumnForeignkeyConstraint check for table column foreign key dependencies, including the foreign keys of the table itself and being dependent on foreign keys of other tables
func CheckStrictFilter ¶ added in v0.8.0
strict filter means col compared to const. for example col1>1 func(col1)=1 is not strict
func ConstantFold ¶ added in v0.6.0
func DeepCopyAnalyzeInfo ¶ added in v0.7.0
func DeepCopyAnalyzeInfo(analyzeinfo *plan.AnalyzeInfo) *plan.AnalyzeInfo
func DeepCopyClusterTable ¶ added in v0.7.0
func DeepCopyClusterTable(cluster *plan.ClusterTable) *plan.ClusterTable
func DeepCopyDataDefinition ¶ added in v0.6.0
func DeepCopyDataDefinition(old *plan.DataDefinition) *plan.DataDefinition
func DeepCopyDeleteCtx ¶ added in v0.7.0
func DeepCopyIndexDef ¶ added in v0.7.0
func DeepCopyInsertCtx ¶ added in v0.7.0
func DeepCopyLockTarget ¶ added in v0.8.0
func DeepCopyLockTarget(target *plan.LockTarget) *plan.LockTarget
func DeepCopyNumberList ¶ added in v0.8.0
func DeepCopyNumberList[T constraints.Integer](src []T) []T
func DeepCopyObjectRef ¶ added in v0.7.0
func DeepCopyOnDupliateKeyCtx ¶ added in v0.8.0
func DeepCopyOnDupliateKeyCtx(ctx *plan.OnDuplicateKeyCtx) *plan.OnDuplicateKeyCtx
func DeepCopyOrderBy ¶ added in v0.6.0
func DeepCopyOrderBy(orderBy *plan.OrderBySpec) *plan.OrderBySpec
func DeepCopyPreDeleteCtx ¶ added in v0.8.0
func DeepCopyPreDeleteCtx(ctx *plan.PreDeleteCtx) *plan.PreDeleteCtx
func DeepCopyPreInsertCtx ¶ added in v0.8.0
func DeepCopyPreInsertCtx(ctx *plan.PreInsertCtx) *plan.PreInsertCtx
func DeepCopyPreInsertUkCtx ¶ added in v0.8.0
func DeepCopyPreInsertUkCtx(ctx *plan.PreInsertUkCtx) *plan.PreInsertUkCtx
func DeepCopyPrimaryKeyDef ¶ added in v0.7.0
func DeepCopyPrimaryKeyDef(pkeyDef *plan.PrimaryKeyDef) *plan.PrimaryKeyDef
func DeepCopyStringList ¶ added in v0.8.0
func DeepCopyTableDefList ¶ added in v0.8.0
func DefaultHugeStats ¶ added in v0.8.0
func DefaultStats ¶ added in v0.7.0
func DefaultValueIsNull ¶ added in v1.0.0
func DropColumn ¶ added in v1.0.0
func DropColumn(ctx CompilerContext, alterPlan *plan.AlterTable, colName string, alterCtx *AlterTableContext) error
AddColumn will add a new column to the table.
func DropPrimaryKey ¶ added in v1.0.0
func DropPrimaryKey(ctx CompilerContext, alterPlan *plan.AlterTable, alterCtx *AlterTableContext) error
func EvalFilterExpr ¶ added in v0.7.0
func EvalPlanExpr ¶ added in v0.7.0
func ExtractToDateReturnType ¶ added in v0.8.0
func FormatExpr ¶ added in v0.8.0
func GetBindings ¶ added in v0.5.0
func GetColumnMapByExpr ¶ added in v0.8.0
func GetColumnMapByExprs ¶ added in v0.8.0
func GetColumnsByExpr ¶ added in v0.7.0
func GetForETLWithType ¶ added in v0.7.0
func GetForETLWithType(param *tree.ExternParam, prefix string) (res fileservice.ETLFileService, readPath string, err error)
func GetRangeShuffleIndexForZM ¶ added in v0.8.0
func GetRangeShuffleIndexSigned ¶ added in v0.8.0
func GetRangeShuffleIndexUnsigned ¶ added in v0.8.0
func GetShuffleDop ¶ added in v0.8.0
func GetShuffleDop() (dop int)
func GetUniqueColAndIdxFromTableDef ¶ added in v0.8.0
GetUniqueColAndIdxFromTableDef if get table: t1(a int primary key, b int, c int, d int, unique key(b,c)); return : []map[string]int { {'a'=1}, {'b'=2,'c'=3} }
func GetVarValue ¶ added in v0.8.0
func InitInfileParam ¶ added in v0.7.0
func InitInfileParam(param *tree.ExternParam) error
func InitNullMap ¶ added in v0.6.0
func InitNullMap(param *tree.ExternParam, ctx CompilerContext) error
func InitS3Param ¶ added in v0.7.0
func InitS3Param(param *tree.ExternParam) error
func IsEquiJoin2 ¶ added in v0.8.0
IsEquiJoin2 Judge whether a join node is equi-join (after column remapping) Can only be used after optimizer!!!
func MakePlan2Decimal128ExprWithType ¶ added in v0.8.0
func MakePlan2Decimal128ExprWithType(v types.Decimal128, typ *Type) *plan.Expr
func MakePlan2Decimal64ExprWithType ¶ added in v0.8.0
func MakePlan2NullTextConstExprWithType ¶ added in v0.7.0
func ModifyColumn ¶ added in v1.0.0
func ModifyColumn(ctx CompilerContext, alterPlan *plan.AlterTable, spec *tree.AlterTableModifyColumnClause, alterCtx *AlterTableContext) error
ModifyColumn Can change a column definition but not its name. More convenient than CHANGE to change a column definition without renaming it. With FIRST or AFTER, can reorder columns.
func OrderByColumn ¶ added in v1.0.0
func OrderByColumn(ctx CompilerContext, alterPlan *plan.AlterTable, spec *tree.AlterTableOrderByColumnClause, alterCtx *AlterTableContext) error
OrderByColumn Currently, Mo only performs semantic checks on alter table order by and does not implement the function of changing the physical storage order of data in the table
func PrintStats ¶ added in v0.8.0
func ReCalcNodeStats ¶ added in v0.7.0
func ReCalcNodeStats(nodeID int32, builder *QueryBuilder, recursive bool, leafNode bool)
func ReCalcQueryStats ¶ added in v1.0.0
func ReCalcQueryStats(builder *QueryBuilder, query *plan.Query)
func ReadDir ¶ added in v0.7.0
func ReadDir(param *tree.ExternParam) (fileList []string, fileSize []int64, err error)
ReadDir support "etl:" and "/..." absolute path, NOT support relative path.
func RenameColumn ¶ added in v1.0.0
func RenameColumn(ctx CompilerContext, alterPlan *plan.AlterTable, spec *tree.AlterTableRenameColumnClause, alterCtx *AlterTableContext) error
RenameColumn Can change a column name but not its definition. More convenient than CHANGE to rename a column without changing its definition.
func ResetAuxIdForExpr ¶ added in v0.8.0
func ResolveAlterTableAlgorithm ¶ added in v1.0.0
func ResolveAlterTableAlgorithm(ctx context.Context, validAlterSpecs []tree.AlterTableOption) (algorithm plan.AlterTable_AlgorithmType)
func SimpleCharHashToRange ¶ added in v0.8.0
func SimpleInt64HashToRange ¶ added in v0.8.0
func SupportedJoinCondition ¶ added in v0.8.0
func UpdateStatsInfoMap ¶ added in v0.8.0
func UpdateStatsInfoMap(info *InfoFromZoneMap, blockNumTotal int, tableDef *plan.TableDef, s *StatsInfoMap)
Types ¶
type AlterTableContext ¶ added in v1.0.0
type AlterTableContext struct {
// contains filtered or unexported fields
}
type BaseOptimizer ¶ added in v0.5.0
type BaseOptimizer struct {
// contains filtered or unexported fields
}
BaseOptimizer is base optimizer, capable of handling only a few simple rules
func NewBaseOptimizer ¶ added in v0.5.0
func NewBaseOptimizer(ctx CompilerContext) *BaseOptimizer
func NewPrepareOptimizer ¶ added in v0.7.0
func NewPrepareOptimizer(ctx CompilerContext) *BaseOptimizer
func (*BaseOptimizer) CurrentContext ¶ added in v0.5.0
func (opt *BaseOptimizer) CurrentContext() CompilerContext
type BindContext ¶ added in v0.5.0
type BindContext struct {
// contains filtered or unexported fields
}
func NewBindContext ¶ added in v0.5.0
func NewBindContext(builder *QueryBuilder, parent *BindContext) *BindContext
type Binder ¶ added in v0.5.0
type Binder interface { BindExpr(tree.Expr, int32, bool) (*plan.Expr, error) BindColRef(*tree.UnresolvedName, int32, bool) (*plan.Expr, error) BindAggFunc(string, *tree.FuncExpr, int32, bool) (*plan.Expr, error) BindWinFunc(string, *tree.FuncExpr, int32, bool) (*plan.Expr, error) BindSubquery(*tree.Subquery, bool) (*plan.Expr, error) GetContext() context.Context }
type Binding ¶ added in v0.5.0
type Binding struct {
// contains filtered or unexported fields
}
func NewBinding ¶ added in v0.5.0
func (*Binding) FindColumn ¶ added in v0.5.0
type BindingTreeNode ¶ added in v0.5.0
type BindingTreeNode struct {
// contains filtered or unexported fields
}
type ClusterByDef ¶ added in v0.7.0
type ClusterByDef = plan.ClusterByDef
type ClusterTable ¶ added in v0.7.0
type ClusterTable = plan.ClusterTable
type ColDef ¶ added in v0.5.0
func FindColumn ¶ added in v0.8.0
FindColumn finds column in cols by name.
func FindColumnByColId ¶ added in v1.0.0
FindColumn finds column in cols by colId
func GetColDefFromTable ¶ added in v1.0.0
GetColDefFromTable Find the target column definition from the predefined table columns and return its deep copy
func GetResultColumnsFromPlan ¶ added in v0.5.0
GetResultColumnsFromPlan
func MakeHiddenColDefByName ¶ added in v0.8.0
used for Compound primary key column name && clusterby column name
func MakeRowIdColDef ¶ added in v0.8.0
func MakeRowIdColDef() *ColDef
type ColRefRemapping ¶ added in v0.5.0
type ColRefRemapping struct {
// contains filtered or unexported fields
}
type CompilerContext ¶ added in v0.5.0
type CompilerContext interface { // Default database/schema in context DefaultDatabase() string // check if database exist DatabaseExists(name string) bool // get table definition by database/schema Resolve(schemaName string, tableName string) (*ObjectRef, *TableDef) // get table definition by table id ResolveById(tableId uint64) (*ObjectRef, *TableDef) // get the value of variable ResolveVariable(varName string, isSystemVar, isGlobalVar bool) (interface{}, error) // get the list of the account id ResolveAccountIds(accountNames []string) ([]uint32, error) // get the relevant information of udf ResolveUdf(name string, args []*Expr) (string, error) // get the definition of primary key GetPrimaryKeyDef(dbName string, tableName string) []*ColDef // get needed info for stats by table Stats(obj *ObjectRef) bool // get origin sql string of the root GetRootSql() string // get username of current session GetUserName() string GetAccountId() uint32 // GetContext get raw context.Context GetContext() context.Context // GetDatabaseId Get database id GetDatabaseId(dbName string) (uint64, error) GetProcess() *process.Process GetQueryResultMeta(uuid string) ([]*ColDef, string, error) SetBuildingAlterView(yesOrNo bool, dbName, viewName string) // is building the alter view or not // return: yes or no, dbName, viewName GetBuildingAlterView() (bool, string, string) GetStatsCache() *StatsCache GetSubscriptionMeta(dbName string) (*SubscriptionMeta, error) CheckSubscriptionValid(subName, accName string, pubName string) error SetQueryingSubscription(meta *SubscriptionMeta) GetQueryingSubscription() *SubscriptionMeta IsPublishing(dbName string) (bool, error) }
type ConstantFoldRule ¶ added in v0.7.0
type ConstantFoldRule struct {
// contains filtered or unexported fields
}
func NewConstantFoldRule ¶ added in v0.7.0
func NewConstantFoldRule(compCtx CompilerContext) *ConstantFoldRule
func (*ConstantFoldRule) ApplyNode ¶ added in v0.7.0
func (r *ConstantFoldRule) ApplyNode(node *Node) error
func (*ConstantFoldRule) IsApplyExpr ¶ added in v0.7.0
func (r *ConstantFoldRule) IsApplyExpr() bool
func (*ConstantFoldRule) MatchNode ¶ added in v0.7.0
func (r *ConstantFoldRule) MatchNode(node *Node) bool
type DefaultBinder ¶ added in v0.6.0
type DefaultBinder struct {
// contains filtered or unexported fields
}
func NewDefaultBinder ¶ added in v0.6.0
func NewDefaultBinder(sysCtx context.Context, builder *QueryBuilder, ctx *BindContext, typ *Type, cols []string) *DefaultBinder
func (*DefaultBinder) BindAggFunc ¶ added in v0.6.0
func (*DefaultBinder) BindColRef ¶ added in v0.6.0
func (b *DefaultBinder) BindColRef(astExpr *tree.UnresolvedName, depth int32, isRoot bool) (*plan.Expr, error)
func (*DefaultBinder) BindSubquery ¶ added in v0.6.0
func (*DefaultBinder) BindWinFunc ¶ added in v0.6.0
func (*DefaultBinder) GetContext ¶ added in v0.7.0
type ExecInfo ¶ added in v0.6.0
func GetExecTypeFromPlan ¶ added in v0.6.0
GetExecType get executor will execute base AP or TP
type ExpandAliasMode ¶ added in v1.0.0
type ExpandAliasMode int8
const ( NoAlias ExpandAliasMode = iota AliasBeforeColumn AliasAfterColumn )
type Expr ¶ added in v0.5.0
func DeepCopyExpr ¶ added in v0.5.0
func DeepCopyExprList ¶ added in v0.6.0
func GenUniqueColCheckExpr ¶ added in v0.8.0
func GenUniqueColCheckExpr(ctx context.Context, tableDef *TableDef, uniqueCols []map[string]int, colCount int) ([]*Expr, error)
GenUniqueColCheckExpr like GenUniqueColJoinExpr. but use for on duplicate key clause to check conflict if get table: t1(a int primary key, b int, c int, d int, unique key(b,c)); we get batch like [1,2,3,4, origin_a, origin_b, origin_c, origin_d, row_id ....]。 we get expr like: []*Expr{ 1=origin_a , (2 = origin_b and 3 = origin_c) }
func GenUniqueColJoinExpr ¶ added in v0.8.0
func GenUniqueColJoinExpr(ctx context.Context, tableDef *TableDef, uniqueCols []map[string]int, leftTag int32, rightTag int32) (*Expr, error)
GenUniqueColJoinExpr if get table: t1(a int primary key, b int, c int, d int, unique key(b,c)); uniqueCols is: []map[string]int { {'a'=1}, {'b'=2,'c'=3} } we will get expr like: 'leftTag.a = rightTag.a or (leftTag.b = rightTag.b and leftTag.c = rightTag. c)
type ForeignKeyDef ¶ added in v0.7.0
type ForeignKeyDef = plan.ForeignKeyDef
func DeepCopyFkey ¶ added in v0.8.0
func DeepCopyFkey(fkey *ForeignKeyDef) *ForeignKeyDef
type GetParamRule ¶ added in v0.6.0
type GetParamRule struct {
// contains filtered or unexported fields
}
func NewGetParamRule ¶ added in v0.5.1
func NewGetParamRule() *GetParamRule
func (*GetParamRule) ApplyNode ¶ added in v0.6.0
func (rule *GetParamRule) ApplyNode(node *Node) error
func (*GetParamRule) IsApplyExpr ¶ added in v0.6.0
func (rule *GetParamRule) IsApplyExpr() bool
func (*GetParamRule) MatchNode ¶ added in v0.6.0
func (rule *GetParamRule) MatchNode(node *Node) bool
func (*GetParamRule) SetParamOrder ¶ added in v0.6.0
func (rule *GetParamRule) SetParamOrder()
type GroupBinder ¶ added in v0.5.0
type GroupBinder struct {
// contains filtered or unexported fields
}
func NewGroupBinder ¶ added in v0.5.0
func NewGroupBinder(builder *QueryBuilder, ctx *BindContext) *GroupBinder
func (*GroupBinder) BindAggFunc ¶ added in v0.5.0
func (*GroupBinder) BindColRef ¶ added in v0.5.0
func (b *GroupBinder) BindColRef(astExpr *tree.UnresolvedName, depth int32, isRoot bool) (*plan.Expr, error)
func (*GroupBinder) BindSubquery ¶ added in v0.5.0
func (*GroupBinder) BindWinFunc ¶ added in v0.5.0
func (*GroupBinder) GetContext ¶ added in v0.7.0
type HavingBinder ¶ added in v0.5.0
type HavingBinder struct {
// contains filtered or unexported fields
}
func NewHavingBinder ¶ added in v0.5.0
func NewHavingBinder(builder *QueryBuilder, ctx *BindContext) *HavingBinder
func (*HavingBinder) BindAggFunc ¶ added in v0.5.0
func (*HavingBinder) BindColRef ¶ added in v0.5.0
func (b *HavingBinder) BindColRef(astExpr *tree.UnresolvedName, depth int32, isRoot bool) (*plan.Expr, error)
func (*HavingBinder) BindSubquery ¶ added in v0.5.0
func (*HavingBinder) BindWinFunc ¶ added in v0.5.0
func (*HavingBinder) GetContext ¶ added in v0.7.0
type InfoFromZoneMap ¶ added in v0.8.0
type InfoFromZoneMap struct { ColumnZMs []objectio.ZoneMap DataTypes []types.Type ColumnNDVs []float64 TableCnt float64 }
func NewInfoFromZoneMap ¶ added in v0.8.0
func NewInfoFromZoneMap(lenCols int) *InfoFromZoneMap
type LimitBinder ¶ added in v0.5.0
type LimitBinder struct {
// contains filtered or unexported fields
}
func NewLimitBinder ¶ added in v0.5.0
func NewLimitBinder(builder *QueryBuilder, ctx *BindContext) *LimitBinder
func (*LimitBinder) BindAggFunc ¶ added in v0.5.0
func (*LimitBinder) BindColRef ¶ added in v0.5.0
func (b *LimitBinder) BindColRef(astExpr *tree.UnresolvedName, depth int32, isRoot bool) (*plan.Expr, error)
func (*LimitBinder) BindSubquery ¶ added in v0.5.0
func (*LimitBinder) BindWinFunc ¶ added in v0.5.0
func (*LimitBinder) GetContext ¶ added in v0.7.0
type MockBinder ¶ added in v0.7.0
type MockBinder struct {
// contains filtered or unexported fields
}
MockBinder is a mock of Binder interface.
func NewMockBinder ¶ added in v0.7.0
func NewMockBinder(ctrl *gomock.Controller) *MockBinder
NewMockBinder creates a new mock instance.
func (*MockBinder) BindAggFunc ¶ added in v0.7.0
func (m *MockBinder) BindAggFunc(arg0 string, arg1 *tree.FuncExpr, arg2 int32, arg3 bool) (*plan.Expr, error)
BindAggFunc mocks base method.
func (*MockBinder) BindColRef ¶ added in v0.7.0
func (m *MockBinder) BindColRef(arg0 *tree.UnresolvedName, arg1 int32, arg2 bool) (*plan.Expr, error)
BindColRef mocks base method.
func (*MockBinder) BindSubquery ¶ added in v0.7.0
BindSubquery mocks base method.
func (*MockBinder) BindWinFunc ¶ added in v0.7.0
func (m *MockBinder) BindWinFunc(arg0 string, arg1 *tree.FuncExpr, arg2 int32, arg3 bool) (*plan.Expr, error)
BindWinFunc mocks base method.
func (*MockBinder) EXPECT ¶ added in v0.7.0
func (m *MockBinder) EXPECT() *MockBinderMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockBinder) GetContext ¶ added in v0.7.0
func (m *MockBinder) GetContext() context.Context
GetContext mocks base method.
type MockBinderMockRecorder ¶ added in v0.7.0
type MockBinderMockRecorder struct {
// contains filtered or unexported fields
}
MockBinderMockRecorder is the mock recorder for MockBinder.
func (*MockBinderMockRecorder) BindAggFunc ¶ added in v0.7.0
func (mr *MockBinderMockRecorder) BindAggFunc(arg0, arg1, arg2, arg3 interface{}) *gomock.Call
BindAggFunc indicates an expected call of BindAggFunc.
func (*MockBinderMockRecorder) BindColRef ¶ added in v0.7.0
func (mr *MockBinderMockRecorder) BindColRef(arg0, arg1, arg2 interface{}) *gomock.Call
BindColRef indicates an expected call of BindColRef.
func (*MockBinderMockRecorder) BindExpr ¶ added in v0.7.0
func (mr *MockBinderMockRecorder) BindExpr(arg0, arg1, arg2 interface{}) *gomock.Call
BindExpr indicates an expected call of BindExpr.
func (*MockBinderMockRecorder) BindSubquery ¶ added in v0.7.0
func (mr *MockBinderMockRecorder) BindSubquery(arg0, arg1 interface{}) *gomock.Call
BindSubquery indicates an expected call of BindSubquery.
func (*MockBinderMockRecorder) BindWinFunc ¶ added in v0.7.0
func (mr *MockBinderMockRecorder) BindWinFunc(arg0, arg1, arg2, arg3 interface{}) *gomock.Call
BindWinFunc indicates an expected call of BindWinFunc.
func (*MockBinderMockRecorder) GetContext ¶ added in v0.7.0
func (mr *MockBinderMockRecorder) GetContext() *gomock.Call
GetContext indicates an expected call of GetContext.
type MockCompilerContext ¶ added in v0.5.0
type MockCompilerContext struct {
// contains filtered or unexported fields
}
func NewEmptyCompilerContext ¶ added in v0.5.0
func NewEmptyCompilerContext() *MockCompilerContext
NewEmptyCompilerContext for test create/drop statement
func NewMockCompilerContext ¶ added in v0.5.0
func NewMockCompilerContext(isDml bool) *MockCompilerContext
func (*MockCompilerContext) CheckSubscriptionValid ¶ added in v0.8.0
func (m *MockCompilerContext) CheckSubscriptionValid(subName, accName string, pubName string) error
func (*MockCompilerContext) DatabaseExists ¶ added in v0.5.0
func (m *MockCompilerContext) DatabaseExists(name string) bool
func (*MockCompilerContext) DefaultDatabase ¶ added in v0.5.0
func (m *MockCompilerContext) DefaultDatabase() string
func (*MockCompilerContext) GetAccountId ¶ added in v0.6.0
func (m *MockCompilerContext) GetAccountId() uint32
func (*MockCompilerContext) GetBuildingAlterView ¶ added in v0.7.0
func (m *MockCompilerContext) GetBuildingAlterView() (bool, string, string)
func (*MockCompilerContext) GetContext ¶ added in v0.7.0
func (m *MockCompilerContext) GetContext() context.Context
func (*MockCompilerContext) GetDatabaseId ¶ added in v0.8.0
func (m *MockCompilerContext) GetDatabaseId(dbName string) (uint64, error)
func (*MockCompilerContext) GetPrimaryKeyDef ¶ added in v0.5.0
func (m *MockCompilerContext) GetPrimaryKeyDef(dbName string, tableName string) []*ColDef
func (*MockCompilerContext) GetProcess ¶ added in v0.7.0
func (m *MockCompilerContext) GetProcess() *process.Process
func (*MockCompilerContext) GetQueryResultMeta ¶ added in v0.7.0
func (m *MockCompilerContext) GetQueryResultMeta(uuid string) ([]*ColDef, string, error)
func (*MockCompilerContext) GetQueryingSubscription ¶ added in v0.8.0
func (m *MockCompilerContext) GetQueryingSubscription() *SubscriptionMeta
func (*MockCompilerContext) GetRootSql ¶ added in v0.6.0
func (m *MockCompilerContext) GetRootSql() string
func (*MockCompilerContext) GetStatsCache ¶ added in v0.8.0
func (m *MockCompilerContext) GetStatsCache() *StatsCache
func (*MockCompilerContext) GetSubscriptionMeta ¶ added in v0.8.0
func (m *MockCompilerContext) GetSubscriptionMeta(dbName string) (*SubscriptionMeta, error)
func (*MockCompilerContext) GetUserName ¶ added in v0.6.0
func (m *MockCompilerContext) GetUserName() string
func (*MockCompilerContext) IsPublishing ¶ added in v0.8.0
func (m *MockCompilerContext) IsPublishing(dbName string) (bool, error)
func (*MockCompilerContext) Resolve ¶ added in v0.5.0
func (m *MockCompilerContext) Resolve(dbName string, tableName string) (*ObjectRef, *TableDef)
func (*MockCompilerContext) ResolveAccountIds ¶ added in v0.7.0
func (m *MockCompilerContext) ResolveAccountIds(accountNames []string) ([]uint32, error)
func (*MockCompilerContext) ResolveById ¶ added in v0.7.0
func (m *MockCompilerContext) ResolveById(tableId uint64) (*ObjectRef, *TableDef)
func (*MockCompilerContext) ResolveUdf ¶ added in v0.8.0
func (*MockCompilerContext) ResolveVariable ¶ added in v0.5.0
func (m *MockCompilerContext) ResolveVariable(varName string, isSystemVar, isGlobalVar bool) (interface{}, error)
func (*MockCompilerContext) SetBuildingAlterView ¶ added in v0.7.0
func (m *MockCompilerContext) SetBuildingAlterView(yesOrNo bool, dbName, viewName string)
func (*MockCompilerContext) SetQueryingSubscription ¶ added in v0.8.0
func (m *MockCompilerContext) SetQueryingSubscription(*SubscriptionMeta)
func (*MockCompilerContext) Stats ¶ added in v0.7.0
func (m *MockCompilerContext) Stats(obj *ObjectRef) bool
type MockCompilerContext2 ¶ added in v0.7.0
type MockCompilerContext2 struct {
// contains filtered or unexported fields
}
MockCompilerContext2 is a mock of CompilerContext interface.
func NewMockCompilerContext2 ¶ added in v0.7.0
func NewMockCompilerContext2(ctrl *gomock.Controller) *MockCompilerContext2
NewMockCompilerContext2 creates a new mock instance.
func (*MockCompilerContext2) CheckSubscriptionValid ¶ added in v0.8.0
func (m *MockCompilerContext2) CheckSubscriptionValid(subName, accName, pubName string) error
CheckSubscriptionValid mocks base method.
func (*MockCompilerContext2) DatabaseExists ¶ added in v0.7.0
func (m *MockCompilerContext2) DatabaseExists(name string) bool
DatabaseExists mocks base method.
func (*MockCompilerContext2) DefaultDatabase ¶ added in v0.7.0
func (m *MockCompilerContext2) DefaultDatabase() string
DefaultDatabase mocks base method.
func (*MockCompilerContext2) EXPECT ¶ added in v0.7.0
func (m *MockCompilerContext2) EXPECT() *MockCompilerContext2MockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockCompilerContext2) GetAccountId ¶ added in v0.7.0
func (m *MockCompilerContext2) GetAccountId() uint32
GetAccountId mocks base method.
func (*MockCompilerContext2) GetBuildingAlterView ¶ added in v0.7.0
func (m *MockCompilerContext2) GetBuildingAlterView() (bool, string, string)
GetBuildingAlterView mocks base method.
func (*MockCompilerContext2) GetContext ¶ added in v0.7.0
func (m *MockCompilerContext2) GetContext() context.Context
GetContext mocks base method.
func (*MockCompilerContext2) GetDatabaseId ¶ added in v0.8.0
func (m *MockCompilerContext2) GetDatabaseId(dbName string) (uint64, error)
GetDatabaseId mocks base method.
func (*MockCompilerContext2) GetPrimaryKeyDef ¶ added in v0.7.0
func (m *MockCompilerContext2) GetPrimaryKeyDef(dbName, tableName string) []*ColDef
GetPrimaryKeyDef mocks base method.
func (*MockCompilerContext2) GetProcess ¶ added in v0.7.0
func (m *MockCompilerContext2) GetProcess() *process.Process
GetProcess mocks base method.
func (*MockCompilerContext2) GetQueryResultMeta ¶ added in v0.7.0
func (m *MockCompilerContext2) GetQueryResultMeta(uuid string) ([]*ColDef, string, error)
GetQueryResultMeta mocks base method.
func (*MockCompilerContext2) GetQueryingSubscription ¶ added in v0.8.0
func (m *MockCompilerContext2) GetQueryingSubscription() *SubscriptionMeta
GetQueryingSubscription mocks base method.
func (*MockCompilerContext2) GetRootSql ¶ added in v0.7.0
func (m *MockCompilerContext2) GetRootSql() string
GetRootSql mocks base method.
func (*MockCompilerContext2) GetStatsCache ¶ added in v0.8.0
func (m *MockCompilerContext2) GetStatsCache() *StatsCache
GetStatsCache mocks base method.
func (*MockCompilerContext2) GetSubscriptionMeta ¶ added in v0.8.0
func (m *MockCompilerContext2) GetSubscriptionMeta(dbName string) (*SubscriptionMeta, error)
GetSubscriptionMeta mocks base method.
func (*MockCompilerContext2) GetUserName ¶ added in v0.7.0
func (m *MockCompilerContext2) GetUserName() string
GetUserName mocks base method.
func (*MockCompilerContext2) IsPublishing ¶ added in v0.8.0
func (m *MockCompilerContext2) IsPublishing(dbName string) (bool, error)
IsPublishing mocks base method.
func (*MockCompilerContext2) Resolve ¶ added in v0.7.0
func (m *MockCompilerContext2) Resolve(schemaName, tableName string) (*ObjectRef, *TableDef)
Resolve mocks base method.
func (*MockCompilerContext2) ResolveAccountIds ¶ added in v0.7.0
func (m *MockCompilerContext2) ResolveAccountIds(accountNames []string) ([]uint32, error)
ResolveAccountIds mocks base method.
func (*MockCompilerContext2) ResolveById ¶ added in v0.7.0
func (m *MockCompilerContext2) ResolveById(tableId uint64) (*ObjectRef, *TableDef)
ResolveById mocks base method.
func (*MockCompilerContext2) ResolveUdf ¶ added in v0.8.0
func (m *MockCompilerContext2) ResolveUdf(name string, args []*Expr) (string, error)
ResolveUdf mocks base method.
func (*MockCompilerContext2) ResolveVariable ¶ added in v0.7.0
func (m *MockCompilerContext2) ResolveVariable(varName string, isSystemVar, isGlobalVar bool) (interface{}, error)
ResolveVariable mocks base method.
func (*MockCompilerContext2) SetBuildingAlterView ¶ added in v0.7.0
func (m *MockCompilerContext2) SetBuildingAlterView(yesOrNo bool, dbName, viewName string)
SetBuildingAlterView mocks base method.
func (*MockCompilerContext2) SetQueryingSubscription ¶ added in v0.8.0
func (m *MockCompilerContext2) SetQueryingSubscription(meta *SubscriptionMeta)
SetQueryingSubscription mocks base method.
func (*MockCompilerContext2) Stats ¶ added in v0.7.0
func (m *MockCompilerContext2) Stats(obj *ObjectRef) bool
Stats mocks base method.
type MockCompilerContext2MockRecorder ¶ added in v0.7.0
type MockCompilerContext2MockRecorder struct {
// contains filtered or unexported fields
}
MockCompilerContext2MockRecorder is the mock recorder for MockCompilerContext2.
func (*MockCompilerContext2MockRecorder) CheckSubscriptionValid ¶ added in v0.8.0
func (mr *MockCompilerContext2MockRecorder) CheckSubscriptionValid(subName, accName, pubName interface{}) *gomock.Call
CheckSubscriptionValid indicates an expected call of CheckSubscriptionValid.
func (*MockCompilerContext2MockRecorder) DatabaseExists ¶ added in v0.7.0
func (mr *MockCompilerContext2MockRecorder) DatabaseExists(name interface{}) *gomock.Call
DatabaseExists indicates an expected call of DatabaseExists.
func (*MockCompilerContext2MockRecorder) DefaultDatabase ¶ added in v0.7.0
func (mr *MockCompilerContext2MockRecorder) DefaultDatabase() *gomock.Call
DefaultDatabase indicates an expected call of DefaultDatabase.
func (*MockCompilerContext2MockRecorder) GetAccountId ¶ added in v0.7.0
func (mr *MockCompilerContext2MockRecorder) GetAccountId() *gomock.Call
GetAccountId indicates an expected call of GetAccountId.
func (*MockCompilerContext2MockRecorder) GetBuildingAlterView ¶ added in v0.7.0
func (mr *MockCompilerContext2MockRecorder) GetBuildingAlterView() *gomock.Call
GetBuildingAlterView indicates an expected call of GetBuildingAlterView.
func (*MockCompilerContext2MockRecorder) GetContext ¶ added in v0.7.0
func (mr *MockCompilerContext2MockRecorder) GetContext() *gomock.Call
GetContext indicates an expected call of GetContext.
func (*MockCompilerContext2MockRecorder) GetDatabaseId ¶ added in v0.8.0
func (mr *MockCompilerContext2MockRecorder) GetDatabaseId(dbName interface{}) *gomock.Call
GetDatabaseId indicates an expected call of GetDatabaseId.
func (*MockCompilerContext2MockRecorder) GetPrimaryKeyDef ¶ added in v0.7.0
func (mr *MockCompilerContext2MockRecorder) GetPrimaryKeyDef(dbName, tableName interface{}) *gomock.Call
GetPrimaryKeyDef indicates an expected call of GetPrimaryKeyDef.
func (*MockCompilerContext2MockRecorder) GetProcess ¶ added in v0.7.0
func (mr *MockCompilerContext2MockRecorder) GetProcess() *gomock.Call
GetProcess indicates an expected call of GetProcess.
func (*MockCompilerContext2MockRecorder) GetQueryResultMeta ¶ added in v0.7.0
func (mr *MockCompilerContext2MockRecorder) GetQueryResultMeta(uuid interface{}) *gomock.Call
GetQueryResultMeta indicates an expected call of GetQueryResultMeta.
func (*MockCompilerContext2MockRecorder) GetQueryingSubscription ¶ added in v0.8.0
func (mr *MockCompilerContext2MockRecorder) GetQueryingSubscription() *gomock.Call
GetQueryingSubscription indicates an expected call of GetQueryingSubscription.
func (*MockCompilerContext2MockRecorder) GetRootSql ¶ added in v0.7.0
func (mr *MockCompilerContext2MockRecorder) GetRootSql() *gomock.Call
GetRootSql indicates an expected call of GetRootSql.
func (*MockCompilerContext2MockRecorder) GetStatsCache ¶ added in v0.8.0
func (mr *MockCompilerContext2MockRecorder) GetStatsCache() *gomock.Call
GetStatsCache indicates an expected call of GetStatsCache.
func (*MockCompilerContext2MockRecorder) GetSubscriptionMeta ¶ added in v0.8.0
func (mr *MockCompilerContext2MockRecorder) GetSubscriptionMeta(dbName interface{}) *gomock.Call
GetSubscriptionMeta indicates an expected call of GetSubscriptionMeta.
func (*MockCompilerContext2MockRecorder) GetUserName ¶ added in v0.7.0
func (mr *MockCompilerContext2MockRecorder) GetUserName() *gomock.Call
GetUserName indicates an expected call of GetUserName.
func (*MockCompilerContext2MockRecorder) IsPublishing ¶ added in v0.8.0
func (mr *MockCompilerContext2MockRecorder) IsPublishing(dbName interface{}) *gomock.Call
IsPublishing indicates an expected call of IsPublishing.
func (*MockCompilerContext2MockRecorder) Resolve ¶ added in v0.7.0
func (mr *MockCompilerContext2MockRecorder) Resolve(schemaName, tableName interface{}) *gomock.Call
Resolve indicates an expected call of Resolve.
func (*MockCompilerContext2MockRecorder) ResolveAccountIds ¶ added in v0.7.0
func (mr *MockCompilerContext2MockRecorder) ResolveAccountIds(accountNames interface{}) *gomock.Call
ResolveAccountIds indicates an expected call of ResolveAccountIds.
func (*MockCompilerContext2MockRecorder) ResolveById ¶ added in v0.7.0
func (mr *MockCompilerContext2MockRecorder) ResolveById(tableId interface{}) *gomock.Call
ResolveById indicates an expected call of ResolveById.
func (*MockCompilerContext2MockRecorder) ResolveUdf ¶ added in v0.8.0
func (mr *MockCompilerContext2MockRecorder) ResolveUdf(name, args interface{}) *gomock.Call
ResolveUdf indicates an expected call of ResolveUdf.
func (*MockCompilerContext2MockRecorder) ResolveVariable ¶ added in v0.7.0
func (mr *MockCompilerContext2MockRecorder) ResolveVariable(varName, isSystemVar, isGlobalVar interface{}) *gomock.Call
ResolveVariable indicates an expected call of ResolveVariable.
func (*MockCompilerContext2MockRecorder) SetBuildingAlterView ¶ added in v0.7.0
func (mr *MockCompilerContext2MockRecorder) SetBuildingAlterView(yesOrNo, dbName, viewName interface{}) *gomock.Call
SetBuildingAlterView indicates an expected call of SetBuildingAlterView.
func (*MockCompilerContext2MockRecorder) SetQueryingSubscription ¶ added in v0.8.0
func (mr *MockCompilerContext2MockRecorder) SetQueryingSubscription(meta interface{}) *gomock.Call
SetQueryingSubscription indicates an expected call of SetQueryingSubscription.
func (*MockCompilerContext2MockRecorder) Stats ¶ added in v0.7.0
func (mr *MockCompilerContext2MockRecorder) Stats(obj interface{}) *gomock.Call
Stats indicates an expected call of Stats.
type MockOptimizer ¶ added in v0.5.0
type MockOptimizer struct {
// contains filtered or unexported fields
}
func NewEmptyMockOptimizer ¶ added in v0.5.0
func NewEmptyMockOptimizer() *MockOptimizer
func NewMockOptimizer ¶ added in v0.5.0
func NewMockOptimizer(_ bool) *MockOptimizer
func (*MockOptimizer) CurrentContext ¶ added in v0.5.0
func (moc *MockOptimizer) CurrentContext() CompilerContext
type MockOptimizer2 ¶ added in v0.7.0
type MockOptimizer2 struct {
// contains filtered or unexported fields
}
MockOptimizer2 is a mock of Optimizer interface.
func NewMockOptimizer2 ¶ added in v0.7.0
func NewMockOptimizer2(ctrl *gomock.Controller) *MockOptimizer2
NewMockOptimizer2 creates a new mock instance.
func (*MockOptimizer2) CurrentContext ¶ added in v0.7.0
func (m *MockOptimizer2) CurrentContext() CompilerContext
CurrentContext mocks base method.
func (*MockOptimizer2) EXPECT ¶ added in v0.7.0
func (m *MockOptimizer2) EXPECT() *MockOptimizer2MockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockOptimizer2MockRecorder ¶ added in v0.7.0
type MockOptimizer2MockRecorder struct {
// contains filtered or unexported fields
}
MockOptimizer2MockRecorder is the mock recorder for MockOptimizer2.
func (*MockOptimizer2MockRecorder) CurrentContext ¶ added in v0.7.0
func (mr *MockOptimizer2MockRecorder) CurrentContext() *gomock.Call
CurrentContext indicates an expected call of CurrentContext.
func (*MockOptimizer2MockRecorder) Optimize ¶ added in v0.7.0
func (mr *MockOptimizer2MockRecorder) Optimize(stmt interface{}) *gomock.Call
Optimize indicates an expected call of Optimize.
type MockRule ¶ added in v0.7.0
type MockRule struct {
// contains filtered or unexported fields
}
MockRule is a mock of Rule interface.
func NewMockRule ¶ added in v0.7.0
func NewMockRule(ctrl *gomock.Controller) *MockRule
NewMockRule creates a new mock instance.
func (*MockRule) EXPECT ¶ added in v0.7.0
func (m *MockRule) EXPECT() *MockRuleMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockRuleMockRecorder ¶ added in v0.7.0
type MockRuleMockRecorder struct {
// contains filtered or unexported fields
}
MockRuleMockRecorder is the mock recorder for MockRule.
func (*MockRuleMockRecorder) Apply ¶ added in v0.7.0
func (mr *MockRuleMockRecorder) Apply(arg0, arg1, arg2 interface{}) *gomock.Call
Apply indicates an expected call of Apply.
func (*MockRuleMockRecorder) Match ¶ added in v0.7.0
func (mr *MockRuleMockRecorder) Match(arg0 interface{}) *gomock.Call
Match indicates an expected call of Match.
type NameTuple ¶ added in v0.5.0
type NameTuple struct {
// contains filtered or unexported fields
}
type Optimizer ¶ added in v0.5.0
type Optimizer interface { Optimize(stmt tree.Statement) (*Query, error) CurrentContext() CompilerContext }
type OrderBinder ¶ added in v0.5.0
type OrderBinder struct { *ProjectionBinder // contains filtered or unexported fields }
func NewOrderBinder ¶ added in v0.5.0
func NewOrderBinder(projectionBinder *ProjectionBinder, selectList tree.SelectExprs) *OrderBinder
func (OrderBinder) GetContext ¶ added in v0.7.0
type OrderBySpec ¶ added in v0.6.0
type OrderBySpec = plan.OrderBySpec
type PartitionBinder ¶ added in v0.6.0
type PartitionBinder struct {
// contains filtered or unexported fields
}
func NewPartitionBinder ¶ added in v0.6.0
func NewPartitionBinder(builder *QueryBuilder, ctx *BindContext) *PartitionBinder
func (*PartitionBinder) BindAggFunc ¶ added in v0.6.0
func (*PartitionBinder) BindColRef ¶ added in v0.6.0
func (p *PartitionBinder) BindColRef(name *tree.UnresolvedName, i int32, b bool) (*plan.Expr, error)
func (*PartitionBinder) BindSubquery ¶ added in v0.6.0
func (*PartitionBinder) BindWinFunc ¶ added in v0.6.0
func (*PartitionBinder) GetContext ¶ added in v0.7.0
type PartitionByDef ¶ added in v0.7.0
type PartitionByDef = plan.PartitionByDef
type Plan_Query ¶ added in v0.5.0
type Plan_Query = plan.Plan_Query
type PrimaryKeyDef ¶ added in v0.7.0
type PrimaryKeyDef = plan.PrimaryKeyDef
type ProjectionBinder ¶ added in v0.5.0
type ProjectionBinder struct {
// contains filtered or unexported fields
}
func NewProjectionBinder ¶ added in v0.5.0
func NewProjectionBinder(builder *QueryBuilder, ctx *BindContext, havingBinder *HavingBinder) *ProjectionBinder
func (*ProjectionBinder) BindAggFunc ¶ added in v0.5.0
func (*ProjectionBinder) BindColRef ¶ added in v0.5.0
func (b *ProjectionBinder) BindColRef(astExpr *tree.UnresolvedName, depth int32, isRoot bool) (*plan.Expr, error)
func (*ProjectionBinder) BindSubquery ¶ added in v0.5.0
func (*ProjectionBinder) BindWinFunc ¶ added in v0.5.0
func (*ProjectionBinder) GetContext ¶ added in v0.7.0
type PropertiesDef ¶ added in v0.6.0
type PropertiesDef = plan.PropertiesDef
type QueryBuilder ¶ added in v0.5.0
type QueryBuilder struct {
// contains filtered or unexported fields
}
func NewQueryBuilder ¶ added in v0.5.0
func NewQueryBuilder(queryType plan.Query_StatementType, ctx CompilerContext, isPrepareStatement bool) *QueryBuilder
func (*QueryBuilder) GetContext ¶ added in v0.7.0
func (builder *QueryBuilder) GetContext() context.Context
func (*QueryBuilder) IsEquiJoin ¶ added in v0.8.0
func (builder *QueryBuilder) IsEquiJoin(node *plan.Node) bool
type RecomputeRealTimeRelatedFuncRule ¶ added in v0.7.0
type RecomputeRealTimeRelatedFuncRule struct {
// contains filtered or unexported fields
}
func NewRecomputeRealTimeRelatedFuncRule ¶ added in v0.7.0
func NewRecomputeRealTimeRelatedFuncRule(proc *process.Process) *RecomputeRealTimeRelatedFuncRule
func (*RecomputeRealTimeRelatedFuncRule) ApplyNode ¶ added in v0.7.0
func (r *RecomputeRealTimeRelatedFuncRule) ApplyNode(_ *Node) error
func (*RecomputeRealTimeRelatedFuncRule) IsApplyExpr ¶ added in v0.7.0
func (r *RecomputeRealTimeRelatedFuncRule) IsApplyExpr() bool
func (*RecomputeRealTimeRelatedFuncRule) MatchNode ¶ added in v0.7.0
func (r *RecomputeRealTimeRelatedFuncRule) MatchNode(_ *Node) bool
type ResetParamOrderRule ¶ added in v0.6.0
type ResetParamOrderRule struct {
// contains filtered or unexported fields
}
func NewResetParamOrderRule ¶ added in v0.6.0
func NewResetParamOrderRule(params map[int]int) *ResetParamOrderRule
func (*ResetParamOrderRule) ApplyNode ¶ added in v0.6.0
func (rule *ResetParamOrderRule) ApplyNode(node *Node) error
func (*ResetParamOrderRule) IsApplyExpr ¶ added in v0.6.0
func (rule *ResetParamOrderRule) IsApplyExpr() bool
func (*ResetParamOrderRule) MatchNode ¶ added in v0.6.0
func (rule *ResetParamOrderRule) MatchNode(_ *Node) bool
type ResetParamRefRule ¶ added in v0.6.0
type ResetParamRefRule struct {
// contains filtered or unexported fields
}
func NewResetParamRefRule ¶ added in v0.6.0
func NewResetParamRefRule(ctx context.Context, params []*Expr) *ResetParamRefRule
func (*ResetParamRefRule) ApplyNode ¶ added in v0.6.0
func (rule *ResetParamRefRule) ApplyNode(node *Node) error
func (*ResetParamRefRule) IsApplyExpr ¶ added in v0.6.0
func (rule *ResetParamRefRule) IsApplyExpr() bool
func (*ResetParamRefRule) MatchNode ¶ added in v0.6.0
func (rule *ResetParamRefRule) MatchNode(_ *Node) bool
type ResetVarRefRule ¶ added in v0.6.0
type ResetVarRefRule struct {
// contains filtered or unexported fields
}
func NewResetVarRefRule ¶ added in v0.6.0
func NewResetVarRefRule(compCtx CompilerContext, proc *process.Process) *ResetVarRefRule
func (*ResetVarRefRule) ApplyNode ¶ added in v0.6.0
func (rule *ResetVarRefRule) ApplyNode(node *Node) error
func (*ResetVarRefRule) IsApplyExpr ¶ added in v0.6.0
func (rule *ResetVarRefRule) IsApplyExpr() bool
func (*ResetVarRefRule) MatchNode ¶ added in v0.6.0
func (rule *ResetVarRefRule) MatchNode(_ *Node) bool
type RowsetData ¶ added in v0.5.0
type RowsetData = plan.RowsetData
type SetBinder ¶ added in v0.8.0
type SetBinder struct {
// contains filtered or unexported fields
}
SetBinder for 'set @var = expr'
func NewSetVarBinder ¶ added in v0.8.0
func NewSetVarBinder(builder *QueryBuilder, ctx *BindContext) *SetBinder
func (*SetBinder) BindAggFunc ¶ added in v0.8.0
func (*SetBinder) BindColRef ¶ added in v0.8.0
func (*SetBinder) BindSubquery ¶ added in v0.8.0
func (*SetBinder) BindWinFunc ¶ added in v0.8.0
func (*SetBinder) GetContext ¶ added in v0.8.0
type StatsCache ¶ added in v0.8.0
type StatsCache struct {
// contains filtered or unexported fields
}
stats cache is small, no need to use LRU for now
func NewStatsCache ¶ added in v0.8.0
func NewStatsCache() *StatsCache
func (*StatsCache) GetStatsInfoMap ¶ added in v0.8.0
func (sc *StatsCache) GetStatsInfoMap(tableID uint64) *StatsInfoMap
type StatsInfoMap ¶ added in v0.8.0
type StatsInfoMap struct { NdvMap map[string]float64 MinValMap map[string]float64 MaxValMap map[string]float64 DataTypeMap map[string]types.T BlockNumber int //detect if block number changes , update stats info map TableCnt float64 // contains filtered or unexported fields }
func NewStatsInfoMap ¶ added in v0.8.0
func NewStatsInfoMap() *StatsInfoMap
func (*StatsInfoMap) NeedUpdate ¶ added in v0.8.0
func (sc *StatsInfoMap) NeedUpdate(currentBlockNum int) bool
type SubscriptionMeta ¶ added in v0.8.0
type SubscriptionMeta = plan.SubscriptionMeta
type TableBinder ¶ added in v0.5.0
type TableBinder struct {
// contains filtered or unexported fields
}
func NewTableBinder ¶ added in v0.5.0
func NewTableBinder(builder *QueryBuilder, ctx *BindContext) *TableBinder
func (*TableBinder) BindAggFunc ¶ added in v0.5.0
func (*TableBinder) BindColRef ¶ added in v0.5.0
func (b *TableBinder) BindColRef(astExpr *tree.UnresolvedName, depth int32, isRoot bool) (*plan.Expr, error)
func (*TableBinder) BindSubquery ¶ added in v0.5.0
func (*TableBinder) BindWinFunc ¶ added in v0.5.0
func (*TableBinder) GetContext ¶ added in v0.7.0
type TableDefType ¶ added in v0.6.0
type TableDefType = plan.TableDef_DefType
type TableDef_DefType_Properties ¶ added in v0.6.0
type TableDef_DefType_Properties = plan.TableDef_DefType_Properties
type UpdateBinder ¶ added in v0.8.0
type UpdateBinder struct {
// contains filtered or unexported fields
}
func NewUpdateBinder ¶ added in v0.8.0
func NewUpdateBinder(sysCtx context.Context, builder *QueryBuilder, ctx *BindContext, cols []*ColDef) *UpdateBinder
use for on duplicate key update clause: eg: insert into t1 values(1,1),(2,2) on duplicate key update a = a + abs(b), b = values(b)-2
func (*UpdateBinder) BindAggFunc ¶ added in v0.8.0
func (*UpdateBinder) BindColRef ¶ added in v0.8.0
func (b *UpdateBinder) BindColRef(astExpr *tree.UnresolvedName, depth int32, isRoot bool) (*plan.Expr, error)
func (*UpdateBinder) BindSubquery ¶ added in v0.8.0
func (*UpdateBinder) BindWinFunc ¶ added in v0.8.0
func (*UpdateBinder) GetContext ¶ added in v0.8.0
type VisitPlan ¶ added in v0.6.0
type VisitPlan struct {
// contains filtered or unexported fields
}
func NewVisitPlan ¶ added in v0.6.0
func NewVisitPlan(pl *Plan, rules []VisitPlanRule) *VisitPlan
type VisitPlanRule ¶ added in v0.6.0
type WhereBinder ¶ added in v0.5.0
type WhereBinder struct {
// contains filtered or unexported fields
}
func NewWhereBinder ¶ added in v0.5.0
func NewWhereBinder(builder *QueryBuilder, ctx *BindContext) *WhereBinder
func (*WhereBinder) BindAggFunc ¶ added in v0.5.0
func (*WhereBinder) BindColRef ¶ added in v0.5.0
func (b *WhereBinder) BindColRef(astExpr *tree.UnresolvedName, depth int32, isRoot bool) (*plan.Expr, error)
func (*WhereBinder) BindSubquery ¶ added in v0.5.0
func (*WhereBinder) BindWinFunc ¶ added in v0.5.0
func (*WhereBinder) GetContext ¶ added in v0.7.0
Source Files ¶
- agg_pushdown_pullup.go
- alter_util.go
- base_binder.go
- bind_context.go
- binding.go
- build.go
- build_alter_add_column.go
- build_alter_add_primarykey.go
- build_alter_change_column.go
- build_alter_modify_column.go
- build_alter_rename_column.go
- build_alter_table.go
- build_constraint_util.go
- build_dcl.go
- build_ddl.go
- build_delete.go
- build_dml_util.go
- build_index_util.go
- build_insert.go
- build_load.go
- build_replace.go
- build_show.go
- build_transation.go
- build_update.go
- build_util.go
- build_values.go
- const.go
- current_account.go
- deepcopy.go
- default_binder.go
- distinct_agg.go
- external.go
- flatten_subquery.go
- fromOldFunction.go
- generate_series.go
- group_binder.go
- having_binder.go
- join_order.go
- limit_binder.go
- make.go
- meta_scan.go
- metadata_scan.go
- mock.go
- mysql_compatibility.go
- opt_misc.go
- optimize.go
- order_binder.go
- partition.go
- partition_binder.go
- partition_hash.go
- partition_key.go
- partition_list.go
- partition_range.go
- partition_util.go
- processlist.go
- projection_binder.go
- query_builder.go
- result_scan.go
- runtime_filter.go
- set_binder.go
- shuffle.go
- stats.go
- table_binder.go
- tools.go
- types.go
- types_mock.go
- unnest.go
- update_binder.go
- utils.go
- visit_plan.go
- visit_plan_rule.go
- where_binder.go