package
20.2.19+incompatible
Repository: https://github.com/cockroachdb/cockroach.git
Documentation: pkg.go.dev
# Functions
AggregateOverloadExists returns whether or not the given operator has a unary overload which takes the given type as input.
BinaryAllowsNullArgs returns true if the given binary operator allows null arguments, and cannot therefore be folded away to null.
BinaryOverloadExists returns true if the given binary operator exists with the given arguments.
BuildConstraints returns a constraint.Set that represents the given scalar expression.
BuildSharedProps fills in the shared properties derived from the given expression's subtree.
CanExtractConstDatum returns true if a constant datum can be created from the given expression (tuples and arrays of constant values are considered constant values).
CanExtractConstTuple returns true if the expression is a TupleOp with constant values (a nested tuple of constant values is considered constant).
DeriveJoinMultiplicityFromInputs returns a JoinMultiplicity that describes how an inner join with the given inputs and filters will affect the rows of its inputs.
ExprIsNeverNull makes a best-effort attempt to prove that the provided scalar is always non-NULL, given the set of outer columns that are known to be not null.
ExtractAggFirstVar is given an aggregate expression and returns the Variable expression for the first argument, skipping past modifiers like AggDistinct.
ExtractAggFunc digs down into the given aggregate expression and returns the aggregate function, skipping past any AggFilter or AggDistinct operators.
ExtractAggInputColumns returns the set of columns the aggregate depends on.
ExtractConstColumns returns columns in the filters expression that have been constrained to fixed values.
ExtractConstDatum returns the Datum that represents the value of an expression with a constant value.
ExtractJoinEquality returns true if the given condition is a simple equality condition with two variables (e.g.
ExtractJoinEqualityColumns returns pairs of columns (one from the left side, one from the right side) which are constrained to be equal in a join (and have equivalent types).
ExtractJoinEqualityFilters returns the filters containing pairs of columns (one from the left side, one from the right side) which are constrained to be equal in a join (and have equivalent types).
ExtractRemainingJoinFilters calculates the remaining ON condition after removing equalities that are handled separately.
ExtractValueForConstColumn returns the constant value of a column returned by ExtractConstColumns.
FindAggregateOverload finds an aggregate function overload that matches the given aggregate function expression.
FindBinaryOverload finds the correct type signature overload for the specified binary operator, given the types of its inputs.
FindComparisonOverload finds the correct type signature overload for the specified comparison operator, given the types of its inputs.
FindFunction returns the function properties and overload of the function with the given name and argument types matching the children of the given input.
FindUnaryOverload finds the correct type signature overload for the specified unary operator, given the type of its input.
FindWindowOverload finds a window function overload that matches the given window function expression.
FormatExpr returns a string representation of the given expression, formatted according to the specified flags.
FormatPrivate outputs a description of the private to f.Buffer.
GetJoinMultiplicity returns a JoinMultiplicity struct that describes how a join operator will affect the rows of its left and right inputs (e.g.
InferBinaryType infers the return type of a binary expression, given the type of its inputs.
InferType derives the type of the given scalar expression and stores it in the expression's Type field.
InferUnaryType infers the return type of a unary operator, given the type of its input.
InferWhensType returns the type of a CASE expression, which is of the form: CASE [ <cond> ] WHEN <condval1> THEN <expr1> [ WHEN <condval2> THEN <expr2> ] ..
LastGroupMember returns the last member in the same memo group of the given relational expression.
MakeExprFmtCtx creates an expression formatting context from a new buffer.
MakeExprFmtCtxBuffer creates an expression formatting context from an existing buffer.
MakeScanLimit initializes a ScanLimit with a number of rows and a direction.
MakeTableFuncDep returns the set of functional dependencies derived from the given base table.
NewColumnNameGenerator creates a new instance of ColumnNameGenerator, initialized with the given relational expression.
NewExprNameGenerator creates a new instance of ExprNameGenerator, initialized with the given prefix.
NormalizeComparison maps a given comparison operator into an equivalent operator that exists in the tree.CmpOps map, returning this new operator, along with "flipped" and "not" flags.
OutputColumnIsAlwaysNull returns true if the expression produces only NULL values for the given column.
PartialIndexPredicate returns the FiltersExpr representing the partial index predicate at the given index ordinal.
RequestColStat causes a column statistic to be calculated on the relational expression.
WithUses returns the WithUsesMap for the given expression.
# Constants
AllowOnlyHashJoinStoreRight has all "disallow" flags set except DisallowHashJoinStoreRight.
AllowOnlyLookupJoinIntoRight has all "disallow" flags set except DisallowLookupJoinIntoRight.
AllowOnlyMergeJoin has all "disallow" flags set except DisallowMergeJoin.
DisallowHashJoinStoreLeft corresponds to a hash join where the left side is stored into the hashtable.
DisallowHashJoinStoreRight corresponds to a hash join where the right side is stored into the hashtable.
DisallowLookupJoinIntoLeft corresponds to a lookup join where the lookup table is on the left side.
DisallowLookupJoinIntoRight corresponds to a lookup join where the lookup table is on the right side.
DisallowMergeJoin corresponds to a merge join.
ExprFmtHideAll shows only the basic structure of the expression.
ExprFmtHideColumns removes column information.
ExprFmtHideConstraints does not show inferred constraints in the output.
ExprFmtHideCost does not show expression cost in the output.
ExprFmtHideFuncDeps does not show functional dependencies in the output.
ExprFmtHideMiscProps does not show outer columns, row cardinality, provided orderings, side effects, or error text in the output.
ExprFmtHideNotNull hides the !null specifier from columns.
ExprFmtHidePhysProps hides all required physical properties, except for Presentation (see ExprFmtHideColumns).
ExprFmtHideQualifications removes the qualification from column labels (except when a shortened name would be ambiguous).
ExprFmtHideRuleProps does not show rule-specific properties in the output.
ExprFmtHideScalars removes subtrees that contain only scalars and replaces them with the SQL expression (if possible).
ExprFmtHideStats does not show statistics in the output.
ExprFmtHideTypes hides type information from columns and scalar expressions.
ExprFmtShowAll shows all properties of the expression.
PreferLookupJoinIntoLeft reduces the cost of a lookup join where the lookup table is on the left side.
PreferLookupJoinIntoRight reduces the cost of a lookup join where the lookup table is on the right side.
# Variables
CountRowsSingleton maintains a global instance of CountRowsExpr, to avoid allocations.
CumeDistSingleton is the global instance of CumeDistExpr.
DenseRankSingleton is the global instance of DenseRankExpr.
EmptyGroupingPrivate is a global instance of a GroupingPrivate that has no grouping columns and no ordering.
EmptyJoinPrivate is a global instance of a JoinPrivate that has no fields set.
EmptyTuple is a global instance of a TupleExpr that contains no elements.
FalseSingleton is a global instance of FalseExpr, to avoid allocations.
MaxCost is the maximum possible estimated cost.
NullSingleton is a global instance of NullExpr having the Unknown type (most common case), to avoid allocations.
PercentRankSingleton is the global instance of PercentRankExpr.
RankSingleton is the global instance of RankExpr.
RowNumberSingleton is the global instance of RowNumber.
ScalarFmtInterceptor is a callback that can be set to a custom formatting function.
ScalarListWithEmptyTuple is a global instance of a ScalarListExpr containing a TupleExpr that contains no elements.
ScanIsReverseFn is a callback that is used to figure out if a scan needs to happen in reverse (the code lives in the ordering package, and depending on that directly would be a dependency loop).
TrueFilter is a global instance of the empty FiltersExpr, used in situations where the filter should always evaluate to true:
SELECT * FROM a INNER JOIN b ON True
.
TrueSingleton is a global instance of TrueExpr, to avoid allocations.
# Structs
ColumnNameGenerator is used to generate a unique name for each column of a relational expression.
ExprFmtCtx is passed as context to expression formatting functions, which need to know the formatting flags and memo in order to format.
ExprNameGenerator is used to generate a unique name for each relational expression in a query tree.
FKCascade stores metadata necessary for building a cascading query.
Memo is a data structure for efficiently storing a forest of query plans.
ScanFlags stores any flags for the scan specified in the query (see tree.IndexFlags).
WindowFrame denotes the definition of a window frame for an individual window function, excluding the OFFSET expressions, if present.
# Interfaces
CascadeBuilder is an interface used to construct a cascading query for a specific FK relation.
RelExpr is implemented by all operators tagged as Relational.
ScalarPropsExpr is implemented by scalar expressions which cache scalar properties, like FiltersExpr and ProjectionsExpr.
# Type aliases
Cost is the best-effort approximation of the actual cost of executing a particular operator tree.
ExprFmtFlags controls which properties of the expression are shown in formatted output.
FKCascades stores metadata necessary for building cascading queries.
JoinFlags stores restrictions on the join execution method, derived from hints for a join specified in the query (see tree.JoinTableExpr).
ScanLimit is used for a limited table or index scan and stores the limit as well as the desired scan direction.
TupleOrdinal is an ordinal index into an expression of type Tuple.