package
19.2.12+incompatible
Repository: https://github.com/cockroachdb/cockroach-gen.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.
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).
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.
ExtractAggInputColumns returns the set of columns the aggregate depends on.
ExtractAggSingleInputColumn returns the input ColumnID of an aggregate operator that has a single input.
ExtractConstantFilter returns a map of columns to the filters that constrain value to a constant.
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.
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.
ExtractValuesFromFilter returns a map of constant columns, to the values they're constrained to.
ExtractVarFromAggInput is given an argument to an Aggregate and returns the inner Variable expression, stripping out modifiers like AggDistinct.
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.
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.
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.
RequestColStat causes a column statistic to be calculated on the relational expression.

# Constants

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, or side effects in the output.
ExprFmtHideOrderings hides all orderings.
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.

# 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.
No description provided by the author
No description provided by the author
No description provided by the author
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.
No description provided by the author
No description provided by the author
No description provided by the author
EmptyTuple is a global instance of a TupleExpr that contains no elements.
No description provided by the author
No description provided by the author
ExprFmtInterceptor is a callback that can be set to a custom formatting function.
FalseFilter is a global instance of a FiltersExpr that contains a single False expression, used in contradiction situations: SELECT * FROM a WHERE 1=0 .
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.
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

AggDistinctExpr is used as a modifier that wraps the input of an aggregate function.
AggFilterExpr is used as a modifier that wraps the input of an aggregate function.
AggregationsItem encapsulates the information for constructing an aggregate output column, including its ColumnID and the aggregate expression that produces its value.
AlterTableRelocateExpr represents an `ALTER TABLE/INDEX .
No description provided by the author
AlterTableSplitExpr represents an `ALTER TABLE/INDEX .
No description provided by the author
AlterTableUnsplit represents an `ALTER TABLE/INDEX .
AlterTableUnsplitExpr represents an `ALTER TABLE/INDEX .
AndExpr is the boolean conjunction operator that evalutes to true only if both of its conditions evaluate to true.
No description provided by the author
No description provided by the author
AnyExpr is a SQL operator that applies a comparison to every row of an input subquery and returns true if any of the comparisons are true, else returns null if any of the comparisons are null, else returns false.
AnyNotNullAggExpr returns any non-NULL value it receives, with no other guarantees.
AnyScalarExpr is the form of ANY which refers to an ANY operation on a tuple or array, as opposed to Any which operates on a subquery.
No description provided by the author
ArrayExpr is an ARRAY literal of the form ARRAY[<expr1>, <expr2>, ..., <exprN>].
ArrayFlattenExpr is an ARRAY(<subquery>) expression.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
CancelQueriesExpr represents a `CANCEL QUERIES` statement.
CancelSessionsExpr represents a `CANCEL SESSIONS` statement.
CaseExpr is a CASE statement of the form: CASE [ <Input> ] WHEN <condval1> THEN <expr1> [ WHEN <condval2> THEN <expr2> ] ..
CastExpr converts the input expression into an expression of the target type.
No description provided by the author
CollateExpr is an expression of the form x COLLATE y Where x is a "string type" (meaning either a normal string or a collated string), and y is a locale.
ColPrivate contains the ColumnID of a synthesized projection or aggregation column, as well as a set of lazily-populated scalar properties that apply to the column.
ColumnAccessExpr is a scalar expression that returns a column from the given input expression (which is assumed to be of type Tuple).
ColumnNameGenerator is used to generate a unique name for each column of a relational expression.
No description provided by the author
No description provided by the author
ConstAggExpr is used in the special case when the value of a column is known to be constant within a grouping set; it returns that value.
ConstExpr is a typed scalar constant value.
ConstNotNullAggExpr is used in the special case when the value of a column is known to be constant within a grouping set, except on some rows where it can have a NULL value; it returns the non-NULL constant value.
No description provided by the author
ControlJobsExpr represents a `PAUSE/CANCEL/RESUME JOBS` statement.
No description provided by the author
No description provided by the author
No description provided by the author
CreateTableExpr represents a CREATE TABLE statement.
No description provided by the author
No description provided by the author
No description provided by the author
CumeDistExpr is the relative rank of the current row: (number of rows preceding or peer with current row) / (total rows).
DeleteExpr is an operator used to delete all rows that are selected by a relational input expression: DELETE FROM abc WHERE a>0 ORDER BY b LIMIT 10 .
DenseRankExpr is like Rank, but without gaps.
DistinctOnExpr filters out rows that are identical on the set of grouping columns; only the first row (according to an ordering) is kept for each set of possible values.
No description provided by the author
No description provided by the author
ExceptAllExpr is an operator used to perform a set difference between the Left and Right input relations.
ExceptExpr is an operator used to perform a set difference between the Left and Right input relations.
ExistsExpr takes a relational query as its input, and evaluates to true if the query returns at least one row.
ExplainExpr returns information about the execution plan of the "input" expression.
No description provided by the author
ExportExpr represents an `EXPORT` statement.
No description provided by the author
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.
FakeRelExpr is a mock relational operator used for testing; its logical properties are pre-determined and stored in the private.
No description provided by the author
FalseExpr is the boolean false value that is equivalent to the tree.DBoolFalse datum value.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
FiltersItem contains a filter condition that's evaluated to determine whether Select or Join rows should be filtered.
FirstAggExpr is used only by DistinctOn; it returns the value on the first row according to an ordering; if the ordering is unspecified (or partially specified), it is an arbitrary ordering but it must be the same across all FirstAggs in a DistinctOn.
FirstValueExpr returns Value evaluated at the first row in the row's frame.
FKChecksItem is a foreign key check query, to be run after the main query.
No description provided by the author
No description provided by the author
No description provided by the author
FunctionExpr invokes a builtin SQL function like CONCAT or NOW, passing the given arguments.
No description provided by the author
No description provided by the author
GroupByExpr computes aggregate functions over groups of input rows.
GroupingPrivate is shared between the grouping-related operators: GroupBy ScalarGroupBy, and DistinctOn.
No description provided by the author
IfErrExpr is roughly a runtime try-catch operator.
No description provided by the author
IndexJoinExpr represents an inner join between an input expression and a primary index.
No description provided by the author
IndirectionExpr is a subscripting expression of the form <expr>[<index>].
No description provided by the author
InnerJoinApplyExpr has the same join semantics as InnerJoin.
InnerJoinExpr creates a result set that combines columns from its left and right inputs, based upon its "on" join predicate.
InsertExpr evaluates a relational input expression, and inserts values from it into a target table.
IntersectAllExpr is an operator used to perform an intersection between the Left and Right input relations.
IntersectExpr is an operator used to perform an intersection between the Left and Right input relations.
No description provided by the author
No description provided by the author
JoinFlags stores restrictions on the join execution method, derived from hints for a join specified in the query (see tree.JoinTableExpr).
JoinPrivate is shared between the various join operators including apply variants, but excluding IndexJoin, LookupJoin, MergeJoin.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
KVOptionsItem is the key and value of an option (see tree.KVOption).
LagExpr returns Value evaluated at the row Offset rows before this one.
LastValueExpr returns Value evaluated at the last row in the row's frame.
LeadExpr returns Value evaluated at the row Offset rows after this one.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
LimitExpr returns a limited subset of the results in the input relation.
LookupJoinExpr represents a join between an input expression and an index.
No description provided by the author
No description provided by the author
No description provided by the author
Max1RowExpr enforces that its input must return at most one row.
No description provided by the author
Memo is a data structure for efficiently storing a forest of query plans.
MergeJoinExpr represents a join that is executed using merge-join.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NotExpr is the boolean negation operator that evaluates to true if its input evaluates to false.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NthValueExpr returns Value evaluated at the nth row in the row's frame.
NtileExpr builds a histogram with the specified number of buckets and evaluates to which bucket the row falls in.
NullExpr is the constant SQL null value that has "unknown value" semantics.
OffsetExpr filters out the first Offset rows of the input relation; used in conjunction with Limit.
OpaqueMutation is a variant of OpaqueRel for operators that cause a schema change and cannot be executed following a mutation in the same transaction.
OpaqueMutationExpr is a variant of OpaqueRel for operators that can mutate data as part of the transaction.
OpaqueRelExpr is an opaque relational operator which is planned outside of the optimizer.
No description provided by the author
OrdinalityExpr adds a column to each row in its input containing a unique, increasing number.
No description provided by the author
OrExpr is the boolean disjunction operator that evaluates to true if either one of its conditions evaluates to true.
No description provided by the author
PercentRankExpr is (rank - 1) / (total rows - 1).
No description provided by the author
No description provided by the author
No description provided by the author
ProjectExpr modifies the set of columns returned by the input result set.
ProjectionsItem encapsulates the information needed to synthesize an output column, including its ColumnID and the scalar expression that produces its value.
ProjectSetExpr represents a relational operator which zips through a list of generators for every row of the input.
RangeExpr contains an And expression that constrains a single variable to a range.
RankExpr computes the position of a row relative to an ordering, with same-valued rows receiving the same value.
No description provided by the author
No description provided by the author
No description provided by the author
RowNumberExpr computes the position of a row relative to an ordering, with same-valued rows having ties broken arbitrarily.
No description provided by the author
ScalarGroupByExpr computes aggregate functions over the complete set of input rows.
ScanExpr returns a result set containing every row in a table by scanning one of the table's indexes according to its ordering.
ScanFlags stores any flags for the scan specified in the query (see tree.IndexFlags).
No description provided by the author
SelectExpr filters rows from its input result set, based on the boolean filter predicate expression.
No description provided by the author
No description provided by the author
SequenceSelectExpr represents a read from a sequence as a data source.
No description provided by the author
SetPrivate contains fields used by the relational set operators: Union, Intersect, Except, UnionAll, IntersectAll and ExceptAll.
ShowTraceForSessionExpr returns the current session traces.
No description provided by the author
No description provided by the author
SortExpr enforces the ordering of rows returned by its input expression.
No description provided by the author
No description provided by the author
No description provided by the author
SubqueryExpr is a subquery in a single-row context.
SubqueryPrivate contains information related to a subquery (Subquery, Any, Exists).
No description provided by the author
No description provided by the author
TrueExpr is the boolean true value that is equivalent to the tree.DBoolTrue datum value.
No description provided by the author
No description provided by the author
No description provided by the author
UnionAllExpr is an operator used to combine the Left and Right input relations into a single set containing rows from both inputs.
UnionExpr is an operator used to combine the Left and Right input relations into a single set containing rows from both inputs.
UnsupportedExprExpr is used for interfacing with the old planner code.
UpdateExpr evaluates a relational input expression that fetches existing rows from a target table and computes new values for one or more columns.
UpsertExpr evaluates a relational input expression that tries to insert a new row into a target table.
ValuesExpr returns a manufactured result set containing a constant number of rows.
No description provided by the author
VariableExpr is the typed scalar value of a column in the query.
No description provided by the author
VirtualScanExpr returns a result set containing every row in a virtual table.
No description provided by the author
WhenExpr represents a single WHEN ..
WindowExpr represents a window function.
WindowFrame denotes the definition of a window frame for an individual window function, excluding the OFFSET expressions, if present.
WindowFromOffsetExpr is used as a modifier that wraps the input of a window function.
No description provided by the author
WindowsItem is a single window function to be computed in the context of a Window expression.
No description provided by the author
WindowToOffsetExpr is used as a modifier that wraps the input of a window function.
WithExpr executes Binding, making its results available to Main.
No description provided by the author
WithScanExpr returns the results present in the With expression referenced by ID.
No description provided by the author
No description provided by the author
ZigzagJoinExpr represents a join that is executed using the zigzag joiner.
No description provided by the author
ZipItem contains a generator function or scalar expression that is contained in a Zip.
ZipItemPrivate contains the list of output columns for the generator function or scalar expression in a ZipItem, as well as a set of lazily-populated scalar properties that apply to the ZipItem.

# Interfaces

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

AggregationsExpr is a set of AggregationsItem expressions that specify the ColumnIDs and aggregation expression for output columns projected by a containing grouping operator (GroupBy, ScalarGroupBy, or DistinctOn).
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.
FiltersExpr is a set of FiltersItem expressions that specify a set of conjuncts that filter rows selected by a containing Select or Join operator.
FKChecksExpr is a list of foreign key check queries, to be run after the main query.
KVOptionsExpr is a set of KVOptionItems that specify arbitrary keys and values that are used as modifiers for various statements (see tree.KVOptions).
ProjectionsExpr is a set of ProjectionsItem expressions that specify the ColumnIDs and scalar expressions for the synthesized output columns projected by a containing Project operator.
ScalarListExpr is a list expression that has scalar expression items of type opt.ScalarExpr.
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.
WindowsExpr is a set of window functions to be computed in the context of a Window expression.
ZipExpr represents a functional zip over generators a,b,c, which returns tuples of values from a,b,c picked "simultaneously".