Package org.eigenbase.rex

Provides a language for representing row-expressions.


Interface Summary
RexAction A RexAction is called when a RexPattern finds a match.
RexPattern A RexPattern represents an expression with holes in it.
RexSqlConvertlet Converts a RexNode expression into a SqlNode expression.
RexSqlConvertletTable Collection of RexSqlConvertlets.
RexToSqlNodeConverter Converts expressions from RexNode to SqlNode.
RexVisitor<R> Visitor pattern for traversing a tree of RexNode objects.

Class Summary
RexBuilder Factory for row expressions.
RexCall An expression formed by a call to an operator with zero or more expressions as operands.
RexCallBinding RexCallBinding implements SqlOperatorBinding by referring to an underlying collection of RexNode operands.
RexChecker Visitor which checks the validity of a RexNode expression.
RexCopier Shuttle which creates a deep copy of a Rex expression.
RexCorrelVariable Reference to the current row of a correlating relational expression.
RexDynamicParam Dynamic parameter reference in a row-expression.
RexFieldAccess Access to a field of a row-expression.
RexInputRef Variable which references a field of an input relational expression.
RexLiteral Constant value in a row-expression.
RexLocalRef Local variable.
RexMultisetUtil Utility class for various methods related to multisets.
RexMultisetUtil.RexCallMultisetOperatorCounter A RexShuttle that traverse all RexNode and counts total number of RexCalls traversed and number of multiset calls traversed.
RexNode Row expression.
RexOver Call to an aggregate function over a window.
RexOver.Finder Visitor which detects a RexOver inside a RexNode expression.
RexPermutationShuttle Visitor which replaces RexLocalRef objects after the expressions in a RexProgram have been reordered.
RexPermuteInputsShuttle Shuttle which applies a permutation to its input fields.
RexProgram A collection of expressions which read inputs, compute output expressions, and optionally use a condition to filter rows.
RexProgram.Checker Visitor which walks over a program and checks validity.
RexProgramBuilder Workspace for constructing a RexProgram.
RexRangeRef Reference to a range of columns.
RexShuttle Passes over a row-expression, calling a handler method for each node, appropriate to the type of the node.
RexSlot Abstract base class for RexInputRef and RexLocalRef.
RexSqlReflectiveConvertletTable Implementation of RexSqlConvertletTable.
RexSqlStandardConvertletTable Standard implementation of RexSqlConvertletTable.
RexToSqlNodeConverterImpl Standard implementation of RexToSqlNodeConverter.
RexToSqlTranslator Translates a row-expression to a SQL parse tree.
RexTransformer Takes a tree of RexNode objects and transforms it into another in one sense equivalent tree.
RexUtil Utility methods concerning row-expressions.
RexUtil.ExpressionNormalizer Walks over expressions and builds a bank of common sub-expressions.
RexUtil.FieldAccessFinder Visitor which builds a bitmap of the inputs used by an expression.
RexUtil.ForwardRefFinder Walks over an expression and throws an exception if it finds an RexInputRef with an ordinal beyond the number of fields in the input row type, or a RexLocalRef with ordinal greater than that set using RexUtil.ForwardRefFinder.setLimit(int).
RexVariable A row-expression which references a field.
RexVisitorImpl<R> Default implementation of RexVisitor, which visits each node but does nothing while it's there.
RexWindow Specification of the window of rows over which a RexOver windowed aggregate is evaluated.

Enum Summary
RexKind Enumeration of some important types of row-expression.

Exception Summary
RexUtil.ExpressionNormalizer.SubExprExistsException Thrown if there is a sub-expression.

Package org.eigenbase.rex Description

Provides a language for representing row-expressions.


Revision $Id: //open/dev/farrago/src/org/eigenbase/rex/package.html#7 $
Copyright Copyright (C) 2005-2009 The Eigenbase Project
Copyright (C) 2003-2009 SQLstream, Inc.
Copyright (C) 2005-2009 LucidEra, Inc.
Author Julian Hyde


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.


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: