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:
RexLiteral
represents a boolean, numeric, string, or date constant, or the valueNULL
.RexVariable
represents a leaf of the tree. It has sub-types:RexCorrelVariable
is a correlating variable for nested-loop joinsRexInputRef
refers to a field of an input relational expressionRexCall
is 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.RexRangeRef
refers 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.sql
SQL object modelorg.apache.calcite.plan
Core classes, includingRelDataType
andRelDataTypeFactory
.
-
ClassDescriptionVisitor pattern for traversing a tree of
RexNode
objects.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 ofRexNode
objects 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.RexCallBinding
implementsSqlOperatorBinding
by referring to an underlying collection ofRexNode
operands.Visitor which checks the validity of aRexNode
expression.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 aRexNode
expression.Can reduce expressions, writing a literal for each into a list.Evaluates aRexNode
expression.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.EvaluatesRexNode
expressions.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.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 replacesRexLocalRef
objects after the expressions in aRexProgram
have 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 ofRexSqlConvertlet
s.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 ofRexNode
objects and transforms it into another in one sense equivalent tree.Default implementation of aRexBiVisitor
whose payload and return type are the same.Policy for whether a simplified expression may instead return another value.Utility methods concerning row-expressions.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 SubQueriesRexSubQuery
in a projection list of a givenProject
.Visitor that throwsUtil.FoundOne
if applied to an expression that contains aRexSubQuery
.A row-expression which references a field.RexVisitor<R>Visitor pattern for traversing a tree ofRexNode
objects.Default implementation ofRexVisitor
, which visits each node but does nothing while it's there.Specification of the window of rows over which aRexOver
windowed 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.