|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.teiid.query.sql.symbol.Symbol
org.teiid.query.sql.symbol.SingleElementSymbol
org.teiid.query.sql.symbol.ExpressionSymbol
org.teiid.query.sql.symbol.AggregateSymbol
public class AggregateSymbol
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. AVG and SUM vary depending on the type of the expression. If the expression is of a type other than biginteger, the aggregate function returns type long. For the case of biginteger, the aggregate function returns type biginteger. Similarly, all floating point expressions not of type bigdecimal return type double and bigdecimal maps to bigdecimal.
Nested Class Summary | |
---|---|
static class |
AggregateSymbol.Type
|
Nested classes/interfaces inherited from interface org.teiid.query.sql.LanguageObject |
---|
LanguageObject.Util |
Field Summary |
---|
Fields inherited from class org.teiid.query.sql.symbol.SingleElementSymbol |
---|
SEPARATOR |
Fields inherited from class org.teiid.query.sql.symbol.Symbol |
---|
outputName |
Constructor Summary | |
---|---|
protected |
AggregateSymbol(String name,
String canonicalName,
AggregateSymbol.Type aggregateFunction,
boolean isDistinct,
Expression expression)
Constructor used for cloning |
|
AggregateSymbol(String name,
String aggregateFunction,
boolean isDistinct,
Expression expression)
Construct an aggregate symbol with all given data. |
Method Summary | |
---|---|
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)
ExpressionSymbol matching is not based upon the name |
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()
Return a hash code for this symbol. |
boolean |
isAnalytical()
|
boolean |
isBoolean()
|
boolean |
isCardinalityDependent()
|
boolean |
isDistinct()
Get the distinct flag. |
boolean |
isEnhancedNumeric()
|
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)
|
Methods inherited from class org.teiid.query.sql.symbol.ExpressionSymbol |
---|
getExpression, isResolved, setExpression |
Methods inherited from class org.teiid.query.sql.symbol.SingleElementSymbol |
---|
getShortName |
Methods inherited from class org.teiid.query.sql.symbol.Symbol |
---|
getCanonical, getCanonicalName, getName, getOutputName, getShortCanonicalName, getShortName, setName, setOutputName, setShortCanonicalName, setShortName, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected AggregateSymbol(String name, String canonicalName, AggregateSymbol.Type aggregateFunction, boolean isDistinct, Expression expression)
name
- canonicalName
- public AggregateSymbol(String name, String aggregateFunction, boolean isDistinct, Expression expression)
name
- Name of the functionaggregateFunction
- Aggregate function type (SQLConstants.NonReserved.COUNT
, etc)isDistinct
- True if DISTINCT flag is setexpression
- Contained expressionMethod Detail |
---|
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 isDistinct()
public void setDistinct(boolean distinct)
public Class<?> getType()
getType
in interface Expression
getType
in class ExpressionSymbol
public boolean isAnalytical()
public boolean isBoolean()
public boolean isEnhancedNumeric()
public void acceptVisitor(LanguageVisitor visitor)
LanguageObject
acceptVisitor
in interface LanguageObject
acceptVisitor
in class ExpressionSymbol
visitor
- Visitor being usedpublic OrderBy getOrderBy()
public void setOrderBy(OrderBy orderBy)
public Object clone()
clone
in interface LanguageObject
clone
in class ExpressionSymbol
public int hashCode()
Symbol
hashCode
in class ExpressionSymbol
ExpressionSymbol.hashCode()
public boolean equals(Object obj)
ExpressionSymbol
equals
in class ExpressionSymbol
obj
- Other object
ExpressionSymbol.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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |