public class AggregateCall extends Object
LogicalAggregate.| Modifier and Type | Field and Description |
|---|---|
private SqlAggFunction |
aggFunction |
private boolean |
approximate |
private com.google.common.collect.ImmutableList<Integer> |
argList |
private boolean |
distinct |
int |
filterArg |
String |
name |
RelDataType |
type |
| Modifier | Constructor and Description |
|---|---|
private |
AggregateCall(SqlAggFunction aggFunction,
boolean distinct,
boolean approximate,
List<Integer> argList,
int filterArg,
RelDataType type,
String name)
Creates an AggregateCall.
|
|
AggregateCall(SqlAggFunction aggFunction,
boolean distinct,
List<Integer> argList,
RelDataType type,
String name)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
AggregateCall |
adaptTo(RelNode input,
List<Integer> argList,
int filterArg,
int oldGroupKeyCount,
int newGroupKeyCount)
Creates equivalent AggregateCall that is adapted to a new input types
and/or number of columns in GROUP BY.
|
AggregateCall |
copy(List<Integer> args)
Deprecated.
|
AggregateCall |
copy(List<Integer> args,
int filterArg)
Creates an equivalent AggregateCall with new argument ordinals.
|
static AggregateCall |
create(SqlAggFunction aggFunction,
boolean distinct,
boolean approximate,
List<Integer> argList,
int filterArg,
int groupCount,
RelNode input,
RelDataType type,
String name)
Creates an AggregateCall, inferring its type if
type is null. |
static AggregateCall |
create(SqlAggFunction aggFunction,
boolean distinct,
boolean approximate,
List<Integer> argList,
int filterArg,
RelDataType type,
String name)
Creates an AggregateCall.
|
static AggregateCall |
create(SqlAggFunction aggFunction,
boolean distinct,
List<Integer> argList,
int filterArg,
int groupCount,
RelNode input,
RelDataType type,
String name)
Deprecated.
|
static AggregateCall |
create(SqlAggFunction aggFunction,
boolean distinct,
List<Integer> argList,
int filterArg,
RelDataType type,
String name)
Deprecated.
|
static AggregateCall |
create(SqlAggFunction aggFunction,
boolean distinct,
List<Integer> argList,
int groupCount,
RelNode input,
RelDataType type,
String name)
Deprecated.
|
Aggregate.AggCallBinding |
createBinding(Aggregate aggregateRelBase)
Creates a binding of this call in the context of an
LogicalAggregate,
which can then be used to infer the return type. |
boolean |
equals(Object o) |
SqlAggFunction |
getAggregation()
Returns the aggregate function.
|
List<Integer> |
getArgList()
Returns the ordinals of the arguments to this call.
|
String |
getName()
Returns the name.
|
RelDataType |
getType()
Returns the result type.
|
boolean |
hasFilter()
Returns true if and only if this AggregateCall has a filter argument
|
int |
hashCode() |
boolean |
isApproximate()
Returns whether this AggregateCall is approximate, as in
APPROX_COUNT_DISTINCT(empno). |
boolean |
isDistinct()
Returns whether this AggregateCall is distinct, as in
COUNT(DISTINCT empno). |
AggregateCall |
rename(String name)
Creates an equivalent AggregateCall that has a new name.
|
String |
toString() |
AggregateCall |
transform(Mappings.TargetMapping mapping)
Creates a copy of this aggregate call, applying a mapping to its
arguments.
|
private final SqlAggFunction aggFunction
private final boolean distinct
private final boolean approximate
public final RelDataType type
public final String name
private final com.google.common.collect.ImmutableList<Integer> argList
public final int filterArg
@Deprecated public AggregateCall(SqlAggFunction aggFunction, boolean distinct, List<Integer> argList, RelDataType type, String name)
aggFunction - Aggregate functiondistinct - Whether distinctargList - List of ordinals of argumentstype - Result typename - Name (may be null)private AggregateCall(SqlAggFunction aggFunction, boolean distinct, boolean approximate, List<Integer> argList, int filterArg, RelDataType type, String name)
aggFunction - Aggregate functiondistinct - Whether distinctapproximate - Whether approximateargList - List of ordinals of argumentsfilterArg - Ordinal of filter argument, or -1type - Result typename - Name (may be null)@Deprecated public static AggregateCall create(SqlAggFunction aggFunction, boolean distinct, List<Integer> argList, int groupCount, RelNode input, RelDataType type, String name)
@Deprecated public static AggregateCall create(SqlAggFunction aggFunction, boolean distinct, List<Integer> argList, int filterArg, int groupCount, RelNode input, RelDataType type, String name)
public static AggregateCall create(SqlAggFunction aggFunction, boolean distinct, boolean approximate, List<Integer> argList, int filterArg, int groupCount, RelNode input, RelDataType type, String name)
type is null.@Deprecated public static AggregateCall create(SqlAggFunction aggFunction, boolean distinct, List<Integer> argList, int filterArg, RelDataType type, String name)
public static AggregateCall create(SqlAggFunction aggFunction, boolean distinct, boolean approximate, List<Integer> argList, int filterArg, RelDataType type, String name)
public final boolean isDistinct()
COUNT(DISTINCT empno).public final boolean isApproximate()
APPROX_COUNT_DISTINCT(empno).public final SqlAggFunction getAggregation()
public final List<Integer> getArgList()
The list is immutable.
public final RelDataType getType()
public String getName()
public AggregateCall rename(String name)
name - New name (may be null)public boolean hasFilter()
public Aggregate.AggCallBinding createBinding(Aggregate aggregateRelBase)
LogicalAggregate,
which can then be used to infer the return type.public AggregateCall copy(List<Integer> args, int filterArg)
args - Arguments@Deprecated public AggregateCall copy(List<Integer> args)
public AggregateCall adaptTo(RelNode input, List<Integer> argList, int filterArg, int oldGroupKeyCount, int newGroupKeyCount)
input - relation that will be used as a child of aggregateargList - argument indices of the new call in the inputfilterArg - Index of the filter, or -1oldGroupKeyCount - number of columns in GROUP BY of old aggregatenewGroupKeyCount - number of columns in GROUP BY of new aggregatepublic AggregateCall transform(Mappings.TargetMapping mapping)
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.