public class AggregateSymbol extends Function implements DerivedExpression
An aggregate symbol represents an aggregate function. The * expression is encoded by setting the expression to null. This may ONLY be used with the COUNT function.
The type of an aggregate symbol depends on the function and the type of the underlying expression. The type of a COUNT function is ALWAYS integer. MIN and MAX functions take the type of their contained expression.
Modifier and Type | Class and Description |
---|---|
static class |
AggregateSymbol.Type |
LanguageObject.Util
Modifier and Type | Field and Description |
---|---|
static boolean |
LONG_RANKS |
Modifier | Constructor and Description |
---|---|
protected |
AggregateSymbol(String name,
AggregateSymbol.Type aggregateFunction,
boolean isDistinct,
Expression[] args)
Constructor used for cloning
|
|
AggregateSymbol(String aggregateFunction,
boolean isDistinct,
Expression expression)
Construct an aggregate symbol with all given data.
|
|
AggregateSymbol(String aggregateFunction,
boolean isDistinct,
Expression[] args,
OrderBy orderBy) |
Modifier and Type | Method and Description |
---|---|
void |
acceptVisitor(LanguageVisitor visitor)
Method for accepting a visitor.
|
static boolean |
areAggregatesCardinalityDependent(Collection<AggregateSymbol> aggs) |
boolean |
canStage() |
Object |
clone()
Return a deep copy of this object
|
boolean |
equals(Object obj)
Compare for equality
|
AggregateSymbol.Type |
getAggregateFunction()
Get the aggregate function type - this will map to one of the reserved words
for the aggregate functions.
|
Expression |
getCondition() |
OrderBy |
getOrderBy() |
Class<?> |
getType()
Get the type of the symbol, which depends on the aggregate function and the
type of the contained expression
|
int |
hashCode()
Compute hash code for the object - based on name and hashcode of first arg (if there is one)
|
boolean |
isAnalytical() |
boolean |
isBoolean() |
boolean |
isCardinalityDependent() |
boolean |
isCount() |
boolean |
isDistinct()
Get the distinct flag.
|
boolean |
isEnhancedNumeric() |
boolean |
isRanking() |
boolean |
isRowValueFunction() |
boolean |
isWindowed() |
boolean |
respectsNulls() |
void |
setAggregateFunction(AggregateSymbol.Type aggregateFunction)
Set the aggregate function.
|
void |
setCondition(Expression condition) |
void |
setDistinct(boolean distinct) |
void |
setOrderBy(OrderBy orderBy) |
void |
setWindowed(boolean isWindowed) |
getArg, getArgs, getFunctionDescriptor, getName, insertConversion, isAggregate, isEval, isImplicit, makeImplicit, setArgs, setEval, setFunctionDescriptor, setImplicit, setName, setType, toString
protected AggregateSymbol(String name, AggregateSymbol.Type aggregateFunction, boolean isDistinct, Expression[] args)
name
- canonicalName
- public AggregateSymbol(String aggregateFunction, boolean isDistinct, Expression expression)
aggregateFunction
- Aggregate function type (SQLConstants.NonReserved.COUNT
, etc)isDistinct
- True if DISTINCT flag is setexpression
- Contained expressionpublic AggregateSymbol(String aggregateFunction, boolean isDistinct, Expression[] args, OrderBy orderBy)
public void setAggregateFunction(AggregateSymbol.Type aggregateFunction)
aggregateFunction
- Aggregate function typeSQLConstants.NonReserved.COUNT
,
SQLConstants.NonReserved.SUM
,
SQLConstants.NonReserved.AVG
,
SQLConstants.NonReserved.MIN
,
SQLConstants.NonReserved.MAX
public AggregateSymbol.Type getAggregateFunction()
public boolean isRowValueFunction()
public boolean isDistinct()
public void setDistinct(boolean distinct)
public Class<?> getType()
getType
in interface Expression
getType
in class Function
public boolean isRanking()
public boolean isCount()
public boolean isAnalytical()
public boolean isBoolean()
public boolean isEnhancedNumeric()
public void acceptVisitor(LanguageVisitor visitor)
LanguageObject
acceptVisitor
in interface LanguageObject
acceptVisitor
in class Function
visitor
- Visitor being usedpublic OrderBy getOrderBy()
public void setOrderBy(OrderBy orderBy)
public Object clone()
clone
in interface LanguageObject
clone
in class Function
public int hashCode()
Function
hashCode
in class Function
ExpressionSymbol.hashCode()
public boolean equals(Object obj)
Function
equals
in class Function
obj
- Other object to compareExpressionSymbol.equals(java.lang.Object)
public boolean isCardinalityDependent()
public Expression getCondition()
public void setCondition(Expression condition)
public static boolean areAggregatesCardinalityDependent(Collection<AggregateSymbol> aggs)
public boolean respectsNulls()
public boolean canStage()
public boolean isWindowed()
public void setWindowed(boolean isWindowed)
Copyright © 2018 JBoss by Red Hat. All rights reserved.