Information necessary to create a call to an aggregate function. @see RelBuilder#aggregateCall
| 4331 | * |
| 4332 | * @see RelBuilder#aggregateCall */ |
| 4333 | public interface AggCall { |
| 4334 | SqlParserPos getPosition(); |
| 4335 | |
| 4336 | /** Returns a copy of this AggCall that applies a filter before aggregating |
| 4337 | * values. */ |
| 4338 | AggCall filter(@Nullable RexNode condition); |
| 4339 | |
| 4340 | /** Returns a copy of this AggCall that sorts its input values by |
| 4341 | * {@code orderKeys} before aggregating, as in SQL's {@code WITHIN GROUP} |
| 4342 | * clause. */ |
| 4343 | AggCall sort(Iterable<RexNode> orderKeys); |
| 4344 | |
| 4345 | /** Returns a copy of this AggCall that sorts its input values by |
| 4346 | * {@code orderKeys} before aggregating, as in SQL's {@code WITHIN GROUP} |
| 4347 | * clause. */ |
| 4348 | default AggCall sort(RexNode... orderKeys) { |
| 4349 | return sort(ImmutableList.copyOf(orderKeys)); |
| 4350 | } |
| 4351 | |
| 4352 | /** Returns a copy of this AggCall with the given pre-operands. |
| 4353 | * |
| 4354 | * <p>Pre-operands apply at the start of aggregation and are constant for |
| 4355 | * the whole query. They do not reference input columns and are typically |
| 4356 | * {@link RexLiteral}. An example is |
| 4357 | * {@link org.apache.calcite.sql.fun.SqlInternalOperators#LITERAL_AGG}; |
| 4358 | * most aggregate functions do not take pre-operands. */ |
| 4359 | AggCall preOperands(Iterable<? extends RexNode> preOperands); |
| 4360 | |
| 4361 | default AggCall preOperands(RexNode... preOperands) { |
| 4362 | return preOperands(ImmutableList.copyOf(preOperands)); |
| 4363 | } |
| 4364 | |
| 4365 | /** Returns a copy of this AggCall that makes its input values unique by |
| 4366 | * {@code distinctKeys} before aggregating, as in SQL's |
| 4367 | * {@code WITHIN DISTINCT} clause. */ |
| 4368 | AggCall unique(@Nullable Iterable<RexNode> distinctKeys); |
| 4369 | |
| 4370 | /** Returns a copy of this AggCall that makes its input values unique by |
| 4371 | * {@code distinctKeys} before aggregating, as in SQL's |
| 4372 | * {@code WITHIN DISTINCT} clause. */ |
| 4373 | default AggCall unique(RexNode... distinctKeys) { |
| 4374 | return unique(ImmutableList.copyOf(distinctKeys)); |
| 4375 | } |
| 4376 | |
| 4377 | /** Returns a copy of this AggCall that may return approximate results |
| 4378 | * if {@code approximate} is true. */ |
| 4379 | AggCall approximate(boolean approximate); |
| 4380 | |
| 4381 | /** Returns a copy of this AggCall that ignores nulls. */ |
| 4382 | AggCall ignoreNulls(boolean ignoreNulls); |
| 4383 | |
| 4384 | /** Returns a copy of this AggCall with a given alias. */ |
| 4385 | AggCall as(@Nullable String alias); |
| 4386 | |
| 4387 | /** Returns a copy of this AggCall that is optionally distinct. */ |
| 4388 | AggCall distinct(boolean distinct); |
| 4389 | |
| 4390 | /** Returns a copy of this AggCall that is distinct. */ |
no outgoing calls
no test coverage detected