org.eigenbase.sql.validate
Class OverScope

java.lang.Object
  extended by org.eigenbase.sql.validate.DelegatingScope
      extended by org.eigenbase.sql.validate.ListScope
          extended by org.eigenbase.sql.validate.OverScope
All Implemented Interfaces:
SqlValidatorScope

public class OverScope
extends ListScope

The name-resolution scope of a OVER clause. The objects visible are those in the parameters found on the left side of the over clause, and objects inherited from the parent scope.

This object is both a SqlValidatorScope only. In the query

SELECT name FROM (
     SELECT *
     FROM emp OVER (
         ORDER BY empno
         RANGE BETWEEN 2 PRECEDING AND 2 FOLLOWING))
 

We need to use the OverScope as a SqlValidatorNamespace when resolving names used in the window specification.

Since:
Jun 29, 2005
Version:
$Id: //open/dev/farrago/src/org/eigenbase/sql/validate/OverScope.java#10 $
Author:
jack

Field Summary
private  SqlCall overCall
           
 
Fields inherited from class org.eigenbase.sql.validate.ListScope
children, childrenNames
 
Fields inherited from class org.eigenbase.sql.validate.DelegatingScope
parent, validator
 
Constructor Summary
OverScope(SqlValidatorScope parent, SqlCall overCall)
          Creates a scope corresponding to a SELECT clause.
 
Method Summary
 SqlMonotonicity getMonotonicity(SqlNode expr)
          Returns whether an expression is monotonic in this scope.
 SqlNode getNode()
          Returns the root node of this scope.
 
Methods inherited from class org.eigenbase.sql.validate.ListScope
addChild, findAliases, findAllColumnNames, findQualifyingTableName, getChild, getChildren, resolve, resolveColumn
 
Methods inherited from class org.eigenbase.sql.validate.DelegatingScope
addColumnNames, fullyQualify, getOperandScope, getOrderList, getParent, getValidator, lookupWindow, validateExpr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

overCall

private final SqlCall overCall
Constructor Detail

OverScope

OverScope(SqlValidatorScope parent,
          SqlCall overCall)
Creates a scope corresponding to a SELECT clause.

Parameters:
parent - Parent scope, or null
overCall - Call to OVER operator
Method Detail

getNode

public SqlNode getNode()
Description copied from interface: SqlValidatorScope
Returns the root node of this scope.


getMonotonicity

public SqlMonotonicity getMonotonicity(SqlNode expr)
Description copied from interface: SqlValidatorScope
Returns whether an expression is monotonic in this scope. For example, if the scope has previously been sorted by columns X, Y, then X is monotonic in this scope, but Y is not.

Specified by:
getMonotonicity in interface SqlValidatorScope
Overrides:
getMonotonicity in class DelegatingScope