net.esper.eql.expression
Class ExprSubselectNode

java.lang.Object
  extended by net.esper.eql.expression.ExprNode
      extended by net.esper.eql.expression.ExprSubselectNode
All Implemented Interfaces:
Serializable, ExprEvaluator, ExprValidator, MetaDefItem
Direct Known Subclasses:
ExprSubselectExistsNode, ExprSubselectInNode, ExprSubselectRowNode

public abstract class ExprSubselectNode
extends ExprNode

Represents a subselect in an expression tree.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class net.esper.eql.expression.ExprNode
ExprNode.MappedPropertyParseResult
 
Field Summary
protected  ExprNode filterExpr
          The validate filter expression.
protected  EventType rawEventType
          The event type generated for wildcard selects.
protected  ExprNode selectClause
          The validated select clause.
 
Constructor Summary
ExprSubselectNode(StatementSpecRaw statementSpec)
          Ctor.
 
Method Summary
 boolean equalsNode(ExprNode node)
          Return true if a expression node semantically equals the current node, or false if not.
 Object evaluate(EventBean[] eventsPerStream, boolean isNewData)
          Evaluate event tuple and return result.
abstract  Object evaluate(EventBean[] eventsPerStream, boolean isNewData, Set<EventBean> matchingEvents)
          Evaluate the lookup expression returning an evaluation result object.
 StatementSpecCompiled getStatementSpecCompiled()
          Returns the compiled statement spec.
 StatementSpecRaw getStatementSpecRaw()
          Returns the uncompiled statement spec.
 boolean isConstantResult()
          Returns true if the expression node's evaluation value doesn't depend on any events data, as must be determined at validation time, which is bottom-up and therefore reliably allows each node to determine constant value.
 void setFilterExpr(ExprNode filterExpr)
          Sets the validated filter expression, or null if there is none.
 void setRawEventType(EventType rawEventType)
          Sets the event type generated for wildcard selects.
 void setSelectAsName(String selectAsName)
          Supplies the name of the select expression as-tag
 void setSelectClause(ExprNode selectClause)
          Sets the validate select clause
 void setStatementSpecCompiled(StatementSpecCompiled statementSpecCompiled)
          Supplies a compiled statement spec.
 void setStrategy(TableLookupStrategy strategy)
          Sets the strategy for boiling down the table of lookup events into a subset against which to run the filter.
 String toExpressionString()
          Returns the expression node rendered as a string.
 
Methods inherited from class net.esper.eql.expression.ExprNode
accept, addChildNode, deepEquals, dumpDebug, getChildNodes, getValidatedSubtree, parseMappedProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.esper.eql.expression.ExprValidator
getType, validate
 

Field Detail

selectClause

protected ExprNode selectClause
The validated select clause.


filterExpr

protected ExprNode filterExpr
The validate filter expression.


rawEventType

protected EventType rawEventType
The event type generated for wildcard selects.

Constructor Detail

ExprSubselectNode

public ExprSubselectNode(StatementSpecRaw statementSpec)
Ctor.

Parameters:
statementSpec - is the lookup statement spec from the parser, unvalidated
Method Detail

evaluate

public abstract Object evaluate(EventBean[] eventsPerStream,
                                boolean isNewData,
                                Set<EventBean> matchingEvents)
Evaluate the lookup expression returning an evaluation result object.

Parameters:
eventsPerStream - is the events for each stream in a join
isNewData - is true for new data, or false for old data
matchingEvents - is filtered results from the table of stored lookup events
Returns:
evaluation result

isConstantResult

public boolean isConstantResult()
Description copied from class: ExprNode
Returns true if the expression node's evaluation value doesn't depend on any events data, as must be determined at validation time, which is bottom-up and therefore reliably allows each node to determine constant value.

Specified by:
isConstantResult in class ExprNode
Returns:
true for constant evaluation value, false for non-constant evaluation value

setStatementSpecCompiled

public void setStatementSpecCompiled(StatementSpecCompiled statementSpecCompiled)
Supplies a compiled statement spec.

Parameters:
statementSpecCompiled - compiled validated filters

getStatementSpecCompiled

public StatementSpecCompiled getStatementSpecCompiled()
Returns the compiled statement spec.

Returns:
compiled statement

setSelectClause

public void setSelectClause(ExprNode selectClause)
Sets the validate select clause

Parameters:
selectClause - is the expression representing the select clause

evaluate

public Object evaluate(EventBean[] eventsPerStream,
                       boolean isNewData)
Description copied from interface: ExprEvaluator
Evaluate event tuple and return result.

Parameters:
eventsPerStream - - event tuple
isNewData - - indicates whether we are dealing with new data (istream) or old data (rstream)
Returns:
evaluation result, a boolean value for OR/AND-type evalution nodes.

getStatementSpecRaw

public StatementSpecRaw getStatementSpecRaw()
Returns the uncompiled statement spec.

Returns:
statement spec uncompiled

setSelectAsName

public void setSelectAsName(String selectAsName)
Supplies the name of the select expression as-tag

Parameters:
selectAsName - is the as-name

setFilterExpr

public void setFilterExpr(ExprNode filterExpr)
Sets the validated filter expression, or null if there is none.

Parameters:
filterExpr - is the filter

toExpressionString

public String toExpressionString()
Description copied from class: ExprNode
Returns the expression node rendered as a string.

Specified by:
toExpressionString in class ExprNode
Returns:
string rendering of expression

equalsNode

public boolean equalsNode(ExprNode node)
Description copied from class: ExprNode
Return true if a expression node semantically equals the current node, or false if not.

Concrete implementations should compare the type and any additional information that impact the evaluation of a node.

Specified by:
equalsNode in class ExprNode
Parameters:
node - to compare to
Returns:
true if semantically equal, or false if not equals

setStrategy

public void setStrategy(TableLookupStrategy strategy)
Sets the strategy for boiling down the table of lookup events into a subset against which to run the filter.

Parameters:
strategy - is the looking strategy (full table scan or indexed)

setRawEventType

public void setRawEventType(EventType rawEventType)
Sets the event type generated for wildcard selects.

Parameters:
rawEventType - is the wildcard type (parent view)

© 2007 EsperTech Inc.
All rights reserved.
Visit us at espertech.com