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 |
com.google.common.base.Supplier<AggregatingSelectScope.Resolved> |
resolved |
private SqlSelect |
select |
private 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(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, resolveTableclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddChild, findAliases, findAllColumnNames, findQualifyingTableName, findQualifyingTableNames, fullyQualify, getMonotonicity, getOrderList, getTableNamespace, getValidator, lookupWindow, resolve, resolveColumn, resolveTableprivate final SqlSelect select
private final boolean distinct
public final com.google.common.base.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()
SqlValidatorScopegetNode in interface SqlValidatorScopeprivate static boolean allContain(List<ImmutableBitSet> bitSets, int bit)
public RelDataType nullifyType(SqlNode node, RelDataType type)
SqlValidatorScopenullifyType in interface SqlValidatorScopenullifyType in class DelegatingScopepublic SqlValidatorScope getOperandScope(SqlCall call)
SqlValidatorScopegetOperandScope in interface SqlValidatorScopegetOperandScope in class DelegatingScopecall - Callpublic boolean checkAggregateExpr(SqlNode expr, boolean deep)
AggregatingScopecheckAggregateExpr in interface AggregatingScopepublic void validateExpr(SqlNode expr)
SqlValidatorScopevalidateExpr in interface SqlValidatorScopevalidateExpr in class DelegatingScopeCopyright © 2012–2018 The Apache Software Foundation. All rights reserved.