plan

package
v1.2.4 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: Apache-2.0 Imports: 64 Imported by: 0

Documentation

Overview

Package plan is a generated GoMock package.

Index

Constants

View Source
const (
	TimeWindowStart = "_wstart"
	TimeWindowEnd   = "_wend"
)
View Source
const (
	NotSampleByRows     = -1
	NotSampleByPercents = -1.0
)
View Source
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

	/*
		    https://dev.mysql.com/doc/refman/8.0/en/create-table.html
			1. KEY(column_list): the column_list argument is simply a list of 1 or more table columns (maximum: 16).
			2. RANGE COLUMNS(column_list): The maximum number of columns that can be referenced in the column_list
				and value_list is 16.
			3. LIST COLUMNS(column_list): The maximum number of columns that can be used in the column_list and
				in the elements making up the value_list is 16.
	*/
	PartitionColumnsLimit = 16
)
View Source
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

View Source
const (
	InFilterCardLimitNonPK   = 10000
	InFilterCardLimitPK      = 320000
	BloomFilterCardLimit     = 100 * InFilterCardLimitNonPK
	InFilterSelectivityLimit = 0.05
)
View Source
const (
	HashMapSizeForShuffle = 160000

	MAXShuffleDOP                   = 64
	ShuffleThreshHoldOfNDV          = 50000
	ShuffleTypeThreshHoldLowerLimit = 16
	ShuffleTypeThreshHoldUpperLimit = 1024
)
View Source
const (
	ShuffleToRegIndex        int32 = 0
	ShuffleToLocalMatchedReg int32 = 1
	ShuffleToMultiMatchedReg int32 = 2
)
View Source
const (
	MoLocksColTypeCnId = iota
	//MoLocksColTypeSessionId
	MoLocksColTypeTxnId
	MoLocksColTypeTableId
	//MoLocksColTypeTableName
	MoLocksColTypeLockKey
	MoLocksColTypeLockContent
	MoLocksColTypeLockMode
	MoLocksColTypeLockStatus
	MoLocksColTypeLockWait
)
View Source
const (
	MoConfigColTypeNodeType = iota
	MoConfigColTypeNodeId
	MoConfigColTypeName
	MoConfigColTypeCurrentValue
	MoConfigColTypeDefaultValue
	MoConfigColTypeInternal
)
View Source
const (
	MoTransactionsColTypeCnId = iota
	MoTransactionsColTypeTxnId
	MoTransactionsColTypeCreateTs
	MoTransactionsColTypeSnapshotTs
	MoTransactionsColTypePreparedTs
	MoTransactionsColTypeCommitTs
	MoTransactionsColTypeTxnMode
	MoTransactionsColTypeIsolation
	MoTransactionsColTypeUserTxn
	MoTransactionsColTypeTxnStatus
	MoTransactionsColTypeTableId
	MoTransactionsColTypeLockKey
	MoTransactionsColTypeLockContent
	MoTransactionsColTypeLockMode
)
View Source
const (
	MoCacheColTypeNodeType = iota
	MoCacheColTypeNodeId
	MoCacheColTypeType
	MoCacheColTypeUsed
	MoCacheColTypeFree
	MoCacheColTypeHitRatio
)
View Source
const (
	JoinSideNone       int8 = 0
	JoinSideLeft            = 1 << 1
	JoinSideRight           = 1 << 2
	JoinSideBoth            = JoinSideLeft | JoinSideRight
	JoinSideMark            = 1 << 3
	JoinSideCorrelated      = 1 << 4
)
View Source
const (
	NotFound      int32 = math.MaxInt32
	AmbiguousName int32 = math.MinInt32
)
View Source
const BlockNumForceOneCN = 200
View Source
const DefaultBlockMaxRows = 8192
View Source
const INFORMATION_SCHEMA = "information_schema"
View Source
const (
	LoadParallelMinSize = 1 << 20
)
View Source
const MO_CATALOG_DB_NAME = "mo_catalog"
View Source
const MO_DEFUALT_HOSTNAME = "localhost"
View Source
const (
	// MaxFsp is the maximum digit of fractional seconds part.
	MaxFsp = 6
)
View Source
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
)
View Source
const NameClusterCenters = "cluster_centers"
View Source
const NameGroupConcat = "group_concat"
View Source
const (
	// PrimaryKeyName defines primary key name.
	PrimaryKeyName = "PRIMARY"
)
View Source
const SF float64 = 1
View Source
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
)
View Source
const UnKnownColId uint64 = math.MaxUint64

Variables

View Source
var (
	MetadataScanColDefs   = []*plan.ColDef{}
	MetadataScanColTypes  = []types.Type{}
	Metadata_Rows_Cnt_Pos int32
)
View Source
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

View Source
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

View Source
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

View Source
var ForceCastExpr = forceCastExpr
View Source
var (
	GSColDefs = [3][]*plan.ColDef{}
)
View Source
var MakePlan2Float64ConstExprWithType = makePlan2Float64ConstExprWithType
View Source
var MakePlan2Int64ConstExprWithType = makePlan2Int64ConstExprWithType
View Source
var MakePlan2Int64VecExprWithType = makePlan2Int64VecExprWithType
View Source
var MakePlan2StringConstExprWithType = makePlan2StringConstExprWithType
View Source
var MakePlan2StringVecExprWithType = makePlan2StringVecExprWithType
View Source
var MakePlan2Type = makePlan2Type
View Source
var MakePlan2Uint64ConstExprWithType = makePlan2Uint64ConstExprWithType
View Source
var MakePlan2Vecf32ConstExprWithType = makePlan2Vecf32ConstExprWithType
View Source
var MakeTypeByPlan2Expr = makeTypeByPlan2Expr
View Source
var MakeTypeByPlan2Type = makeTypeByPlan2Type
View Source
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,
			},
		},
		{
			Name: catalog.MetaColNames[catalog.SAVED_ROW_COUNT_IDX],
			Typ: plan.Type{
				Id:          int32(catalog.MetaColTypes[catalog.SAVED_ROW_COUNT_IDX].Oid),
				NotNullable: false,
			},
		},
		{
			Name: catalog.MetaColNames[catalog.QUERY_ROW_COUNT_IDX],
			Typ: plan.Type{
				Id:          int32(catalog.MetaColTypes[catalog.QUERY_ROW_COUNT_IDX].Oid),
				NotNullable: false,
			},
		},
	}
)
View Source
var MoCacheColName2Index = map[string]int32{
	"node_type": 0,
	"node_id":   1,
	"type":      2,
	"used":      3,
	"free":      4,
	"hit_ratio": 5,
}
View Source
var MoCacheColNames = []string{
	"node_type",
	"node_id",
	"type",
	"used",
	"free",
	"hit_ratio",
}
View Source
var MoConfigColName2Index = map[string]int32{
	"node_type":     0,
	"node_id":       1,
	"name":          2,
	"current_value": 3,
	"default_value": 4,
	"internal":      5,
}
View Source
var MoConfigColNames = []string{
	"node_type",
	"node_id",
	"name",
	"current_value",
	"default_value",
	"internal",
}
View Source
var MoLocksColName2Index = map[string]int32{
	"cn_id":        0,
	"txn_id":       1,
	"table_id":     2,
	"lock_key":     3,
	"lock_content": 4,
	"lock_mode":    5,
	"lock_status":  6,
	"lock_wait":    7,
}
View Source
var MoLocksColNames = []string{
	"cn_id",

	"txn_id",
	"table_id",

	"lock_key",
	"lock_content",
	"lock_mode",
	"lock_status",
	"lock_wait",
}
View Source
var MoTransactionsColName2Index = map[string]int32{
	"cn_id":        0,
	"txn_id":       1,
	"create_ts":    2,
	"snapshot_ts":  3,
	"prepared_ts":  4,
	"commit_ts":    5,
	"txn_mode":     6,
	"isolation":    7,
	"user_txn":     8,
	"txn_status":   9,
	"table_id":     10,
	"lock_key":     11,
	"lock_content": 12,
	"lock_mode":    13,
}
View Source
var MoTransactionsColNames = []string{
	"cn_id",
	"txn_id",
	"create_ts",
	"snapshot_ts",
	"prepared_ts",
	"commit_ts",
	"txn_mode",
	"isolation",
	"user_txn",
	"txn_status",
	"table_id",
	"lock_key",
	"lock_content",
	"lock_mode",
}
View Source
var (
	STATEMENT_ACCOUNT = "account"
)
View Source
var Sequence_cols_name = []string{"last_seq_num", "min_value", "max_value", "start_value", "increment_value", "cycle", "is_called"}
View Source
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 AddTablePartitions added in v1.2.0

AddTablePartitions will add a new partition 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 AssignAuxIdForExpr(expr *plan.Expr, start int32) int32

func BindFuncExprImplByPlanExpr added in v0.8.0

func BindFuncExprImplByPlanExpr(ctx context.Context, name string, args []*Expr) (*plan.Expr, error)

func BuildVectorsByData added in v0.7.0

func BuildVectorsByData(datas [][2]any, dataTypes []uint8, mp *mpool.MPool) []*vector.Vector

func ByteSliceToUint64 added in v1.0.0

func ByteSliceToUint64(bytes []byte) uint64

convert first 8 bytes to uint64, slice might be less than 8 bytes

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

func CheckColumnNameValid(ctx context.Context, colName string) error

Check if the column name is valid and conflicts with internal hidden columns

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 ConstandFoldList added in v1.2.0

func ConstandFoldList(exprs []*plan.Expr, proc *process.Process, varAndParamIsConst bool) ([]*plan.Expr, error)

func ConstantFold added in v0.6.0

func ConstantFold(bat *batch.Batch, expr *plan.Expr, proc *process.Process, varAndParamIsConst bool, foldInExpr bool) (*plan.Expr, error)

func ConstructCreateTableSQL added in v1.2.1

func ConstructCreateTableSQL(tableObjRef *plan.ObjectRef, tableDef *plan.TableDef, snapshot Snapshot, ctx CompilerContext) (string, error)

ConstructCreateTableSQL used to build CREATE Table statement

func CreateIndexDef added in v1.1.0

func CreateIndexDef(indexInfo *tree.Index,
	indexTableName, indexAlgoTableType string,
	indexParts []string, isUnique bool) (*plan.IndexDef, error)

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 DeepCopyColData added in v0.6.0

func DeepCopyColData(col *plan.ColData) *plan.ColData

func DeepCopyColDef added in v0.6.0

func DeepCopyColDef(col *plan.ColDef) *plan.ColDef

func DeepCopyDataDefinition added in v0.6.0

func DeepCopyDataDefinition(old *plan.DataDefinition) *plan.DataDefinition

func DeepCopyDefault added in v0.6.0

func DeepCopyDefault(def *plan.Default) *plan.Default

func DeepCopyDeleteCtx added in v0.7.0

func DeepCopyDeleteCtx(ctx *plan.DeleteCtx) *plan.DeleteCtx

func DeepCopyIndexDef added in v0.7.0

func DeepCopyIndexDef(indexDef *plan.IndexDef) *plan.IndexDef

func DeepCopyIndexOption added in v1.1.0

func DeepCopyIndexOption(indexOption *plan.IndexOption) *plan.IndexOption

func DeepCopyInsertCtx added in v0.7.0

func DeepCopyInsertCtx(ctx *plan.InsertCtx) *plan.InsertCtx

func DeepCopyLockTarget added in v0.8.0

func DeepCopyLockTarget(target *plan.LockTarget) *plan.LockTarget

func DeepCopyNode added in v0.6.0

func DeepCopyNode(node *plan.Node) *plan.Node

func DeepCopyNumberList added in v0.8.0

func DeepCopyNumberList[T constraints.Integer](src []T) []T

func DeepCopyObjectRef added in v0.7.0

func DeepCopyObjectRef(ref *plan.ObjectRef) *plan.ObjectRef

func DeepCopyOnDupliateKeyCtx added in v0.8.0

func DeepCopyOnDupliateKeyCtx(ctx *plan.OnDuplicateKeyCtx) *plan.OnDuplicateKeyCtx

func DeepCopyOnUpdate added in v0.6.0

func DeepCopyOnUpdate(old *plan.OnUpdate) *plan.OnUpdate

func DeepCopyOrderBy added in v0.6.0

func DeepCopyOrderBy(orderBy *plan.OrderBySpec) *plan.OrderBySpec

func DeepCopyPartitionPrune added in v1.0.0

func DeepCopyPartitionPrune(partitionPrune *plan.PartitionPrune) *plan.PartitionPrune

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 DeepCopyQuery added in v0.6.0

func DeepCopyQuery(qry *plan.Query) *plan.Query

func DeepCopyReplaceCtx added in v1.2.1

func DeepCopyReplaceCtx(oldCtx *plan.ReplaceCtx) *plan.ReplaceCtx

func DeepCopySampleFuncSpec added in v1.1.0

func DeepCopySampleFuncSpec(source *plan.SampleFuncSpec) *plan.SampleFuncSpec

func DeepCopySliceInt64 added in v1.1.0

func DeepCopySliceInt64(s []int64) []int64

func DeepCopyStats added in v1.0.0

func DeepCopyStats(stats *plan.Stats) *plan.Stats

func DeepCopyStringList added in v0.8.0

func DeepCopyStringList(src []string) []string

func DeepCopyTableDef added in v0.6.0

func DeepCopyTableDef(table *plan.TableDef, withCols bool) *plan.TableDef

func DeepCopyTableDefList added in v0.8.0

func DeepCopyTableDefList(src []*plan.TableDef) []*plan.TableDef

func DeepCopyType added in v0.8.0

func DeepCopyType(typ *plan.Type) *plan.Type

func DefaultHugeStats added in v0.8.0

func DefaultHugeStats() *plan.Stats

func DefaultMinimalStats added in v1.1.0

func DefaultMinimalStats() *plan.Stats

func DefaultStats added in v0.7.0

func DefaultStats() *plan.Stats

func DefaultValueIsNull added in v1.0.0

func DefaultValueIsNull(Default *plan.Default) bool

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 EscapeFormat added in v1.2.1

func EscapeFormat(s string) string

EscapeFormat output escape character with backslash.

func EvalFilterExpr added in v0.7.0

func EvalFilterExpr(ctx context.Context, expr *plan.Expr, bat *batch.Batch, proc *process.Process) (bool, error)

func EvalPlanExpr added in v0.7.0

func EvalPlanExpr(ctx context.Context, expr *plan.Expr, process *process.Process) (*plan.Expr, error)

func ExprIsZonemappable added in v1.1.1

func ExprIsZonemappable(ctx context.Context, expr *plan.Expr) bool

func ExtractToDateReturnType added in v0.8.0

func ExtractToDateReturnType(format string) (tp types.T, fsp int)

func Find added in v1.2.1

func Find[T ~string | ~int, S any](data map[T]S, val T) bool

func FormatColType added in v1.2.1

func FormatColType(colType plan.Type) string

FormatColType Get the formatted description of the column type.

func FormatExpr added in v0.8.0

func FormatExpr(expr *plan.Expr) string

func FormatExprs added in v1.2.0

func FormatExprs(exprs []*plan.Expr) string

func GenConstraintName added in v1.1.2

func GenConstraintName() string

GenConstraintName yields uuid for the constraint name

func GetBindings added in v0.5.0

func GetBindings(expr *plan.Expr) []int32

func GetCenterValueForZMSigned added in v1.1.0

func GetCenterValueForZMSigned(zm objectio.ZoneMap) int64

func GetCenterValueForZMUnsigned added in v1.1.0

func GetCenterValueForZMUnsigned(zm objectio.ZoneMap) uint64

func GetColumnMapByExpr added in v0.8.0

func GetColumnMapByExpr(expr *plan.Expr, tableDef *plan.TableDef, columnMap map[int]int)

func GetColumnMapByExprs added in v0.8.0

func GetColumnMapByExprs(exprs []*plan.Expr, tableDef *plan.TableDef, columnMap map[int]int)

func GetColumnsByExpr added in v0.7.0

func GetColumnsByExpr(
	expr *plan.Expr,
	tableDef *plan.TableDef,
) (columnMap map[int]int, defColumns, exprColumns []int, maxCol int)

func GetFkReferredTo added in v1.1.2

func GetFkReferredTo(ctx CompilerContext, db, table string) (map[FkReferKey]map[string][]*FkReferDef, error)

GetFkReferredTo returns the foreign key relationships that refer to the table

func GetForETLWithType added in v0.7.0

func GetForETLWithType(param *tree.ExternParam, prefix string) (res fileservice.ETLFileService, readPath string, err error)

func GetFunctionArgTypeStrFromAst added in v1.1.0

func GetFunctionArgTypeStrFromAst(arg tree.FunctionArg) (string, error)

GetFunctionArgTypeStrFromAst function arg type do not have scale and width, it depends on the data that it process

func GetFunctionTypeStrFromAst added in v1.1.0

func GetFunctionTypeStrFromAst(typRef tree.ResolvableTypeReference) (string, error)

func GetHashColumn added in v0.8.0

func GetHashColumn(expr *plan.Expr) (*plan.ColRef, int32)

func GetInFilterCardLimit added in v1.1.1

func GetInFilterCardLimit() int32

func GetInFilterCardLimitOnPK added in v1.2.0

func GetInFilterCardLimitOnPK(tableCnt float64) int32

func GetRangeShuffleIndexForZM added in v0.8.0

func GetRangeShuffleIndexForZM(minVal, maxVal int64, zm objectio.ZoneMap, upplerLimit uint64) uint64

func GetRangeShuffleIndexForZMSignedSlice added in v1.1.0

func GetRangeShuffleIndexForZMSignedSlice(val []int64, zm objectio.ZoneMap) uint64

func GetRangeShuffleIndexForZMUnsignedSlice added in v1.1.0

func GetRangeShuffleIndexForZMUnsignedSlice(val []uint64, zm objectio.ZoneMap) uint64

func GetRangeShuffleIndexSignedMinMax added in v1.1.0

func GetRangeShuffleIndexSignedMinMax(minVal, maxVal, currentVal int64, upplerLimit uint64) uint64

func GetRangeShuffleIndexSignedSlice added in v1.1.0

func GetRangeShuffleIndexSignedSlice(val []int64, currentVal int64) uint64

func GetRangeShuffleIndexUnsignedMinMax added in v1.1.0

func GetRangeShuffleIndexUnsignedMinMax(minVal, maxVal, currentVal uint64, upplerLimit uint64) uint64

func GetRangeShuffleIndexUnsignedSlice added in v1.1.0

func GetRangeShuffleIndexUnsignedSlice(val []uint64, currentVal uint64) uint64

func GetRowSizeFromTableDef added in v1.2.0

func GetRowSizeFromTableDef(tableDef *TableDef, ignoreHiddenKey bool) float64

func GetShuffleDop added in v0.8.0

func GetShuffleDop(cpunum int) (dop int)

func GetSortOrder added in v0.8.0

func GetSortOrder(tableDef *plan.TableDef, colPos int32) int

func GetSortOrderByName added in v1.2.0

func GetSortOrderByName(tableDef *plan.TableDef, colName string) int

todo: remove this in the future

func GetSqlForFkReferredTo added in v1.1.2

func GetSqlForFkReferredTo(db, table string) string

GetSqlForFkReferredTo returns the query that retrieves the fk relationships that refer to the table

func GetUniqueColAndIdxFromTableDef added in v0.8.0

func GetUniqueColAndIdxFromTableDef(tableDef *TableDef) []map[string]int

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 GetVarValue(
	ctx context.Context,
	compCtx CompilerContext,
	proc *process.Process,
	emptyBat *batch.Batch,
	e *Expr,
) (*plan.Expr, error)

func HasColExpr added in v0.8.0

func HasColExpr(expr *plan.Expr, pos int32) int32

func HasFkSelfReferOnly added in v1.1.2

func HasFkSelfReferOnly(tableDef *TableDef) bool

HasFkSelfReferOnly checks the foreign key referencing itself only. If there is no children tables, it also returns true the tbleId 0 is special. it always denotes the table itself.

func HasMoCtrl added in v1.1.1

func HasMoCtrl(expr *plan.Expr) bool

HasMoCtrl checks whether the expression has mo_ctrl(..,..,..)

func HasTag added in v1.1.0

func HasTag(expr *plan.Expr, tag int32) bool

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 InternalTable added in v1.2.0

func InternalTable(tableDef *TableDef) bool

func IsEqualFunc added in v1.1.0

func IsEqualFunc(id int64) bool

func IsEquiJoin2 added in v0.8.0

func IsEquiJoin2(exprs []*plan.Expr) bool

IsEquiJoin2 Judge whether a join node is equi-join (after column remapping) Can only be used after optimizer!!!

func IsFalseExpr added in v1.2.0

func IsFalseExpr(e *Expr) bool

func IsFkBannedDatabase added in v1.1.2

func IsFkBannedDatabase(db string) bool

IsFkBannedDatabase denotes the database should not have any foreign keys

func IsFkSelfRefer added in v1.1.2

func IsFkSelfRefer(fkDbName, fkTableName, curDbName, curTableName string) bool

IsFkSelfRefer checks the foreign key referencing itself

func IsForeignKeyChecksEnabled added in v1.1.2

func IsForeignKeyChecksEnabled(ctx CompilerContext) (bool, error)

IsForeignKeyChecksEnabled returns the system variable foreign_key_checks is true or false

func IsShuffleChildren added in v1.2.2

func IsShuffleChildren(n *plan.Node, ns []*plan.Node) bool

func IsSnapshotValid added in v1.2.0

func IsSnapshotValid(snapshot *Snapshot) bool

func IsTpQuery added in v0.8.0

func IsTpQuery(qry *plan.Query) bool

func MakePlan2Decimal128ExprWithType added in v0.8.0

func MakePlan2Decimal128ExprWithType(v types.Decimal128, typ *Type) *plan.Expr

func MakePlan2Decimal64ExprWithType added in v0.8.0

func MakePlan2Decimal64ExprWithType(v types.Decimal64, typ *Type) *plan.Expr

func MakePlan2NullTextConstExprWithType added in v0.7.0

func MakePlan2NullTextConstExprWithType(v string) *plan.Expr

func MakeRuntimeFilter added in v1.2.0

func MakeRuntimeFilter(tag int32, matchPrefix bool, upperlimit int32, expr *Expr) *plan.RuntimeFilterSpec

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 NewShuffleRange added in v1.1.0

func NewShuffleRange(isString bool) *pb.ShuffleRange

func NewStatsInfo added in v1.2.0

func NewStatsInfo() *pb.StatsInfo

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 PartitionFuncConstantFold added in v1.1.0

func PartitionFuncConstantFold(bat *batch.Batch, e *plan.Expr, proc *process.Process) (*plan.Expr, error)

func PrintStats added in v0.8.0

func PrintStats(qry *plan.Query) string

func ReCalcNodeStats added in v0.7.0

func ReCalcNodeStats(nodeID int32, builder *QueryBuilder, recursive bool, leafNode bool, needResetHashMapStats 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 RemoveIf added in v1.2.1

func RemoveIf[T any](data []T, pred func(t T) bool) []T

RemoveIf removes the elements that pred is true.

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 ResetAuxIdForExpr(expr *plan.Expr)

func ResetPreparePlan added in v1.1.0

func ResetPreparePlan(ctx CompilerContext, preparePlan *Plan) ([]*plan.ObjectRef, []int32, error)

func ResolveAlterTableAlgorithm added in v1.0.0

func ResolveAlterTableAlgorithm(ctx context.Context, validAlterSpecs []tree.AlterTableOption) (algorithm plan.AlterTable_AlgorithmType)

func ShuffleRangeReEvalSigned added in v1.1.0

func ShuffleRangeReEvalSigned(ranges []float64, k2 int, nullCnt int64, tableCnt int64) []int64

func ShuffleRangeReEvalUnsigned added in v1.1.0

func ShuffleRangeReEvalUnsigned(ranges []float64, k2 int, nullCnt int64, tableCnt int64) []uint64

func SimpleCharHashToRange added in v0.8.0

func SimpleCharHashToRange(bytes []byte, upperLimit uint64) uint64

func SimpleInt64HashToRange added in v0.8.0

func SimpleInt64HashToRange(i uint64, upperLimit uint64) uint64

func StatFile added in v1.1.1

func StatFile(param *tree.ExternParam) error

func UpdateStatsInfo added in v1.2.0

func UpdateStatsInfo(info *InfoFromZoneMap, tableDef *plan.TableDef, s *pb.StatsInfo)

func VarlenaToUint64 added in v1.0.0

func VarlenaToUint64(v *types.Varlena, area []byte) uint64

convert first 8 bytes to uint64

func VarlenaToUint64Inline added in v1.0.0

func VarlenaToUint64Inline(v *types.Varlena) uint64

convert first 8 bytes to uint64. vec.area must be nil if varlena length less than 8 bytes, should have filled zero in varlena

Types

type AlterTableContext added in v1.0.0

type AlterTableContext struct {
	UpdateSqls []string
	// 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

func (*BaseOptimizer) Optimize added in v0.5.0

func (opt *BaseOptimizer) Optimize(stmt tree.Statement, isPrepareStmt bool) (*Query, error)

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)
	BindTimeWindowFunc(string, *tree.FuncExpr, int32, 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 NewBinding(tag, nodeID int32, db, table string, tableID uint64, cols []string, colIsHidden []bool, types []*plan.Type, isClusterTable bool, defaultVals []string) *Binding

func (*Binding) FindColumn added in v0.5.0

func (b *Binding) FindColumn(col string) int32

type BindingTreeNode added in v0.5.0

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

type CTERef added in v0.5.0

type CTERef 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

type ColDef = plan.ColDef

func FindColumn added in v0.8.0

func FindColumn(cols []*ColDef, name string) *ColDef

FindColumn finds column in cols by name.

func FindColumnByColId added in v1.0.0

func FindColumnByColId(cols []*ColDef, colId uint64) *ColDef

FindColumn finds column in cols by colId

func GetColDefFromTable added in v1.0.0

func GetColDefFromTable(Cols []*ColDef, hidenColName string) *ColDef

GetColDefFromTable Find the target column definition from the predefined table columns and return its deep copy

func GetResultColumnsFromPlan added in v0.5.0

func GetResultColumnsFromPlan(p *Plan) []*ColDef

GetResultColumnsFromPlan

func MakeHiddenColDefByName added in v0.8.0

func MakeHiddenColDefByName(name string) *ColDef

used for Compound primary key column name && clusterby column name

func MakeRowIdColDef added in v0.8.0

func MakeRowIdColDef() *ColDef

type ColRef added in v0.5.0

type ColRef = plan.ColRef

type ColRefRemapping added in v0.5.0

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

func (*ColRefRemapping) String added in v1.2.2

func (m *ColRefRemapping) String() string

type CompilerContext added in v0.5.0

type CompilerContext interface {
	// Default database/schema in context
	DefaultDatabase() string
	// check if database exist
	DatabaseExists(name string, snapshot Snapshot) bool
	// get table definition by database/schema
	Resolve(schemaName string, tableName string, snapshot Snapshot) (*ObjectRef, *TableDef)
	// get table definition by table id
	ResolveById(tableId uint64, snapshot Snapshot) (*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) (*function.Udf, error)
	// get the definition of primary key
	GetPrimaryKeyDef(dbName string, tableName string, snapshot Snapshot) []*ColDef
	// get needed info for stats by table
	Stats(obj *ObjectRef, snapshot Snapshot) (*pb.StatsInfo, error)
	// get origin sql string of the root
	GetRootSql() string
	// get username of current session
	GetUserName() string
	GetAccountId() (uint32, error)
	// GetContext get raw context.Context
	GetContext() context.Context
	// GetDatabaseId Get database id
	GetDatabaseId(dbName string, snapshot Snapshot) (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, snapshot Snapshot) (*SubscriptionMeta, error)
	CheckSubscriptionValid(subName, accName string, pubName string) error
	SetQueryingSubscription(meta *SubscriptionMeta)
	GetQueryingSubscription() *SubscriptionMeta
	IsPublishing(dbName string) (bool, error)
	ResolveSubscriptionTableById(tableId uint64, pubmeta *SubscriptionMeta) (*ObjectRef, *TableDef)

	ResolveSnapshotWithSnapshotName(snapshotName string) (*Snapshot, error)
	CheckTimeStampValid(ts int64) (bool, error)
	//ReplacePlan replaces the plan of the EXECUTE by the plan generated by the PREPARE.
	//return
	//	the plan generated by the PREPARE
	//	the statement generated by the PREPARE
	ReplacePlan(execPlan *plan.Execute) (*plan.Plan, tree.Statement, error)

	GetSnapshot() *Snapshot
	SetSnapshot(snapshot *Snapshot)
	GetViews() []string
	SetViews(views []string)

	GetLowerCaseTableNames() int64
}

type Const added in v0.5.0

type Const = plan.Literal

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) ApplyExpr added in v0.7.0

func (r *ConstantFoldRule) ApplyExpr(e *plan.Expr) (*plan.Expr, error)

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 (b *DefaultBinder) BindAggFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)

func (*DefaultBinder) BindColRef added in v0.6.0

func (b *DefaultBinder) BindColRef(astExpr *tree.UnresolvedName, depth int32, isRoot bool) (*plan.Expr, error)

func (*DefaultBinder) BindExpr added in v0.6.0

func (b *DefaultBinder) BindExpr(astExpr tree.Expr, depth int32, isRoot bool) (*plan.Expr, error)

func (*DefaultBinder) BindSubquery added in v0.6.0

func (b *DefaultBinder) BindSubquery(astExpr *tree.Subquery, isRoot bool) (*plan.Expr, error)

func (*DefaultBinder) BindTimeWindowFunc added in v1.1.0

func (b *DefaultBinder) BindTimeWindowFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)

func (*DefaultBinder) BindWinFunc added in v0.6.0

func (b *DefaultBinder) BindWinFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)

func (*DefaultBinder) GetContext added in v0.7.0

func (b *DefaultBinder) GetContext() context.Context

type ExecInfo added in v0.6.0

type ExecInfo struct {
	Typ        ExecType
	WithGPU    bool
	WithBigMem bool
	CnNumbers  int
}

func GetExecTypeFromPlan added in v0.6.0

func GetExecTypeFromPlan(pn *Plan) ExecInfo

GetExecType get executor will execute base AP or TP

type ExecType added in v0.6.0

type ExecType int
const (
	ExecTypeAP ExecType = iota
	ExecTypeTP
)

type ExpandAliasMode added in v1.0.0

type ExpandAliasMode int8
const (
	NoAlias ExpandAliasMode = iota
	AliasBeforeColumn
	AliasAfterColumn
)

type Expr added in v0.5.0

type Expr = plan.Expr

func DeepCopyExpr added in v0.5.0

func DeepCopyExpr(expr *Expr) *Expr

func DeepCopyExprList added in v0.6.0

func DeepCopyExprList(list []*Expr) []*Expr

func DeepProcessExprForGroupConcat added in v1.1.0

func DeepProcessExprForGroupConcat(expr *Expr, ctx *BindContext) *Expr

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)

func MakeFalseExpr added in v1.2.0

func MakeFalseExpr() *Expr

func MakeInExpr added in v1.2.0

func MakeInExpr(ctx context.Context, left *Expr, length int32, data []byte, matchPrefix bool) *Expr

func MakeIntervalExpr added in v1.2.0

func MakeIntervalExpr(num int64, str string) *Expr

func SplitCNFItems added in v1.1.0

func SplitCNFItems(onExpr *Expr) []*Expr

SplitCNFItems splits CNF items. CNF means conjunctive normal form, such as: "a and b and c".

func SplitDNFItems added in v1.1.0

func SplitDNFItems(onExpr *Expr) []*Expr

SplitDNFItems splits DNF items. DNF means disjunctive normal form, such as: "a or b or c".

type FkColName added in v0.8.0

type FkColName = plan.FkColName

type FkData added in v1.1.2

type FkData struct {
	// fk reference to itself
	IsSelfRefer bool
	// the database that the fk refers to
	ParentDbName string
	// the table that the fk refers to
	ParentTableName string
	//the columns in foreign key
	Cols *plan.FkColName
	// the columns referred
	ColsReferred *plan.FkColName
	//fk definition
	Def *plan.ForeignKeyDef
	//the column typs in foreign key
	ColTyps map[int]*plan.Type
	// update foreign keys relations
	UpdateSql string
	// forward reference
	ForwardRefer bool
}

type FkReferDef added in v1.1.2

type FkReferDef struct {
	Db       string //fk database name
	Tbl      string //fk table name
	Name     string //fk constraint name
	Col      string //fk column name
	ReferCol string //referenced column name
	OnDelete string //on delete action
	OnUpdate string //on update action
}

FkReferDef holds the definition & details of the foreign key

func (FkReferDef) String added in v1.1.2

func (fk FkReferDef) String() string

type FkReferKey added in v1.1.2

type FkReferKey struct {
	Db  string //fk database name
	Tbl string //fk table name
}

FkReferKey holds the database and table name of the foreign key

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) ApplyExpr added in v0.6.0

func (rule *GetParamRule) ApplyExpr(e *plan.Expr) (*plan.Expr, error)

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, selectList tree.SelectExprs) *GroupBinder

func (*GroupBinder) BindAggFunc added in v0.5.0

func (b *GroupBinder) BindAggFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)

func (*GroupBinder) BindColRef added in v0.5.0

func (b *GroupBinder) BindColRef(astExpr *tree.UnresolvedName, depth int32, isRoot bool) (*plan.Expr, error)

func (*GroupBinder) BindExpr added in v0.5.0

func (b *GroupBinder) BindExpr(astExpr tree.Expr, depth int32, isRoot bool) (*plan.Expr, error)

func (*GroupBinder) BindSubquery added in v0.5.0

func (b *GroupBinder) BindSubquery(astExpr *tree.Subquery, isRoot bool) (*plan.Expr, error)

func (*GroupBinder) BindTimeWindowFunc added in v1.1.0

func (b *GroupBinder) BindTimeWindowFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)

func (*GroupBinder) BindWinFunc added in v0.5.0

func (b *GroupBinder) BindWinFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)

func (*GroupBinder) GetContext added in v0.7.0

func (b *GroupBinder) GetContext() context.Context

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 (b *HavingBinder) BindAggFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)

func (*HavingBinder) BindColRef added in v0.5.0

func (b *HavingBinder) BindColRef(astExpr *tree.UnresolvedName, depth int32, isRoot bool) (*plan.Expr, error)

func (*HavingBinder) BindExpr added in v0.5.0

func (b *HavingBinder) BindExpr(astExpr tree.Expr, depth int32, isRoot bool) (*plan.Expr, error)

func (*HavingBinder) BindSubquery added in v0.5.0

func (b *HavingBinder) BindSubquery(astExpr *tree.Subquery, isRoot bool) (*plan.Expr, error)

func (*HavingBinder) BindTimeWindowFunc added in v1.1.0

func (b *HavingBinder) BindTimeWindowFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)

func (*HavingBinder) BindWinFunc added in v0.5.0

func (b *HavingBinder) BindWinFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)

func (*HavingBinder) GetContext added in v0.7.0

func (b *HavingBinder) GetContext() context.Context

type IndexDef added in v0.6.0

type IndexDef = plan.IndexDef

type InfoFromZoneMap added in v0.8.0

type InfoFromZoneMap struct {
	ColumnZMs            []objectio.ZoneMap
	DataTypes            []types.Type
	ColumnNDVs           []float64
	NullCnts             []int64
	ShuffleRanges        []*pb.ShuffleRange
	ColumnSize           []int64
	BlockNumber          int64
	AccurateObjectNumber int64
	ApproxObjectNumber   int64
	TableCnt             float64
}

func NewInfoFromZoneMap added in v0.8.0

func NewInfoFromZoneMap(lenCols int) *InfoFromZoneMap

type KeyHashPartitionPruner added in v1.1.0

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

KEY and HASH Partition Pruner

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 (b *LimitBinder) BindAggFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)

func (*LimitBinder) BindColRef added in v0.5.0

func (b *LimitBinder) BindColRef(astExpr *tree.UnresolvedName, depth int32, isRoot bool) (*plan.Expr, error)

func (*LimitBinder) BindExpr added in v0.5.0

func (b *LimitBinder) BindExpr(astExpr tree.Expr, depth int32, isRoot bool) (*plan.Expr, error)

func (*LimitBinder) BindSubquery added in v0.5.0

func (b *LimitBinder) BindSubquery(astExpr *tree.Subquery, isRoot bool) (*plan.Expr, error)

func (*LimitBinder) BindTimeWindowFunc added in v1.1.0

func (b *LimitBinder) BindTimeWindowFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)

func (*LimitBinder) BindWinFunc added in v0.5.0

func (b *LimitBinder) BindWinFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)

func (*LimitBinder) GetContext added in v0.7.0

func (b *LimitBinder) GetContext() context.Context

type MaxValue added in v0.6.0

type MaxValue = plan.MaxValue

type MoCacheColType added in v1.1.0

type MoCacheColType int32

type MoConfigColType added in v1.1.0

type MoConfigColType int32

type MoLocksColType added in v1.1.0

type MoLocksColType int32

type MoTransactionsColType added in v1.1.0

type MoTransactionsColType int32

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) BindExpr added in v0.7.0

func (m *MockBinder) BindExpr(arg0 tree.Expr, arg1 int32, arg2 bool) (*plan.Expr, error)

BindExpr mocks base method.

func (*MockBinder) BindSubquery added in v0.7.0

func (m *MockBinder) BindSubquery(arg0 *tree.Subquery, arg1 bool) (*plan.Expr, error)

BindSubquery mocks base method.

func (*MockBinder) BindTimeWindowFunc added in v1.1.1

func (m *MockBinder) BindTimeWindowFunc(arg0 string, arg1 *tree.FuncExpr, arg2 int32, arg3 bool) (*plan.Expr, error)

BindTimeWindowFunc 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) BindTimeWindowFunc added in v1.1.1

func (mr *MockBinderMockRecorder) BindTimeWindowFunc(arg0, arg1, arg2, arg3 interface{}) *gomock.Call

BindTimeWindowFunc indicates an expected call of BindTimeWindowFunc.

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) CheckTimeStampValid added in v1.2.0

func (m *MockCompilerContext) CheckTimeStampValid(ts int64) (bool, error)

func (*MockCompilerContext) DatabaseExists added in v0.5.0

func (m *MockCompilerContext) DatabaseExists(name string, snapshot Snapshot) 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, error)

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, snapshot Snapshot) (uint64, error)

func (*MockCompilerContext) GetLowerCaseTableNames added in v1.2.1

func (m *MockCompilerContext) GetLowerCaseTableNames() int64

func (*MockCompilerContext) GetPrimaryKeyDef added in v0.5.0

func (m *MockCompilerContext) GetPrimaryKeyDef(dbName string, tableName string, snapshot Snapshot) []*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) GetSnapshot added in v1.2.0

func (m *MockCompilerContext) GetSnapshot() *Snapshot

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, snapshot Snapshot) (*SubscriptionMeta, error)

func (*MockCompilerContext) GetUserName added in v0.6.0

func (m *MockCompilerContext) GetUserName() string

func (*MockCompilerContext) GetViews added in v1.2.0

func (m *MockCompilerContext) GetViews() []string

func (*MockCompilerContext) IsPublishing added in v0.8.0

func (m *MockCompilerContext) IsPublishing(dbName string) (bool, error)

func (*MockCompilerContext) ReplacePlan added in v1.2.0

func (m *MockCompilerContext) ReplacePlan(execPlan *plan.Execute) (*plan.Plan, tree.Statement, error)

func (*MockCompilerContext) Resolve added in v0.5.0

func (m *MockCompilerContext) Resolve(dbName string, tableName string, snapshot Snapshot) (*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, snapshot Snapshot) (*ObjectRef, *TableDef)

func (*MockCompilerContext) ResolveSnapshotWithSnapshotName added in v1.2.0

func (m *MockCompilerContext) ResolveSnapshotWithSnapshotName(snapshotName string) (*Snapshot, error)

func (*MockCompilerContext) ResolveSubscriptionTableById added in v1.2.0

func (m *MockCompilerContext) ResolveSubscriptionTableById(tableId uint64, pubmeta *SubscriptionMeta) (*ObjectRef, *TableDef)

func (*MockCompilerContext) ResolveUdf added in v0.8.0

func (m *MockCompilerContext) ResolveUdf(name string, ast []*plan.Expr) (*function.Udf, error)

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) SetSnapshot added in v1.2.0

func (m *MockCompilerContext) SetSnapshot(snapshot *Snapshot)

func (*MockCompilerContext) SetViews added in v1.2.0

func (m *MockCompilerContext) SetViews(views []string)

func (*MockCompilerContext) Stats added in v0.7.0

func (m *MockCompilerContext) Stats(obj *ObjectRef, snapshot Snapshot) (*pb.StatsInfo, error)

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) CheckTimeStampValid added in v1.2.0

func (m *MockCompilerContext2) CheckTimeStampValid(ts int64) (bool, error)

CheckTimeStampValid mocks base method.

func (*MockCompilerContext2) DatabaseExists added in v0.7.0

func (m *MockCompilerContext2) DatabaseExists(name string, snapshot Snapshot) 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

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, error)

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, snapshot Snapshot) (uint64, error)

GetDatabaseId mocks base method.

func (*MockCompilerContext2) GetLowerCaseTableNames added in v1.2.1

func (m *MockCompilerContext2) GetLowerCaseTableNames() int64

GetLowerCaseTableNames mocks base method.

func (*MockCompilerContext2) GetPrimaryKeyDef added in v0.7.0

func (m *MockCompilerContext2) GetPrimaryKeyDef(dbName, tableName string, snapshot Snapshot) []*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) GetSnapshot added in v1.2.0

func (m *MockCompilerContext2) GetSnapshot() *Snapshot

GetSnapshot 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, snapshot Snapshot) (*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) GetViews added in v1.2.0

func (m *MockCompilerContext2) GetViews() []string

GetViews 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) ReplacePlan added in v1.2.0

func (m *MockCompilerContext2) ReplacePlan(execPlan *plan.Execute) (*plan.Plan, tree.Statement, error)

ReplacePlan mocks base method.

func (*MockCompilerContext2) Resolve added in v0.7.0

func (m *MockCompilerContext2) Resolve(schemaName, tableName string, snapshot Snapshot) (*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, snapshot Snapshot) (*ObjectRef, *TableDef)

ResolveById mocks base method.

func (*MockCompilerContext2) ResolveSnapshotWithSnapshotName added in v1.2.0

func (m *MockCompilerContext2) ResolveSnapshotWithSnapshotName(snapshotName string) (*Snapshot, error)

ResolveSnapshotWithSnapshotName mocks base method.

func (*MockCompilerContext2) ResolveSubscriptionTableById added in v1.2.0

func (m *MockCompilerContext2) ResolveSubscriptionTableById(tableId uint64, pubmeta *SubscriptionMeta) (*ObjectRef, *TableDef)

ResolveSubscriptionTableById mocks base method.

func (*MockCompilerContext2) ResolveUdf added in v0.8.0

func (m *MockCompilerContext2) ResolveUdf(name string, args []*Expr) (*function.Udf, 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) SetSnapshot added in v1.2.0

func (m *MockCompilerContext2) SetSnapshot(snapshot *Snapshot)

SetSnapshot mocks base method.

func (*MockCompilerContext2) SetViews added in v1.2.0

func (m *MockCompilerContext2) SetViews(views []string)

SetViews mocks base method.

func (*MockCompilerContext2) Stats added in v0.7.0

func (m *MockCompilerContext2) Stats(obj *ObjectRef, snapshot Snapshot) (*statsinfo.StatsInfo, error)

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) CheckTimeStampValid added in v1.2.0

func (mr *MockCompilerContext2MockRecorder) CheckTimeStampValid(ts interface{}) *gomock.Call

CheckTimeStampValid indicates an expected call of CheckTimeStampValid.

func (*MockCompilerContext2MockRecorder) DatabaseExists added in v0.7.0

func (mr *MockCompilerContext2MockRecorder) DatabaseExists(name, snapshot 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, snapshot interface{}) *gomock.Call

GetDatabaseId indicates an expected call of GetDatabaseId.

func (*MockCompilerContext2MockRecorder) GetLowerCaseTableNames added in v1.2.1

func (mr *MockCompilerContext2MockRecorder) GetLowerCaseTableNames() *gomock.Call

GetLowerCaseTableNames indicates an expected call of GetLowerCaseTableNames.

func (*MockCompilerContext2MockRecorder) GetPrimaryKeyDef added in v0.7.0

func (mr *MockCompilerContext2MockRecorder) GetPrimaryKeyDef(dbName, tableName, snapshot 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) GetSnapshot added in v1.2.0

func (mr *MockCompilerContext2MockRecorder) GetSnapshot() *gomock.Call

GetSnapshot indicates an expected call of GetSnapshot.

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, snapshot 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) GetViews added in v1.2.0

GetViews indicates an expected call of GetViews.

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) ReplacePlan added in v1.2.0

func (mr *MockCompilerContext2MockRecorder) ReplacePlan(execPlan interface{}) *gomock.Call

ReplacePlan indicates an expected call of ReplacePlan.

func (*MockCompilerContext2MockRecorder) Resolve added in v0.7.0

func (mr *MockCompilerContext2MockRecorder) Resolve(schemaName, tableName, snapshot 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, snapshot interface{}) *gomock.Call

ResolveById indicates an expected call of ResolveById.

func (*MockCompilerContext2MockRecorder) ResolveSnapshotWithSnapshotName added in v1.2.0

func (mr *MockCompilerContext2MockRecorder) ResolveSnapshotWithSnapshotName(snapshotName interface{}) *gomock.Call

ResolveSnapshotWithSnapshotName indicates an expected call of ResolveSnapshotWithSnapshotName.

func (*MockCompilerContext2MockRecorder) ResolveSubscriptionTableById added in v1.2.0

func (mr *MockCompilerContext2MockRecorder) ResolveSubscriptionTableById(tableId, pubmeta interface{}) *gomock.Call

ResolveSubscriptionTableById indicates an expected call of ResolveSubscriptionTableById.

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) SetSnapshot added in v1.2.0

func (mr *MockCompilerContext2MockRecorder) SetSnapshot(snapshot interface{}) *gomock.Call

SetSnapshot indicates an expected call of SetSnapshot.

func (*MockCompilerContext2MockRecorder) SetViews added in v1.2.0

func (mr *MockCompilerContext2MockRecorder) SetViews(views interface{}) *gomock.Call

SetViews indicates an expected call of SetViews.

func (*MockCompilerContext2MockRecorder) Stats added in v0.7.0

func (mr *MockCompilerContext2MockRecorder) Stats(obj, snapshot 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

func (*MockOptimizer) Optimize added in v0.5.0

func (moc *MockOptimizer) Optimize(stmt tree.Statement) (*Query, error)

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

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockOptimizer2) Optimize added in v0.7.0

func (m *MockOptimizer2) Optimize(stmt tree.Statement) (*Query, error)

Optimize mocks base method.

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) Apply added in v0.7.0

func (m *MockRule) Apply(arg0 *Node, arg1 *Query, arg2 *process.Process)

Apply mocks base method.

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.

func (*MockRule) Match added in v0.7.0

func (m *MockRule) Match(arg0 *Node) bool

Match mocks base method.

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 MultiTableIndex added in v1.1.0

type MultiTableIndex struct {
	IndexAlgo string
	IndexDefs map[string]*plan.IndexDef
}

type NameTuple added in v0.5.0

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

type Node added in v0.5.0

type Node = plan.Node

type ObjectRef added in v0.5.0

type ObjectRef = plan.ObjectRef

type Optimizer added in v0.5.0

type Optimizer interface {
	Optimize(stmt tree.Statement) (*Query, error)
	CurrentContext() CompilerContext
}

type OptimizerHints added in v1.2.0

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

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) BindExpr added in v0.5.0

func (b *OrderBinder) BindExpr(astExpr tree.Expr) (*plan.Expr, error)

func (OrderBinder) GetContext added in v0.7.0

func (b OrderBinder) GetContext() context.Context

type OrderBySpec added in v0.6.0

type OrderBySpec = plan.OrderBySpec

type OriginTableMessageForFuzzy added in v1.1.0

type OriginTableMessageForFuzzy struct {
	ParentTableName  string
	ParentUniqueCols []*ColDef
}

fuzzy filter need to get partial unique key attrs name and its origin table name for Decimal type, we need colDef to get the scale

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 (p *PartitionBinder) BindAggFunc(s string, expr *tree.FuncExpr, i int32, b bool) (*plan.Expr, error)

func (*PartitionBinder) BindColRef added in v0.6.0

func (p *PartitionBinder) BindColRef(name *tree.UnresolvedName, i int32, b bool) (*plan.Expr, error)

func (*PartitionBinder) BindExpr added in v0.6.0

func (p *PartitionBinder) BindExpr(expr tree.Expr, i int32, b bool) (*plan.Expr, error)

func (*PartitionBinder) BindSubquery added in v0.6.0

func (p *PartitionBinder) BindSubquery(subquery *tree.Subquery, b bool) (*plan.Expr, error)

func (*PartitionBinder) BindTimeWindowFunc added in v1.1.0

func (p *PartitionBinder) BindTimeWindowFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)

func (*PartitionBinder) BindWinFunc added in v0.6.0

func (p *PartitionBinder) BindWinFunc(s string, expr *tree.FuncExpr, i int32, b bool) (*plan.Expr, error)

func (*PartitionBinder) GetContext added in v0.7.0

func (b *PartitionBinder) GetContext() context.Context

type PartitionByDef added in v0.7.0

type PartitionByDef = plan.PartitionByDef

func DeepCopyPartitionByDef added in v1.2.0

func DeepCopyPartitionByDef(partiiondef *PartitionByDef) *PartitionByDef

type PartitionPruneResult added in v1.1.0

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

type Plan

type Plan = plan.Plan

func BuildPlan added in v0.5.0

func BuildPlan(ctx CompilerContext, stmt tree.Statement, isPrepareStmt bool) (*Plan, error)

func DeepCopyPlan added in v0.6.0

func DeepCopyPlan(pl *Plan) *Plan

func FillValuesOfParamsInPlan added in v1.2.0

func FillValuesOfParamsInPlan(ctx context.Context, preparePlan *Plan, paramVals []any) (*Plan, error)

FillValuesOfParamsInPlan replaces the params by their values

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 (b *ProjectionBinder) BindAggFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)

func (*ProjectionBinder) BindColRef added in v0.5.0

func (b *ProjectionBinder) BindColRef(astExpr *tree.UnresolvedName, depth int32, isRoot bool) (*plan.Expr, error)

func (*ProjectionBinder) BindExpr added in v0.5.0

func (b *ProjectionBinder) BindExpr(astExpr tree.Expr, depth int32, isRoot bool) (*plan.Expr, error)

func (*ProjectionBinder) BindSubquery added in v0.5.0

func (b *ProjectionBinder) BindSubquery(astExpr *tree.Subquery, isRoot bool) (*plan.Expr, error)

func (*ProjectionBinder) BindTimeWindowFunc added in v1.1.0

func (b *ProjectionBinder) BindTimeWindowFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)

func (*ProjectionBinder) BindWinFunc added in v0.5.0

func (b *ProjectionBinder) BindWinFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)

func (*ProjectionBinder) GetContext added in v0.7.0

func (b *ProjectionBinder) GetContext() context.Context

type PropertiesDef added in v0.6.0

type PropertiesDef = plan.PropertiesDef

type Property added in v0.6.0

type Property = plan.Property

type Query

type Query = plan.Query

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, skipStats 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) ApplyExpr added in v0.7.0

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 RemapInfo added in v1.2.2

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

func (*RemapInfo) String added in v1.2.2

func (info *RemapInfo) String() string

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) ApplyExpr added in v0.6.0

func (rule *ResetParamOrderRule) ApplyExpr(e *plan.Expr) (*plan.Expr, error)

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) ApplyExpr added in v0.6.0

func (rule *ResetParamRefRule) ApplyExpr(e *plan.Expr) (*plan.Expr, error)

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) ApplyExpr added in v0.6.0

func (rule *ResetVarRefRule) ApplyExpr(e *plan.Expr) (*plan.Expr, error)

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 Rule added in v0.5.0

type Rule interface {
	Match(*Node) bool                      // rule match?
	Apply(*Node, *Query, *process.Process) // apply the rule
}

type SampleFuncCtx added in v1.1.0

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

func (*SampleFuncCtx) BindSampleColumn added in v1.1.0

func (s *SampleFuncCtx) BindSampleColumn(ctx *BindContext, binder *ProjectionBinder, sampleList tree.SelectExprs) ([]*plan.Expr, error)

func (*SampleFuncCtx) GenerateSampleFunc added in v1.1.0

func (s *SampleFuncCtx) GenerateSampleFunc(se *tree.SampleExpr) error

func (*SampleFuncCtx) SetStartOffset added in v1.1.0

func (s *SampleFuncCtx) SetStartOffset(start, offset int)

type Schema added in v0.5.0

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

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 (s *SetBinder) BindAggFunc(_ string, expr *tree.FuncExpr, i int32, b bool) (*plan.Expr, error)

func (*SetBinder) BindColRef added in v0.8.0

func (s *SetBinder) BindColRef(name *tree.UnresolvedName, i int32, b bool) (*plan.Expr, error)

func (*SetBinder) BindExpr added in v0.8.0

func (s *SetBinder) BindExpr(expr tree.Expr, i int32, b bool) (*plan.Expr, error)

BindExpr prohibits functions in set expr

func (*SetBinder) BindSubquery added in v0.8.0

func (s *SetBinder) BindSubquery(subquery *tree.Subquery, b bool) (*plan.Expr, error)

func (*SetBinder) BindTimeWindowFunc added in v1.1.0

func (s *SetBinder) BindTimeWindowFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)

func (*SetBinder) BindWinFunc added in v0.8.0

func (s *SetBinder) BindWinFunc(_ string, expr *tree.FuncExpr, i int32, b bool) (*plan.Expr, error)

func (*SetBinder) GetContext added in v0.8.0

func (b *SetBinder) GetContext() context.Context

type Snapshot added in v1.2.0

type Snapshot = plan.Snapshot

type SnapshotTenant added in v1.2.0

type SnapshotTenant = plan.SnapshotTenant

type Stats added in v0.7.0

type Stats = plan.Stats

type StatsCache added in v0.8.0

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

func NewStatsCache added in v0.8.0

func NewStatsCache() *StatsCache

func (*StatsCache) GetStatsInfo added in v1.2.0

func (sc *StatsCache) GetStatsInfo(tableID uint64, create bool) *pb.StatsInfo

GetStatsInfo returns the stats info and if the info in the cache needs to be updated.

func (*StatsCache) SetStatsInfo added in v1.2.0

func (sc *StatsCache) SetStatsInfo(tableID uint64, s *pb.StatsInfo)

SetStatsInfo updates the stats info in the cache.

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 (b *TableBinder) BindAggFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)

func (*TableBinder) BindColRef added in v0.5.0

func (b *TableBinder) BindColRef(astExpr *tree.UnresolvedName, depth int32, isRoot bool) (*plan.Expr, error)

func (*TableBinder) BindExpr added in v0.5.0

func (b *TableBinder) BindExpr(astExpr tree.Expr, depth int32, isRoot bool) (*plan.Expr, error)

func (*TableBinder) BindSubquery added in v0.5.0

func (b *TableBinder) BindSubquery(astExpr *tree.Subquery, isRoot bool) (*plan.Expr, error)

func (*TableBinder) BindTimeWindowFunc added in v1.1.0

func (b *TableBinder) BindTimeWindowFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)

func (*TableBinder) BindWinFunc added in v0.5.0

func (b *TableBinder) BindWinFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)

func (*TableBinder) GetContext added in v0.7.0

func (b *TableBinder) GetContext() context.Context

type TableDef added in v0.5.0

type TableDef = plan.TableDef

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 Type added in v0.5.0

type Type = plan.Type

type UnorderedSet added in v1.2.1

type UnorderedSet[T ~string | ~int] map[T]int

func (UnorderedSet[T]) Find added in v1.2.1

func (set UnorderedSet[T]) Find(val T) bool

func (UnorderedSet[T]) Insert added in v1.2.1

func (set UnorderedSet[T]) Insert(val T)

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 (b *UpdateBinder) BindAggFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)

func (*UpdateBinder) BindColRef added in v0.8.0

func (b *UpdateBinder) BindColRef(astExpr *tree.UnresolvedName, depth int32, isRoot bool) (*plan.Expr, error)

func (*UpdateBinder) BindExpr added in v0.8.0

func (b *UpdateBinder) BindExpr(astExpr tree.Expr, depth int32, isRoot bool) (*plan.Expr, error)

func (*UpdateBinder) BindSubquery added in v0.8.0

func (b *UpdateBinder) BindSubquery(astExpr *tree.Subquery, isRoot bool) (*plan.Expr, error)

func (*UpdateBinder) BindTimeWindowFunc added in v1.1.0

func (b *UpdateBinder) BindTimeWindowFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)

func (*UpdateBinder) BindWinFunc added in v0.8.0

func (b *UpdateBinder) BindWinFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)

func (*UpdateBinder) GetContext added in v0.8.0

func (b *UpdateBinder) GetContext() context.Context

type ViewData added in v0.6.0

type ViewData struct {
	Stmt            string
	DefaultDatabase string
}

type ViewDef added in v0.6.0

type ViewDef = plan.ViewDef

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

func (*VisitPlan) Visit added in v0.6.0

func (vq *VisitPlan) Visit(ctx context.Context) error

type VisitPlanRule added in v0.6.0

type VisitPlanRule interface {
	MatchNode(*Node) bool
	IsApplyExpr() bool
	ApplyNode(*Node) error
	ApplyExpr(*Expr) (*Expr, error)
}

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 (b *WhereBinder) BindAggFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)

func (*WhereBinder) BindColRef added in v0.5.0

func (b *WhereBinder) BindColRef(astExpr *tree.UnresolvedName, depth int32, isRoot bool) (*plan.Expr, error)

func (*WhereBinder) BindExpr added in v0.5.0

func (b *WhereBinder) BindExpr(astExpr tree.Expr, depth int32, isRoot bool) (*plan.Expr, error)

func (*WhereBinder) BindSubquery added in v0.5.0

func (b *WhereBinder) BindSubquery(astExpr *tree.Subquery, isRoot bool) (*plan.Expr, error)

func (*WhereBinder) BindTimeWindowFunc added in v1.1.0

func (b *WhereBinder) BindTimeWindowFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)

func (*WhereBinder) BindWinFunc added in v0.5.0

func (b *WhereBinder) BindWinFunc(funcName string, astExpr *tree.FuncExpr, depth int32, isRoot bool) (*plan.Expr, error)

func (*WhereBinder) GetContext added in v0.7.0

func (b *WhereBinder) GetContext() context.Context

Directories

Path Synopsis
agg
ctl

Jump to

Keyboard shortcuts

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