Package org.apache.calcite.rex
@DefaultQualifier(value=org.checkerframework.checker.nullness.qual.NonNull.class,locations=FIELD) @DefaultQualifier(value=org.checkerframework.checker.nullness.qual.NonNull.class,locations=PARAMETER) @DefaultQualifier(value=org.checkerframework.checker.nullness.qual.NonNull.class,locations=RETURN)
package org.apache.calcite.rex
Provides a language for representing row-expressions.
Life-cycle
A SqlToRelConverter converts a SQL
parse tree consisting of SqlNode objects into
a relational expression (RelNode). Several
kinds of nodes in this tree have row expressions
(RexNode).
After the relational expression has been optimized, a
JavaRelImplementor converts it
into to a plan. If the plan is a Java parse tree, row-expressions are
translated into equivalent Java expressions.
Expressions
Every row-expression has a type. (Compare with
SqlNode, which is created before validation,
and therefore types may not be available.)
Every node in the parse tree is a RexNode.
Sub-types are:
RexLiteralrepresents a boolean, numeric, string, or date constant, or the valueNULL.RexVariablerepresents a leaf of the tree. It has sub-types:RexCorrelVariableis a correlating variable for nested-loop joinsRexInputRefrefers to a field of an input relational expressionRexCallis a call to an operator or function. By means of special operators, we can use this construct to represent virtually every non-leaf node in the tree.RexRangeRefrefers to a collection of contiguous fields from an input relational expression. It usually exists only during translation.
Expressions are generally
created using a RexBuilder factory.
Related packages
org.apache.calcite.sqlSQL object modelorg.apache.calcite.planCore classes, includingRelDataTypeandRelDataTypeFactory.
-
ClassDescriptionVisitor pattern for traversing a tree of
RexNodeobjects.Deprecated.Analyzes an expression, figures out what are the unbound variables, assigns a variety of values to each unbound variable, and evaluates the expression.RexBiVisitor<R,P> Visitor pattern for traversing a tree ofRexNodeobjects and passing a payload to each.RexBiVisitorImpl<R,P> Default implementation ofRexBiVisitor, which visits each node but does nothing while it's there.Factory for row expressions.An expression formed by a call to an operator with zero or more expressions as operands.RexCallBindingimplementsSqlOperatorBindingby referring to an underlying collection ofRexNodeoperands.Visitor which checks the validity of aRexNodeexpression.Reference to the current row of a correlating relational expression.Defines if type information should be printed forRexLiteral.Dynamic parameter reference in a row-expression.Result of compiling code generated from aRexNodeexpression.Can reduce expressions, writing a literal for each into a list.Evaluates aRexNodeexpression.Access to a field of a row-expression.Expression combined with sort flags (DESCENDING, NULLS LAST).Variable which references a field of an input relational expression.EvaluatesRexNodeexpressions.Represents a lambda expression.Variable that references a field of a lambda expression.Constant value in a row-expression.Local variable.Utility class for various methods related to multisets.Row expression.RexNodeAndFieldIndex has the same meaning asRexInputRef, they are both reference a field of an input relational expression.Context required to normalize a row-expression.Call to an aggregate function over a window.Deprecated.Variable that references a field of an input relational expression.Visitor which replacesRexLocalRefobjects after the expressions in aRexProgramhave been reordered.Shuttle which applies a permutation to its input fields.A collection of expressions which read inputs, compute output expressions, and optionally use a condition to filter rows.Workspace for constructing aRexProgram.Reference to a range of columns.Passes over a row-expression, calling a handler method for each node, appropriate to the type of the node.Context required to simplify a row-expression.Thread-safe list that populates itself if you make a reference beyond the end of the list.Collection ofRexSqlConvertlets.Implementation ofRexSqlConvertletTable.Standard implementation ofRexSqlConvertletTable.Scalar expression that represents an IN, EXISTS or scalar sub-query.Variable which references a column of a table occurrence in a relational plan.Identifies uniquely a table by its qualified name and its entity number (occurrence).Standard implementation ofRexToSqlNodeConverter.Takes a tree ofRexNodeobjects and transforms it into another in one sense equivalent tree.Default implementation of aRexBiVisitorwhose payload and return type are the same.Policy for whether a simplified expression may instead return another value.Utility methods concerning row-expressions.Helper class that expands predicates from disjunctions (split by K).Deprecated.Visitor which builds a bitmap of the inputs used by an expression.Shuttle that fixes up an expression to match changes in nullability of input fields.Visitor that tells whether a node matching a particular description exists in a tree.Visitor that collects all the top level SubQueriesRexSubQueryin a projection list of a givenProject.Visitor that throwsUtil.FoundOneif applied to an expression that contains aRexSubQuery.A row-expression which references a field.RexVisitor<R>Visitor pattern for traversing a tree ofRexNodeobjects.Default implementation ofRexVisitor, which visits each node but does nothing while it's there.Specification of the window of rows over which aRexOverwindowed aggregate is evaluated.Abstracts "XX PRECEDING/FOLLOWING" and "CURRENT ROW" bounds for windowed aggregates.Helpers forRexWindowBound.Representation of different kinds of exclude clause in window functions.