org.eigenbase.rex
Class RexOver

java.lang.Object
  extended by org.eigenbase.rex.RexNode
      extended by org.eigenbase.rex.RexCall
          extended by org.eigenbase.rex.RexOver

public class RexOver
extends RexCall

Call to an aggregate function over a window.

Since:
Dec 6, 2004
Version:
$Id: //open/dev/farrago/src/org/eigenbase/rex/RexOver.java#16 $
Author:
jhyde

Nested Class Summary
private static class RexOver.Finder
          Visitor which detects a RexOver inside a RexNode expression.
private static class RexOver.OverFound
           
 
Field Summary
private  RexWindow window
           
 
Fields inherited from class org.eigenbase.rex.RexCall
operands
 
Fields inherited from class org.eigenbase.rex.RexNode
digest, EMPTY_ARRAY
 
Constructor Summary
RexOver(RelDataType type, SqlAggFunction op, RexNode[] operands, RexWindow window)
          Creates a RexOver.
 
Method Summary
<R> R
accept(RexVisitor<R> visitor)
          Accepts a visitor, dispatching to the right overloaded visitXxx method.
 RexOver clone()
           
protected  String computeDigest(boolean withType)
           
static boolean containsOver(RexNode expr)
          Returns whether an expression contains an OVER clause.
static boolean containsOver(RexNode[] exprs, RexNode expr)
          Deprecated.  
static boolean containsOver(RexProgram program)
          Returns whether a program contains an OVER clause.
 SqlAggFunction getAggOperator()
          Returns the aggregate operator for this expression.
 RexWindow getWindow()
           
 
Methods inherited from class org.eigenbase.rex.RexCall
clone, getKind, getOperands, getOperator, getType, sqlKindToRexKind, toString
 
Methods inherited from class org.eigenbase.rex.RexNode
isA, isAlwaysTrue
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

window

private final RexWindow window
Constructor Detail

RexOver

RexOver(RelDataType type,
        SqlAggFunction op,
        RexNode[] operands,
        RexWindow window)
Creates a RexOver.

For example, "SUM(x) OVER (ROWS 3 PRECEDING)" is represented as:

Parameters:
type - Result type
op - Aggregate operator
operands - Operands list
window - Window specification
"Precondition:"
op.isAggregator(), window != null, window.getRefName() == null
Method Detail

getAggOperator

public SqlAggFunction getAggOperator()
Returns the aggregate operator for this expression.


getWindow

public RexWindow getWindow()

computeDigest

protected String computeDigest(boolean withType)
Overrides:
computeDigest in class RexCall

clone

public RexOver clone()
Overrides:
clone in class RexCall

accept

public <R> R accept(RexVisitor<R> visitor)
Description copied from class: RexNode
Accepts a visitor, dispatching to the right overloaded visitXxx method.

Also see RexProgram.apply(RexVisitor, RexNode[], RexNode), which applies a visitor to several expressions simultaneously.

Overrides:
accept in class RexCall

containsOver

public static boolean containsOver(RexNode expr)
Returns whether an expression contains an OVER clause.


containsOver

public static boolean containsOver(RexProgram program)
Returns whether a program contains an OVER clause.


containsOver

public static boolean containsOver(RexNode[] exprs,
                                   RexNode expr)
Deprecated. 

Returns whether an expression list contains an OVER clause.