public abstract class ExprSubselectNode extends ExprNodeBase implements ExprEvaluator, ExprEnumerationForge, ExprEnumerationEval, ExprTypableReturnForge, ExprTypableReturnEval, ExprForge
Modifier and Type | Class and Description |
---|---|
static class |
ExprSubselectNode.SubqueryAggregationType |
Modifier and Type | Field and Description |
---|---|
static ExprSubselectNode[] |
EMPTY_SUBSELECT_ARRAY |
protected ExprEvaluator |
filterExpr
The validate filter expression.
|
protected ExprEvaluator |
havingExpr
The validated having expression.
|
protected EventType |
rawEventType
The event type generated for wildcard selects.
|
protected java.lang.String[] |
selectAsNames |
protected ExprNode[] |
selectClause
The validated select clause.
|
protected ExprEvaluator[] |
selectClauseEvaluator |
protected java.lang.String |
statementName |
protected AggregationService |
subselectAggregationService |
protected int |
subselectNumber |
Constructor and Description |
---|
ExprSubselectNode(StatementSpecRaw statementSpec)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equalsNode(ExprNode node,
boolean ignoreStreamPrefix)
Return true if a expression node semantically equals the current node, or false if not.
|
abstract java.lang.Object |
evaluate(EventBean[] eventsPerStream,
boolean isNewData,
java.util.Collection<EventBean> matchingEvents,
ExprEvaluatorContext exprEvaluatorContext)
Evaluate the lookup expression returning an evaluation result object.
|
java.lang.Object |
evaluate(EventBean[] eventsPerStream,
boolean isNewData,
ExprEvaluatorContext exprEvaluatorContext)
Evaluate event tuple and return result.
|
CodegenExpression |
evaluateCodegen(java.lang.Class requiredType,
CodegenMethodScope codegenMethodScope,
ExprForgeCodegenSymbol exprSymbol,
CodegenClassScope codegenClassScope) |
abstract java.util.Collection<EventBean> |
evaluateGetCollEvents(EventBean[] eventsPerStream,
boolean isNewData,
java.util.Collection<EventBean> matchingEvents,
ExprEvaluatorContext exprEvaluatorContext) |
abstract java.util.Collection |
evaluateGetCollScalar(EventBean[] eventsPerStream,
boolean isNewData,
java.util.Collection<EventBean> matchingEvents,
ExprEvaluatorContext exprEvaluatorContext) |
abstract EventBean |
evaluateGetEventBean(EventBean[] eventsPerStream,
boolean isNewData,
java.util.Collection<EventBean> matchingEvents,
ExprEvaluatorContext exprEvaluatorContext) |
EventBean |
evaluateGetEventBean(EventBean[] eventsPerStream,
boolean isNewData,
ExprEvaluatorContext context) |
CodegenExpression |
evaluateGetEventBeanCodegen(CodegenMethodScope codegenMethodScope,
ExprForgeCodegenSymbol exprSymbol,
CodegenClassScope codegenClassScope) |
java.util.Collection<EventBean> |
evaluateGetROCollectionEvents(EventBean[] eventsPerStream,
boolean isNewData,
ExprEvaluatorContext exprEvaluatorContext) |
CodegenExpression |
evaluateGetROCollectionEventsCodegen(CodegenMethodScope codegenMethodScope,
ExprForgeCodegenSymbol exprSymbol,
CodegenClassScope codegenClassScope) |
java.util.Collection |
evaluateGetROCollectionScalar(EventBean[] eventsPerStream,
boolean isNewData,
ExprEvaluatorContext exprEvaluatorContext) |
CodegenExpression |
evaluateGetROCollectionScalarCodegen(CodegenMethodScope codegenMethodScope,
ExprForgeCodegenSymbol exprSymbol,
CodegenClassScope codegenClassScope) |
abstract java.lang.Object[][] |
evaluateTypableMulti(EventBean[] eventsPerStream,
boolean isNewData,
java.util.Collection<EventBean> matchingEvents,
ExprEvaluatorContext exprEvaluatorContext) |
java.lang.Object[][] |
evaluateTypableMulti(EventBean[] eventsPerStream,
boolean isNewData,
ExprEvaluatorContext context) |
CodegenExpression |
evaluateTypableMultiCodegen(CodegenMethodScope codegenMethodScope,
ExprForgeCodegenSymbol exprSymbol,
CodegenClassScope codegenClassScope) |
abstract java.lang.Object[] |
evaluateTypableSingle(EventBean[] eventsPerStream,
boolean isNewData,
java.util.Collection<EventBean> matchingEvents,
ExprEvaluatorContext exprEvaluatorContext) |
java.lang.Object[] |
evaluateTypableSingle(EventBean[] eventsPerStream,
boolean isNewData,
ExprEvaluatorContext context) |
CodegenExpression |
evaluateTypableSingleCodegen(CodegenMethodScope codegenMethodScope,
ExprForgeCodegenSymbol exprSymbol,
CodegenClassScope codegenClassScope) |
ExprForgeComplexityEnum |
getComplexity() |
ExprEvaluator |
getExprEvaluator() |
ExprEnumerationEval |
getExprEvaluatorEnumeration() |
ExprEvaluator |
getFilterExpr()
Returns filter expr or null if none.
|
StreamTypeService |
getFilterSubqueryStreamTypes()
Return stream types.
|
ExprForge |
getForge() |
ExprNodeRenderable |
getForgeRenderable() |
ExprEvaluator |
getHavingExpr() |
ExprPrecedenceEnum |
getPrecedence()
Returns precedence.
|
EventType |
getRawEventType()
Returns the event type.
|
java.util.LinkedHashMap<java.lang.String,java.lang.Object> |
getRowProperties()
Return null to indicate no row-type result available,
or a map of property names and types to indicate a row-type result is available.
|
ExprNode[] |
getSelectClause()
Returns the select clause or null if none.
|
StatementSpecCompiled |
getStatementSpecCompiled()
Returns the compiled statement spec.
|
StatementSpecRaw |
getStatementSpecRaw()
Returns the uncompiled statement spec.
|
AggregationService |
getSubselectAggregationService() |
ExprSubselectNode.SubqueryAggregationType |
getSubselectAggregationType() |
int |
getSubselectNumber() |
ExprTypableReturnEval |
getTypableReturnEvaluator() |
abstract boolean |
isAllowMultiColumnSelect() |
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.
|
boolean |
isFilterStreamSubselect() |
java.lang.Boolean |
isMultirow()
Return true for multi-row return, return false for return of single row only
|
void |
setFilterExpr(ExprEvaluator filterExpr)
Sets the validated filter expression, or null if there is none.
|
void |
setFilterStreamSubselect(boolean filterStreamSubselect) |
void |
setFilterSubqueryStreamTypes(StreamTypeService filterSubqueryStreamTypes)
Set stream types.
|
void |
setHavingExpr(ExprEvaluator havingExpr) |
void |
setRawEventType(EventType rawEventType)
Sets the event type generated for wildcard selects.
|
void |
setSelectAsNames(java.lang.String[] selectAsNames)
Supplies the name of the select expression as-tag
|
void |
setSelectClause(ExprNode[] selectClause,
EngineImportService engineImportService,
java.lang.String statementName)
Sets the validates select clause
|
void |
setStatementSpecCompiled(StatementSpecCompiled statementSpecCompiled,
int subselectNumber)
Supplies a compiled statement spec.
|
void |
setStrategy(ExprSubselectStrategy strategy)
Sets the strategy for boiling down the table of lookup events into a subset against which to run the filter.
|
void |
setSubselectAggregationService(AggregationService subselectAggregationService) |
void |
setSubselectAggregationType(ExprSubselectNode.SubqueryAggregationType subselectAggregationType) |
static ExprSubselectNode[] |
toArray(java.util.List<ExprSubselectNode> subselectNodes) |
void |
toPrecedenceFreeEPL(java.io.StringWriter writer) |
abstract java.util.LinkedHashMap<java.lang.String,java.lang.Object> |
typableGetRowProperties() |
ExprNode |
validate(ExprValidationContext validationContext) |
abstract void |
validateSubquery(ExprValidationContext validationContext) |
accept, accept, acceptChildnodes, addChildNode, addChildNodes, addChildNodeToFront, getChildNodes, replaceUnlistedChildNode, setChildNode, setChildNodes, toEPL
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getComponentTypeCollection, getEventTypeCollection, getEventTypeSingle
getEvaluationType
public static final ExprSubselectNode[] EMPTY_SUBSELECT_ARRAY
protected ExprNode[] selectClause
protected transient ExprEvaluator[] selectClauseEvaluator
protected java.lang.String[] selectAsNames
protected transient ExprEvaluator filterExpr
protected transient ExprEvaluator havingExpr
protected transient EventType rawEventType
protected java.lang.String statementName
protected int subselectNumber
protected transient AggregationService subselectAggregationService
public ExprSubselectNode(StatementSpecRaw statementSpec)
statementSpec
- is the lookup statement spec from the parser, unvalidatedpublic abstract java.lang.Object evaluate(EventBean[] eventsPerStream, boolean isNewData, java.util.Collection<EventBean> matchingEvents, ExprEvaluatorContext exprEvaluatorContext)
eventsPerStream
- is the events for each stream in a joinisNewData
- is true for new data, or false for old datamatchingEvents
- is filtered results from the table of stored lookup eventsexprEvaluatorContext
- context for expression evalauationpublic abstract java.util.Collection<EventBean> evaluateGetCollEvents(EventBean[] eventsPerStream, boolean isNewData, java.util.Collection<EventBean> matchingEvents, ExprEvaluatorContext exprEvaluatorContext)
public abstract java.util.Collection evaluateGetCollScalar(EventBean[] eventsPerStream, boolean isNewData, java.util.Collection<EventBean> matchingEvents, ExprEvaluatorContext exprEvaluatorContext)
public abstract EventBean evaluateGetEventBean(EventBean[] eventsPerStream, boolean isNewData, java.util.Collection<EventBean> matchingEvents, ExprEvaluatorContext exprEvaluatorContext)
public abstract boolean isAllowMultiColumnSelect()
public abstract void validateSubquery(ExprValidationContext validationContext) throws ExprValidationException
ExprValidationException
public abstract java.util.LinkedHashMap<java.lang.String,java.lang.Object> typableGetRowProperties() throws ExprValidationException
ExprValidationException
public abstract java.lang.Object[] evaluateTypableSingle(EventBean[] eventsPerStream, boolean isNewData, java.util.Collection<EventBean> matchingEvents, ExprEvaluatorContext exprEvaluatorContext)
public abstract java.lang.Object[][] evaluateTypableMulti(EventBean[] eventsPerStream, boolean isNewData, java.util.Collection<EventBean> matchingEvents, ExprEvaluatorContext exprEvaluatorContext)
public ExprEvaluator getExprEvaluator()
getExprEvaluator
in interface ExprForge
public boolean isConstantResult()
ExprNode
isConstantResult
in interface ExprNode
public ExprNodeRenderable getForgeRenderable()
getForgeRenderable
in interface ExprEnumerationForge
getForgeRenderable
in interface ExprForge
public ExprNode validate(ExprValidationContext validationContext) throws ExprValidationException
validate
in interface ExprValidator
ExprValidationException
public void setStatementSpecCompiled(StatementSpecCompiled statementSpecCompiled, int subselectNumber)
statementSpecCompiled
- compiled validated filterssubselectNumber
- subselect assigned numberpublic StatementSpecCompiled getStatementSpecCompiled()
public void setSelectClause(ExprNode[] selectClause, EngineImportService engineImportService, java.lang.String statementName)
selectClause
- is the expression representing the select clauseengineImportService
- engine import servicestatementName
- namepublic java.lang.Object evaluate(EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext)
ExprEvaluator
evaluate
in interface ExprEvaluator
eventsPerStream
- - event tupleisNewData
- - indicates whether we are dealing with new data (istream) or old data (rstream)exprEvaluatorContext
- context for expression evaluationpublic CodegenExpression evaluateCodegen(java.lang.Class requiredType, CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope)
evaluateCodegen
in interface ExprForge
public ExprForgeComplexityEnum getComplexity()
getComplexity
in interface ExprForge
public java.util.Collection<EventBean> evaluateGetROCollectionEvents(EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext)
evaluateGetROCollectionEvents
in interface ExprEnumerationEval
public CodegenExpression evaluateGetROCollectionEventsCodegen(CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope)
evaluateGetROCollectionEventsCodegen
in interface ExprEnumerationForge
public java.util.Collection evaluateGetROCollectionScalar(EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext)
evaluateGetROCollectionScalar
in interface ExprEnumerationEval
public CodegenExpression evaluateGetROCollectionScalarCodegen(CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope)
evaluateGetROCollectionScalarCodegen
in interface ExprEnumerationForge
public EventBean evaluateGetEventBean(EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext context)
evaluateGetEventBean
in interface ExprEnumerationEval
public java.util.LinkedHashMap<java.lang.String,java.lang.Object> getRowProperties() throws ExprValidationException
ExprTypableReturnForge
getRowProperties
in interface ExprTypableReturnForge
ExprValidationException
- if the expression is invalidpublic java.lang.Boolean isMultirow()
ExprTypableReturnForge
isMultirow
in interface ExprTypableReturnForge
public java.lang.Object[] evaluateTypableSingle(EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext context)
evaluateTypableSingle
in interface ExprTypableReturnEval
public CodegenExpression evaluateTypableSingleCodegen(CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope)
evaluateTypableSingleCodegen
in interface ExprTypableReturnForge
public java.lang.Object[][] evaluateTypableMulti(EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext context)
evaluateTypableMulti
in interface ExprTypableReturnEval
public CodegenExpression evaluateTypableMultiCodegen(CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope)
evaluateTypableMultiCodegen
in interface ExprTypableReturnForge
public ExprEnumerationEval getExprEvaluatorEnumeration()
getExprEvaluatorEnumeration
in interface ExprEnumerationForge
public CodegenExpression evaluateGetEventBeanCodegen(CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope)
evaluateGetEventBeanCodegen
in interface ExprEnumerationForge
public StatementSpecRaw getStatementSpecRaw()
public void setSelectAsNames(java.lang.String[] selectAsNames)
selectAsNames
- is the as-name(s)public void setFilterExpr(ExprEvaluator filterExpr)
filterExpr
- is the filterpublic void setHavingExpr(ExprEvaluator havingExpr)
public void toPrecedenceFreeEPL(java.io.StringWriter writer)
toPrecedenceFreeEPL
in class ExprNodeBase
public ExprPrecedenceEnum getPrecedence()
ExprNode
getPrecedence
in interface ExprNode
public boolean equalsNode(ExprNode node, boolean ignoreStreamPrefix)
ExprNode
Concrete implementations should compare the type and any additional information that impact the evaluation of a node.
equalsNode
in interface ExprNode
node
- to compare toignoreStreamPrefix
- when the equals-comparison can ignore prefix of event propertiespublic void setStrategy(ExprSubselectStrategy strategy)
strategy
- is the looking strategy (full table scan or indexed)public void setRawEventType(EventType rawEventType)
rawEventType
- is the wildcard type (parent view)public ExprNode[] getSelectClause()
public ExprEvaluator getFilterExpr()
public ExprEvaluator getHavingExpr()
public EventType getRawEventType()
public StreamTypeService getFilterSubqueryStreamTypes()
public void setFilterSubqueryStreamTypes(StreamTypeService filterSubqueryStreamTypes)
filterSubqueryStreamTypes
- typespublic ExprSubselectNode.SubqueryAggregationType getSubselectAggregationType()
public void setSubselectAggregationType(ExprSubselectNode.SubqueryAggregationType subselectAggregationType)
public int getSubselectNumber()
public void setFilterStreamSubselect(boolean filterStreamSubselect)
public boolean isFilterStreamSubselect()
public static ExprSubselectNode[] toArray(java.util.List<ExprSubselectNode> subselectNodes)
public void setSubselectAggregationService(AggregationService subselectAggregationService)
public AggregationService getSubselectAggregationService()
public ExprTypableReturnEval getTypableReturnEvaluator()
getTypableReturnEvaluator
in interface ExprTypableReturnForge