Visitable
class AggregateNode extends UnaryOperatorNode
Modifier and Type | Class | Description |
---|---|---|
(package private) static class |
AggregateNode.BuiltinAggDescriptor |
Modifier and Type | Field | Description |
---|---|---|
private java.lang.Class<?> |
aggregateDefinitionClass |
|
private java.lang.String |
aggregateDefinitionClassName |
|
private java.lang.String |
aggregateName |
|
private java.lang.StringBuffer |
aggregatorClassName |
|
private static AggregateNode.BuiltinAggDescriptor[] |
BUILTIN_MODERN_AGGS |
|
private ClassInspector |
classInspector |
|
private boolean |
distinct |
|
private ResultColumn |
generatedRC |
|
private ColumnReference |
generatedRef |
|
private AggregateDefinition |
uad |
|
private TableName |
userAggregateName |
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_CYCLE, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX
K_BASE, K_XMLPARSE, K_XMLSERIALIZE, kind, methodName, operand, operator, receiverInterfaceType, resultInterfaceType, UnaryArgTypes, UnaryMethodNames, UnaryOperators, UnaryResultTypes
transformed
Constructor | Description |
---|---|
AggregateNode(ValueNode operand,
java.lang.Class<?> uadClass,
boolean distinct,
java.lang.String aggregateName,
ContextManager cm) |
|
AggregateNode(ValueNode operand,
TableName uadClass,
boolean distinct,
java.lang.String aggregateName,
ContextManager cm) |
|
AggregateNode(ValueNode operand,
UserAggregateDefinition uadClass,
TableName alias,
boolean distinct,
java.lang.String aggregateName,
ContextManager cm) |
Constructed when binding a StaticMethodNode that we realize is
an aggregate.
|
Modifier and Type | Method | Description |
---|---|---|
(package private) void |
acceptChildren(Visitor v) |
Accept the visitor for all visitable children of this node.
|
(package private) ValueNode |
bindExpression(FromList fromList,
SubqueryList subqueryList,
java.util.List<AggregateNode> aggregates) |
Bind this operator.
|
private void |
checkAggregatorClassName(java.lang.String className) |
|
(package private) boolean |
constantExpression(PredicateList where) |
Return whether or not this expression tree represents a constant value.
|
(package private) void |
generateExpression(ExpressionClassBuilder acb,
MethodBuilder mb) |
Do code generation for this unary operator.
|
(package private) AggregateDefinition |
getAggregateDefinition() |
Get the AggregateDefinition.
|
(package private) java.lang.String |
getAggregateName() |
Get the class that implements that aggregator for this
node.
|
(package private) java.lang.String |
getAggregatorClassName() |
Get the class that implements that aggregator for this
node.
|
(package private) ResultColumn |
getGeneratedRC() |
Get the generated ResultColumn where this
aggregate now resides after a call to
replaceAggregatesWithColumnReference().
|
(package private) ColumnReference |
getGeneratedRef() |
Get the generated ColumnReference to this
aggregate after the parent called
replaceAggregatesWithColumnReference().
|
(package private) ResultColumn |
getNewAggregatorResultColumn(DataDictionary dd) |
Get the result column that has a new aggregator.
|
(package private) ResultColumn |
getNewExpressionResultColumn(DataDictionary dd) |
Get the aggregate expression in a new result
column.
|
(package private) ValueNode |
getNewNullResultExpression() |
Get the null aggregate result expression
column.
|
java.lang.String |
getSQLName() |
Get the SQL name of the aggregate
|
private void |
instantiateAggDef() |
|
(package private) boolean |
isConstant() |
|
(package private) boolean |
isDistinct() |
Indicate whether this aggregate is distinct or not.
|
private boolean |
isUserDefinedAggregate() |
Return true if this is a user-defined aggregate
|
(package private) ValueNode |
replaceAggregatesWithColumnReferences(ResultColumnList rcl,
int tableNumber) |
Replace aggregates in the expression tree with a ColumnReference to
that aggregate, append the aggregate to the supplied RCL (assumed to
be from the child ResultSetNode) and return the ColumnReference.
|
(package private) static AliasDescriptor |
resolveAggregate(DataDictionary dd,
SchemaDescriptor sd,
java.lang.String rawName,
boolean noSchema) |
Resolve a user-defined aggregate.
|
private static AliasDescriptor |
resolveBuiltinAggregate(DataDictionary dd,
java.lang.String rawName,
boolean noSchema) |
Construct an AliasDescriptor for a modern builtin aggregate.
|
private void |
setUserDefinedAggregate(UserAggregateDefinition userAgg) |
initialize fields for user defined aggregate
|
java.lang.String |
toString() |
Print a string ref of this node.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
pushSqlXmlUtil
accept, addTag, addUDTUsagePriv, addUDTUsagePriv, bindOffsetFetch, bindRowMultiSet, bindUserCatalogType, bindUserType, checkReliability, checkReliability, convertDefaultNode, copyTagsFrom, createTypeDependency, debugFlush, debugPrint, disablePrivilegeCollection, formatNodeString, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContext, getContextManager, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getLongProperty, getNullNode, getOffsetOrderedNodes, getOptimizerFactory, getOptimizerTracer, getParameterTypes, getSchemaDescriptor, getSchemaDescriptor, getStatementType, getTableDescriptor, getTypeCompiler, getUDTDesc, isAtomic, isPrivilegeCollectionRequired, isSessionSchema, isSessionSchema, makeConstantAction, makeTableName, makeTableName, nodeHeader, optimizerTracingIsOn, orReliability, parseSearchCondition, parseStatement, printLabel, referencesSessionSchema, resolveTableToSynonym, setBeginOffset, setEndOffset, setRefActionInfo, stackPrint, taggedWith, treePrint, treePrint, verifyClassExist
addXmlOpMethodParams, bindOperand, bindParameter, categorize, getOperand, getOperatorString, getOrderableVariantType, getParameterOperand, getReceiverInterfaceName, isConstantExpression, isEquivalent, isSameNodeKind, preprocess, printSubNodes, remapColumnReferencesToExpressions, setMethodName, setOperator
bindExpression, changeToCNF, checkIsBoolean, checkTopPredicatesForEqualsConditions, copyFields, eliminateNots, evaluateConstantExpressions, genEqualsFalseTree, generate, genIsNullTree, genSQLJavaSQLTree, getClone, getColumnName, getConstantValueAsObject, getDataValueFactory, getSchemaName, getSourceResultColumn, getTableName, getTablesReferenced, getTransformed, getTypeCompiler, getTypeId, getTypeServices, isBinaryEqualsOperatorNode, isBooleanFalse, isBooleanTrue, isCloneable, isInListProbeNode, isParameterNode, isRelationalOperator, optimizableEqualityNode, putAndsOnTop, requiresTypeFromContext, selectivity, setCollationInfo, setCollationInfo, setCollationUsingCompilationSchema, setCollationUsingCompilationSchema, setNullability, setTransformed, setType, setType, setType, updatableByCursor, verifyChangeToCNF, verifyEliminateNots, verifyPutAndsOnTop
private static AggregateNode.BuiltinAggDescriptor[] BUILTIN_MODERN_AGGS
private boolean distinct
private AggregateDefinition uad
private TableName userAggregateName
private java.lang.StringBuffer aggregatorClassName
private java.lang.String aggregateDefinitionClassName
private java.lang.Class<?> aggregateDefinitionClass
private ClassInspector classInspector
private java.lang.String aggregateName
private ResultColumn generatedRC
private ColumnReference generatedRef
AggregateNode(ValueNode operand, UserAggregateDefinition uadClass, TableName alias, boolean distinct, java.lang.String aggregateName, ContextManager cm) throws StandardException
operand
- the value expression for the aggregateuadClass
- the class of the user aggregate definitionalias
- the name by which the aggregate was calleddistinct
- boolean indicating whether this is distinct
or not.aggregateName
- the name of the aggregate from the user's
perspective, e.g. MAXcm
- context managerStandardException
AggregateNode(ValueNode operand, TableName uadClass, boolean distinct, java.lang.String aggregateName, ContextManager cm) throws StandardException
operand
- the value expression for the aggregateuadClass
- the class name for user aggregate definition
for the aggregatedistinct
- boolean indicating whether this is distinct
or not.aggregateName
- the name of the aggregate from the user's
perspective, e.g. MAXcm
- context managerStandardException
AggregateNode(ValueNode operand, java.lang.Class<?> uadClass, boolean distinct, java.lang.String aggregateName, ContextManager cm) throws StandardException
operand
- the value expression for the aggregateuadClass
- Class for the internal aggregate typedistinct
- boolean indicating whether this is distinct
or not.aggregateName
- the name of the aggregate from the user's
perspective, e.g. MAXcm
- context managerStandardException
private void setUserDefinedAggregate(UserAggregateDefinition userAgg)
ValueNode replaceAggregatesWithColumnReferences(ResultColumnList rcl, int tableNumber) throws StandardException
rcl
- The RCL to append to.tableNumber
- The tableNumber for the new ColumnReferenceStandardException
- Thrown on errorAggregateDefinition getAggregateDefinition()
ResultColumn getGeneratedRC()
ColumnReference getGeneratedRef()
ValueNode bindExpression(FromList fromList, SubqueryList subqueryList, java.util.List<AggregateNode> aggregates) throws StandardException
bindExpression
in class UnaryOperatorNode
fromList
- The query's FROM listsubqueryList
- The subquery list being built as we find SubqueryNodesaggregates
- The aggregate list being built as we find AggregateNodesStandardException
- Thrown on errorstatic AliasDescriptor resolveAggregate(DataDictionary dd, SchemaDescriptor sd, java.lang.String rawName, boolean noSchema) throws StandardException
StandardException
private static AliasDescriptor resolveBuiltinAggregate(DataDictionary dd, java.lang.String rawName, boolean noSchema) throws StandardException
StandardException
private void checkAggregatorClassName(java.lang.String className) throws StandardException
StandardException
private void instantiateAggDef() throws StandardException
StandardException
boolean isDistinct()
java.lang.String getAggregatorClassName()
java.lang.String getAggregateName()
ResultColumn getNewAggregatorResultColumn(DataDictionary dd) throws StandardException
dd
- the data dictionaryStandardException
- on errorResultColumn getNewExpressionResultColumn(DataDictionary dd) throws StandardException
dd
- the data dictionaryStandardException
- on errorValueNode getNewNullResultExpression() throws StandardException
StandardException
- on errorvoid generateExpression(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException
generateExpression
in class UnaryOperatorNode
acb
- The ExpressionClassBuilder for the class we're generatingmb
- The method the code to place the codeStandardException
- Thrown on errorpublic java.lang.String toString()
toString
in class UnaryOperatorNode
boolean isConstant()
boolean constantExpression(PredicateList where)
ValueNode
constantExpression
in class UnaryOperatorNode
ValueNode.constantExpression(org.apache.derby.impl.sql.compile.PredicateList)
public java.lang.String getSQLName()
private boolean isUserDefinedAggregate()
void acceptChildren(Visitor v) throws StandardException
UnaryOperatorNode
acceptChildren
in class UnaryOperatorNode
v
- the visitorStandardException
- on errorApache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.