Package org.teiid.language
Class AggregateFunction
- java.lang.Object
-
- org.teiid.language.BaseLanguageObject
-
- org.teiid.language.Function
-
- org.teiid.language.AggregateFunction
-
- All Implemented Interfaces:
Expression
,LanguageObject
,MetadataReference<FunctionMethod>
public class AggregateFunction extends Function
Represents an aggregate function.
-
-
Constructor Summary
Constructors Constructor Description AggregateFunction(String aggName, boolean isDistinct, List<? extends Expression> params, Class<?> type)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
acceptVisitor(LanguageObjectVisitor visitor)
Expression
getCondition()
Expression
getExpression()
Deprecated.String
getName()
Get the name of the aggregate function.OrderBy
getOrderBy()
boolean
isDistinct()
Determine whether this function was executed with DISTINCT.void
setCondition(Expression condition)
void
setDistinct(boolean isDistinct)
Set whether this function was executed with DISTINCT.void
setName(String name)
Set the name of the aggregate function.void
setOrderBy(OrderBy orderBy)
-
Methods inherited from class org.teiid.language.Function
getMetadataObject, getParameters, getType, setMetadataObject, setType
-
Methods inherited from class org.teiid.language.BaseLanguageObject
toString
-
-
-
-
Field Detail
-
COUNT
public static final String COUNT
- See Also:
- Constant Field Values
-
AVG
public static final String AVG
- See Also:
- Constant Field Values
-
SUM
public static final String SUM
- See Also:
- Constant Field Values
-
MIN
public static final String MIN
- See Also:
- Constant Field Values
-
MAX
public static final String MAX
- See Also:
- Constant Field Values
-
STDDEV_POP
public static final String STDDEV_POP
- See Also:
- Constant Field Values
-
STDDEV_SAMP
public static final String STDDEV_SAMP
- See Also:
- Constant Field Values
-
VAR_SAMP
public static final String VAR_SAMP
- See Also:
- Constant Field Values
-
VAR_POP
public static final String VAR_POP
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AggregateFunction
public AggregateFunction(String aggName, boolean isDistinct, List<? extends Expression> params, Class<?> type)
-
-
Method Detail
-
getName
public String getName()
Get the name of the aggregate function. This will be one of the constants defined in this class.
-
isDistinct
public boolean isDistinct()
Determine whether this function was executed with DISTINCT. Executing with DISTINCT will remove all duplicate values in a group when evaluating the aggregate function.- Returns:
- True if DISTINCT mode is used
-
getExpression
public Expression getExpression()
Deprecated.Get the expression within the aggregate function. The expression will be null for the special case COUNT(*). This is the only case where the expression will be null Only valid for 0/1 ary aggregates- Returns:
- The expression or null for COUNT(*)
-
acceptVisitor
public void acceptVisitor(LanguageObjectVisitor visitor)
- Specified by:
acceptVisitor
in interfaceLanguageObject
- Overrides:
acceptVisitor
in classFunction
-
setName
public void setName(String name)
Set the name of the aggregate function. This will be one of the constants defined in this class.
-
setDistinct
public void setDistinct(boolean isDistinct)
Set whether this function was executed with DISTINCT. Executing with DISTINCT will remove all duplicate values in a group when evaluating the aggregate function.- Parameters:
isDistinct
- True if DISTINCT mode should be used
-
getCondition
public Expression getCondition()
- Returns:
- the filter clause condition
-
setCondition
public void setCondition(Expression condition)
-
getOrderBy
public OrderBy getOrderBy()
-
setOrderBy
public void setOrderBy(OrderBy orderBy)
-
-