package
0.1.6
Repository: https://github.com/squareup/pranadb.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# Functions

BuildCastFunction builds a CAST ScalarFunction from the Expression.
BuildCastFunction4Union build a implicitly CAST ScalarFunction from the Union Expression.
BuildNotNullExpr wraps up `not(isnull())` for given expression.
CanExprsPushDown return true if all the expr in exprs can be pushed down.
CanImplicitEvalInt represents the builtin functions that have an implicit path to evaluate as integer, regardless of the type that type inference decides it to be.
CanImplicitEvalReal represents the builtin functions that have an implicit path to evaluate as real, regardless of the type that type inference decides it to be.
CheckArgsNotMultiColumnRow checks the args are not multi-column row.
CheckIllegalMixCollation checks illegal mix collation with expressions.
ColInfo2Col finds the corresponding column of the ColumnInfo in a column slice.
Column2Exprs will transfer column slice to expression slice.
ColumnSubstitute substitutes the columns in filter to expressions in select fields.
ColumnSubstituteImpl tries to substitute column expr using newExprs, the newFunctionInternal is only called if its child is substituted.
CompareDecimal compares two decimals.
CompareDuration compares two durations.
CompareInt compares two integers.
CompareJSON compares two JSONs.
CompareReal compares two float-point values.
CompareStringWithCollationInfo compares two strings with the specified collation information.
CompareTime compares two datetime or timestamps.
ComposeCNFCondition composes CNF items into a balance deep CNF tree, which benefits a lot for pb decoder/encoder.
ComposeDNFCondition composes DNF items into a balance deep DNF tree.
ConstructPositionExpr constructs PositionExpr with the given ParamMarkerExpr.
ContainMutableConst checks if the expressions contain a lazy constant.
Contains tests if `exprs` contains `e`.
DeriveCollationFromExprs derives collation information from these expressions.
DeriveRelaxedFiltersFromDNF given a DNF expression, derive a relaxed DNF expression which only contains columns in specified schema; the derived expression is a superset of original expression, i.e, any tuple satisfying the original expression must satisfy the derived expression.
DisableParseJSONFlag4Expr disables ParseToJSONFlag for `expr` except Column.
EvalBool evaluates expression list to a boolean value.
EvaluateExprWithNull sets columns in schema as null and calculate the final result of the scalar function.
ExprFromSchema checks if all columns of this expression are from the same schema.
ExtractColumns extracts all columns from an expression.
ExtractColumnSet extracts the different values of `UniqueId` for columns in expressions.
ExtractColumnsFromExpressions is a more efficient version of ExtractColumns for batch operation.
ExtractCorColumns extracts correlated column from given expression.
ExtractFiltersFromDNFs checks whether the cond is DNF.
Filter the input expressions, append the results to result.
FindFieldName finds the column name from NameSlice.
FindPrefixOfIndex will find columns in index by checking the unique id.
FlattenCNFConditions extracts CNF expression's leaf item.
FlattenDNFConditions extracts DNF expression's leaf item.
FoldConstant does constant folding optimization on an expression excluding deferred ones.
GetAccurateCmpType uses a more complex logic to decide the EvalType of the two args when compare with each other than getBaseCmpType does.
GetFuncArg gets the argument of the function at idx.
GetIntFromConstant gets an interger value from the Constant expression.
GetRowLen gets the length if the func is row, returns 1 if not row.
GetStringFromConstant gets a string value from the Constant expression.
GetUsedList shows whether each column in schema is contained in usedCols.
HandleOverflowOnSelection handles Overflow errors when evaluating selection filters.
HasAssignSetVarFunc checks whether an expression contains SetVar function and assign a value.
HasGetSetVarFunc checks whether an expression contains SetVar/GetVar function.
IndexInfo2Cols gets the corresponding []*Column of the indexInfo's []*IndexColumn, together with a []int containing their lengths.
IndexInfo2PrefixCols gets the corresponding []*Column of the indexInfo's []*IndexColumn, together with a []int containing their lengths.
InferType4ControlFuncs infer result type for builtin IF, IFNULL, NULLIF, LEAD and LAG.
IsBinaryLiteral checks whether an expression is a binary literal.
IsEQCondFromIn checks if an expression is equal condition converted from `[not] in (subq)`.
IsMutableEffectsExpr checks if expr contains function which is mutable or has side effects.
IsRuntimeConstExpr checks if a expr can be treated as a constant in **executor**.
MergeSchema will merge two schema into one schema.
NewFunction creates a new scalar function or constant via a constant folding.
NewFunctionBase creates a new scalar function with no constant folding.
NewFunctionInternal is similar to NewFunction, but do not returns error, should only be used internally.
NewFunctionTryFold creates a new scalar function with trying constant folding.
NewIntSet returns a new int disjoint set.
NewNull stands for null constant.
NewOne stands for a number 1.
NewSchema returns a schema made by its parameter.
NewWithSeed create a rng with random seed.
NewWithTime create a rng with time stamp.
NewZero stands for a number 0.
ParamMarkerExpression generate a getparam function expression.
PopRowFirstArg pops the first element and returns the rest of row.
PosFromPositionExpr generates a position value from PositionExpr.
PropagateConstant propagate constant values of deterministic predicates in a condition.
PropConstOverOuterJoin propagate constant equal and column equal conditions over outer join.
PushDownExprs split the input exprs into pushed and remained, pushed include all the exprs that can be pushed down.
PushDownNot pushes the `not` function down to the expression's arguments.
Quote produce a result that can be used as a properly escaped data value in an SQL statement.
RefineComparedConstant changes a non-integer constant argument to its ceiling or floor result by the given op.
RemoveDupExprs removes identical exprs.
ResolveType4Between resolves eval type for between expression.
ScalarFuncs2Exprs converts []*ScalarFunction to []Expression.
SetBinFlagOrBinStr sets resTp to binary string if argTp is a binary string, if not, sets the binary flag of resTp to true if argTp has binary flag.
SortColumns sort columns based on UniqueID.
SplitCNFItems splits CNF items.
SplitDNFItems splits DNF items.
TryPushCastIntoControlFunctionForHybridType try to push cast into control function for Hybrid Type.
WrapWithCastAsDecimal wraps `expr` with `cast` if the return type of expr is not type decimal, otherwise, returns `expr` directly.
WrapWithCastAsDuration wraps `expr` with `cast` if the return type of expr is not type duration, otherwise, returns `expr` directly.
WrapWithCastAsInt wraps `expr` with `cast` if the return type of expr is not type int, otherwise, returns `expr` directly.
WrapWithCastAsJSON wraps `expr` with `cast` if the return type of expr is not type json, otherwise, returns `expr` directly.
WrapWithCastAsReal wraps `expr` with `cast` if the return type of expr is not type real, otherwise, returns `expr` directly.
WrapWithCastAsString wraps `expr` with `cast` if the return type of expr is not type string, otherwise, returns `expr` directly.
WrapWithCastAsTime wraps `expr` with `cast` if the return type of expr is not same as type of the specified `tp` , otherwise, returns `expr` directly.

# Constants

CoercibilityCoercible is derived from a literal.
CoercibilityExplicit is derived from an explicit COLLATE clause.
CoercibilityIgnorable is derived from NULL or an expression that is derived from NULL.
CoercibilityImplicit is derived from a column or a stored routine parameter or local variable or cast() function.
CoercibilityNone is derived from the concatenation of two strings with different collations.
CoercibilityNumeric is derived from a numeric or temporal value.
CoercibilitySysconst is derived from a “system constant” (the string returned by functions such as USER() or VERSION()).

# Variables

CollationStrictness indicates the strictness of comparison of the collation.
CollationStrictnessGroup group collation by strictness.
DeferredFunctions stores functions which are foldable but should be deferred as well when plan cache is enabled.
DisableFoldFunctions stores functions which prevent child scope functions from being constant folded.
MaxPropagateColsCnt means the max number of columns that can participate propagation.
TryFoldFunctions stores functions which try to fold constant in child scope functions if without errors/warnings, otherwise, the child functions do not fold constant.

# Structs

Assignment represents a set assignment in Update, such as Update t set c1 = hex(12), c2 = c3 where c2 = 1.
Column represents a column.
Constant stands for a constant value.
CorrelatedColumn stands for a column in a correlated sub query.
IntSet is the int disjoint set.
MysqlRng is random number generator and this implementation is ported from MySQL.
ParamMarker indicates param provided by COM_STMT_EXECUTE.
ScalarFunction is the function that returns a value.
Schema stands for the row schema and unique key information get from input.
VarAssignment represents a variable assignment in Set, such as set global a = 1.

# Interfaces

CollationInfo contains all interfaces about dealing with collation.
Expression represents all scalar expression in SQL.
PropagateConstantSolver is a constant propagate solver.
ReverseExpr contains all resersed evaluation methods.
VecExpr contains all vectorized evaluation methods.

# Type aliases

CNFExprs stands for a CNF expression.
Coercibility values are used to check whether the collation of one item can be coerced to the collation of other.
CompareFunc defines the compare function prototype.
KeyInfo stores the columns of one unique key or primary key.