public class AggregatingSelectScope extends DelegatingScope implements AggregatingScope
The same set of identifiers are in scope, but it won't allow access to identifiers or expressions which are not group-expressions.
Modifier and Type | Class and Description |
---|---|
class |
AggregatingSelectScope.Resolved
Information about an aggregating scope that can only be determined
after validation has occurred.
|
SqlValidatorScope.EmptyPath, SqlValidatorScope.Path, SqlValidatorScope.Resolve, SqlValidatorScope.ResolvedImpl, SqlValidatorScope.Step
Modifier and Type | Field and Description |
---|---|
private boolean |
distinct |
java.util.function.Supplier<AggregatingSelectScope.Resolved> |
resolved |
private SqlSelect |
select |
private java.util.List<SqlNode> |
temporaryGroupExprList
Use while under construction.
|
parent, validator
Constructor and Description |
---|
AggregatingSelectScope(SqlValidatorScope selectScope,
SqlSelect select,
boolean distinct)
Creates an AggregatingSelectScope
|
Modifier and Type | Method and Description |
---|---|
private static boolean |
allContain(java.util.List<ImmutableBitSet> bitSets,
int bit) |
boolean |
checkAggregateExpr(SqlNode expr,
boolean deep)
Checks whether an expression is constant within the GROUP BY clause.
|
private Pair<com.google.common.collect.ImmutableList<SqlNode>,com.google.common.collect.ImmutableList<SqlNode>> |
getGroupExprs()
Returns the expressions that are in the GROUP BY clause (or the SELECT
DISTINCT clause, if distinct) and that can therefore be referenced
without being wrapped in aggregate functions.
|
SqlNode |
getNode()
Returns the root node of this scope.
|
SqlValidatorScope |
getOperandScope(SqlCall call)
Returns the scope within which operands to a call are to be validated.
|
RelDataType |
nullifyType(SqlNode node,
RelDataType type)
Converts the type of an expression to nullable, if the context
warrants it.
|
private AggregatingSelectScope.Resolved |
resolve() |
void |
validateExpr(SqlNode expr)
Performs any scope-specific validation of an expression.
|
addChild, addColumnNames, findAliases, findAllColumnNames, findQualifyingTableName, findQualifyingTableNames, fullyQualify, getMonotonicity, getOrderList, getParent, getTableNamespace, getValidator, lookupWindow, resolve, resolveColumn, resolveInNamespace, resolveTable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addChild, findAliases, findAllColumnNames, findQualifyingTableName, findQualifyingTableNames, fullyQualify, getMonotonicity, getOrderList, getTableNamespace, getValidator, isWithin, lookupWindow, resolve, resolveColumn, resolveTable
private final SqlSelect select
private final boolean distinct
private java.util.List<SqlNode> temporaryGroupExprList
public final java.util.function.Supplier<AggregatingSelectScope.Resolved> resolved
AggregatingSelectScope(SqlValidatorScope selectScope, SqlSelect select, boolean distinct)
selectScope
- Parent scopeselect
- Enclosing SELECT nodedistinct
- Whether SELECT is DISTINCTprivate AggregatingSelectScope.Resolved resolve()
private Pair<com.google.common.collect.ImmutableList<SqlNode>,com.google.common.collect.ImmutableList<SqlNode>> getGroupExprs()
The expressions are fully-qualified, and any "*" in select clauses are expanded.
public SqlNode getNode()
SqlValidatorScope
getNode
in interface SqlValidatorScope
private static boolean allContain(java.util.List<ImmutableBitSet> bitSets, int bit)
public RelDataType nullifyType(SqlNode node, RelDataType type)
SqlValidatorScope
nullifyType
in interface SqlValidatorScope
nullifyType
in class DelegatingScope
public SqlValidatorScope getOperandScope(SqlCall call)
SqlValidatorScope
getOperandScope
in interface SqlValidatorScope
getOperandScope
in class DelegatingScope
call
- Callpublic boolean checkAggregateExpr(SqlNode expr, boolean deep)
AggregatingScope
checkAggregateExpr
in interface AggregatingScope
public void validateExpr(SqlNode expr)
SqlValidatorScope
validateExpr
in interface SqlValidatorScope
validateExpr
in class DelegatingScope
Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.