Class ExprSubselectNode
java.lang.Object
com.espertech.esper.common.internal.epl.expression.core.ExprNodeBase
com.espertech.esper.common.internal.epl.expression.subquery.ExprSubselectNode
- All Implemented Interfaces:
ExprEnumerationForge
,ExprEvaluator
,ExprForge
,ExprForgeInstrumentable
,ExprNode
,ExprNodeRenderable
,ExprTypableReturnForge
,ExprValidator
- Direct Known Subclasses:
ExprSubselectAllSomeAnyNode
,ExprSubselectExistsNode
,ExprSubselectInNode
,ExprSubselectRowNode
public abstract class ExprSubselectNode
extends ExprNodeBase
implements ExprEvaluator, ExprEnumerationForge, ExprTypableReturnForge, ExprForgeInstrumentable
Represents a subselect in an expression tree.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final ExprSubselectNode[]
protected ExprForge
protected ExprForge
protected EventType
protected String[]
protected ExprNode[]
Fields inherited from interface com.espertech.esper.common.internal.epl.expression.core.ExprEvaluator
EPTYPE, EPTYPEARRAY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
equalsNode
(ExprNode node, boolean ignoreStreamPrefix) Return true if a expression node semantically equals the current node, or false if not.protected abstract CodegenExpression
evalMatchesGetCollEventsCodegen
(CodegenMethodScope parent, ExprSubselectEvalMatchSymbol symbols, CodegenClassScope classScope) protected abstract CodegenExpression
evalMatchesGetCollScalarCodegen
(CodegenMethodScope parent, ExprSubselectEvalMatchSymbol symbols, CodegenClassScope classScope) protected abstract CodegenExpression
evalMatchesGetEventBeanCodegen
(CodegenMethodScope parent, ExprSubselectEvalMatchSymbol symbols, CodegenClassScope classScope) protected abstract CodegenExpression
evalMatchesPlainCodegen
(CodegenMethodScope parent, ExprSubselectEvalMatchSymbol symbols, CodegenClassScope classScope) protected abstract CodegenExpression
evalMatchesTypableMultiCodegen
(CodegenMethodScope parent, ExprSubselectEvalMatchSymbol symbols, CodegenClassScope classScope) protected abstract CodegenExpression
evalMatchesTypableSingleCodegen
(CodegenMethodScope parent, ExprSubselectEvalMatchSymbol symbols, CodegenClassScope classScope) evaluate
(EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext) Evaluate event tuple and return result.evaluate
(EventBean[] eventsPerStream, boolean isNewData, Collection<EventBean> matchingEvents, ExprEvaluatorContext exprEvaluatorContext) evaluateCodegen
(EPTypeClass requiredType, CodegenMethodScope parent, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) evaluateCodegenUninstrumented
(EPTypeClass requiredType, CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) evaluateGetEventBeanCodegen
(CodegenMethodScope parent, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) evaluateGetROCollectionEventsCodegen
(CodegenMethodScope parent, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) evaluateGetROCollectionScalarCodegen
(CodegenMethodScope parent, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) evaluateTypableMultiCodegen
(CodegenMethodScope parent, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) evaluateTypableSingleCodegen
(CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) Return stream types.getForge()
Returns precedence.Returns the event type.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[]
Returns the select clause or null if none.Returns the compiled statement spec.Returns the uncompiled statement spec.int
abstract boolean
boolean
boolean
Return true for multi-row return, return false for return of single row onlyvoid
setFilterExpr
(ExprForge 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
(ExprForge havingExpr) void
setRawEventType
(EventType rawEventType) Sets the event type generated for wildcard selects.void
setSelectAsNames
(String[] selectAsNames) Supplies the name of the select expression as-tagvoid
setSelectClause
(ExprNode[] selectClause) Sets the validates select clausevoid
setStatementSpecCompiled
(StatementSpecCompiled statementSpecCompiled, int subselectNumber) Supplies a compiled statement spec.void
setSubselectAggregationType
(ExprSubselectNode.SubqueryAggregationType subselectAggregationType) static ExprSubselectNode[]
toArray
(List<ExprSubselectNode> subselectNodes) void
toPrecedenceFreeEPL
(StringWriter writer, ExprNodeRenderableFlags flags) abstract LinkedHashMap<String,
Object> validate
(ExprValidationContext validationContext) abstract void
validateSubquery
(ExprValidationContext validationContext) Methods inherited from class com.espertech.esper.common.internal.epl.expression.core.ExprNodeBase
accept, accept, acceptChildnodes, addChildNode, addChildNodes, addChildNodeToFront, checkValidated, checkValidatedException, getChildNodes, replaceUnlistedChildNode, setChildNode, setChildNodes, toEPL
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.espertech.esper.common.internal.epl.expression.core.ExprEnumerationForge
getComponentTypeCollection, getEventTypeCollection, getEventTypeSingle
Methods inherited from interface com.espertech.esper.common.internal.epl.expression.core.ExprForge
getEvaluationType
-
Field Details
-
EMPTY_SUBSELECT_ARRAY
-
selectClause
-
selectAsNames
-
filterExpr
-
havingExpr
-
rawEventType
-
-
Constructor Details
-
ExprSubselectNode
Ctor.- Parameters:
statementSpec
- is the lookup statement spec from the parser, unvalidated
-
-
Method Details
-
isAllowMultiColumnSelect
public abstract boolean isAllowMultiColumnSelect() -
validateSubquery
public abstract void validateSubquery(ExprValidationContext validationContext) throws ExprValidationException - Throws:
ExprValidationException
-
typableGetRowProperties
public abstract LinkedHashMap<String,Object> typableGetRowProperties() throws ExprValidationException- Throws:
ExprValidationException
-
evalMatchesPlainCodegen
protected abstract CodegenExpression evalMatchesPlainCodegen(CodegenMethodScope parent, ExprSubselectEvalMatchSymbol symbols, CodegenClassScope classScope) -
evalMatchesGetCollEventsCodegen
protected abstract CodegenExpression evalMatchesGetCollEventsCodegen(CodegenMethodScope parent, ExprSubselectEvalMatchSymbol symbols, CodegenClassScope classScope) -
evalMatchesGetCollScalarCodegen
protected abstract CodegenExpression evalMatchesGetCollScalarCodegen(CodegenMethodScope parent, ExprSubselectEvalMatchSymbol symbols, CodegenClassScope classScope) -
evalMatchesGetEventBeanCodegen
protected abstract CodegenExpression evalMatchesGetEventBeanCodegen(CodegenMethodScope parent, ExprSubselectEvalMatchSymbol symbols, CodegenClassScope classScope) -
evalMatchesTypableSingleCodegen
protected abstract CodegenExpression evalMatchesTypableSingleCodegen(CodegenMethodScope parent, ExprSubselectEvalMatchSymbol symbols, CodegenClassScope classScope) -
evalMatchesTypableMultiCodegen
protected abstract CodegenExpression evalMatchesTypableMultiCodegen(CodegenMethodScope parent, ExprSubselectEvalMatchSymbol symbols, CodegenClassScope classScope) -
getExprEvaluator
- Specified by:
getExprEvaluator
in interfaceExprForge
-
isConstantResult
public boolean isConstantResult() -
getForge
-
getForgeRenderable
- Specified by:
getForgeRenderable
in interfaceExprEnumerationForge
- Specified by:
getForgeRenderable
in interfaceExprForge
-
validate
- Specified by:
validate
in interfaceExprValidator
- Throws:
ExprValidationException
-
setStatementSpecCompiled
public void setStatementSpecCompiled(StatementSpecCompiled statementSpecCompiled, int subselectNumber) Supplies a compiled statement spec.- Parameters:
statementSpecCompiled
- compiled validated filterssubselectNumber
- subselect assigned number
-
getStatementSpecCompiled
Returns the compiled statement spec.- Returns:
- compiled statement
-
setSelectClause
Sets the validates select clause- Parameters:
selectClause
- is the expression representing the select clause
-
evaluate
public Object evaluate(EventBean[] eventsPerStream, boolean isNewData, ExprEvaluatorContext exprEvaluatorContext) Description copied from interface:ExprEvaluator
Evaluate event tuple and return result.- Specified by:
evaluate
in interfaceExprEvaluator
- Parameters:
eventsPerStream
- - event tupleisNewData
- - indicates whether we are dealing with new data (istream) or old data (rstream)exprEvaluatorContext
- context for expression evaluation- Returns:
- evaluation result, a boolean value for OR/AND-type evalution nodes.
-
evaluate
public Object evaluate(EventBean[] eventsPerStream, boolean isNewData, Collection<EventBean> matchingEvents, ExprEvaluatorContext exprEvaluatorContext) -
evaluateCodegenUninstrumented
public CodegenExpression evaluateCodegenUninstrumented(EPTypeClass requiredType, CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) - Specified by:
evaluateCodegenUninstrumented
in interfaceExprForgeInstrumentable
-
evaluateCodegen
public CodegenExpression evaluateCodegen(EPTypeClass requiredType, CodegenMethodScope parent, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) - Specified by:
evaluateCodegen
in interfaceExprForge
-
evaluateGetROCollectionEventsCodegen
public CodegenExpression evaluateGetROCollectionEventsCodegen(CodegenMethodScope parent, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) - Specified by:
evaluateGetROCollectionEventsCodegen
in interfaceExprEnumerationForge
-
evaluateGetROCollectionScalarCodegen
public CodegenExpression evaluateGetROCollectionScalarCodegen(CodegenMethodScope parent, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) - Specified by:
evaluateGetROCollectionScalarCodegen
in interfaceExprEnumerationForge
-
evaluateGetEventBeanCodegen
public CodegenExpression evaluateGetEventBeanCodegen(CodegenMethodScope parent, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) - Specified by:
evaluateGetEventBeanCodegen
in interfaceExprEnumerationForge
-
evaluateTypableSingleCodegen
public CodegenExpression evaluateTypableSingleCodegen(CodegenMethodScope codegenMethodScope, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) - Specified by:
evaluateTypableSingleCodegen
in interfaceExprTypableReturnForge
-
evaluateTypableMultiCodegen
public CodegenExpression evaluateTypableMultiCodegen(CodegenMethodScope parent, ExprForgeCodegenSymbol exprSymbol, CodegenClassScope codegenClassScope) - Specified by:
evaluateTypableMultiCodegen
in interfaceExprTypableReturnForge
-
getForgeConstantType
- Specified by:
getForgeConstantType
in interfaceExprForge
-
getRowProperties
Description copied from interface:ExprTypableReturnForge
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.- Specified by:
getRowProperties
in interfaceExprTypableReturnForge
- Returns:
- map of property names and types or null
- Throws:
ExprValidationException
- if the expression is invalid
-
isMultirow
Description copied from interface:ExprTypableReturnForge
Return true for multi-row return, return false for return of single row only- Specified by:
isMultirow
in interfaceExprTypableReturnForge
- Returns:
- multi-row flag
-
getStatementSpecRaw
Returns the uncompiled statement spec.- Returns:
- statement spec uncompiled
-
setSelectAsNames
Supplies the name of the select expression as-tag- Parameters:
selectAsNames
- is the as-name(s)
-
setFilterExpr
Sets the validated filter expression, or null if there is none.- Parameters:
filterExpr
- is the filter
-
setHavingExpr
-
toPrecedenceFreeEPL
- Specified by:
toPrecedenceFreeEPL
in classExprNodeBase
-
getPrecedence
Description copied from interface:ExprNode
Returns precedence.- Specified by:
getPrecedence
in interfaceExprNode
- Returns:
- precedence
-
equalsNode
Description copied from interface: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 interfaceExprNode
- Parameters:
node
- to compare toignoreStreamPrefix
- when the equals-comparison can ignore prefix of event properties- Returns:
- true if semantically equal, or false if not equals
-
setRawEventType
Sets the event type generated for wildcard selects.- Parameters:
rawEventType
- is the wildcard type (parent view)
-
getSelectClause
Returns the select clause or null if none.- Returns:
- clause
-
getRawEventType
Returns the event type.- Returns:
- type
-
getFilterSubqueryStreamTypes
Return stream types.- Returns:
- types
-
setFilterSubqueryStreamTypes
Set stream types.- Parameters:
filterSubqueryStreamTypes
- types
-
getSubselectAggregationType
-
setSubselectAggregationType
public void setSubselectAggregationType(ExprSubselectNode.SubqueryAggregationType subselectAggregationType) -
getSubselectNumber
public int getSubselectNumber() -
setFilterStreamSubselect
public void setFilterStreamSubselect(boolean filterStreamSubselect) -
isFilterStreamSubselect
public boolean isFilterStreamSubselect() -
getExprEvaluatorEnumeration
- Specified by:
getExprEvaluatorEnumeration
in interfaceExprEnumerationForge
-
getFilterStreamExprValidationContext
-
toArray
-