public SqlNode visit(SqlIdentifier id) { return getScope().fullyQualify(id); }
public SqlMonotonicity getMonotonicity(SqlNode expr) { return parent.getMonotonicity(expr); }
orderList = bb.scope.getOrderList(); if (orderList == null) { throw new AssertionError(
identifier = bb.scope.fullyQualify(identifier); namespace = bb.scope.resolve(identifier.names.get(0), null, null);
final SqlValidatorScope[] ancestorScopes = {null}; SqlValidatorNamespace foundNs = bb.scope.resolve( originalRelName, ancestorScopes, for (SqlNode groupItem : groupList) { bb.columnMonotonicities.add( bb.scope.getMonotonicity(groupItem)); for (SqlNode selectItem : selectList) { bb.columnMonotonicities.add( bb.scope.getMonotonicity(selectItem));
/** * This method retrieves the list of columns for the current table then * walks through the list looking for a column that is monotonic (sorted) */ static boolean isTableSorted(SqlValidatorScope scope) { List<SqlMoniker> columnNames = new ArrayList<SqlMoniker>(); // REVIEW: jhyde, 2007/11/7: This is the only use of // findAllColumnNames. Find a better way to detect monotonicity, then // remove that method. scope.findAllColumnNames(columnNames); for (SqlMoniker columnName : columnNames) { SqlIdentifier columnId = columnName.toIdentifier(); final SqlMonotonicity monotonicity = scope.getMonotonicity(columnId); if (monotonicity != SqlMonotonicity.NOT_MONOTONIC) { return true; } } return false; }
final SqlValidatorScope[] ancestorScopes = {null}; SqlValidatorNamespace foundNs = lookup.bb.scope.resolve( originalRelName, ancestorScopes,
id = scope.fullyQualify(id); scope.resolve(name, null, null); RelDataType colType = scope.resolveColumn(name, id); if (colType != null) { type = colType;
public SqlMonotonicity getMonotonicity(SqlValidatorScope scope) { // First check for builtin functions which don't have parentheses, // like "LOCALTIME". final SqlValidator validator = scope.getValidator(); SqlCall call = SqlUtil.makeCall( validator.getOperatorTable(), this); if (call != null) { return call.getMonotonicity(scope); } final SqlIdentifier fqId = scope.fullyQualify(this); final SqlValidatorNamespace ns = SqlValidatorUtil.lookup( scope, Arrays.asList(fqId.names).subList(0, fqId.names.length - 1)); return ns.getMonotonicity(fqId.names[fqId.names.length - 1]); }
for (String name : subNames) { if (ns == null) { ns = scope.resolve(name, null, null); } else { ns = ns.lookupChild(name); scope.findAliases(hintList);
public final SqlNode visit(SqlCall call) { SqlValidatorScope oldScope = scopes.peek(); SqlValidatorScope newScope = oldScope.getOperandScope(call); scopes.push(newScope); SqlNode result = visitScoped(call); scopes.pop(); return result; }
/** * Creates a <code>DelegatingScope</code>. * * @param parent Parent scope */ DelegatingScope(SqlValidatorScope parent) { super(); assert parent != null; this.validator = (SqlValidatorImpl) parent.getValidator(); this.parent = parent; }
public void findAliases(List<SqlMoniker> result) { parent.findAliases(result); }
public void findAllColumnNames(List<SqlMoniker> result) { parent.findAllColumnNames(result); }
public String findQualifyingTableName(String columnName, SqlNode ctx) { return parent.findQualifyingTableName(columnName, ctx); }
public void addChild(SqlValidatorNamespace ns, String alias) { super.addChild(ns, alias); if ((usingScope != null) && (usingScope != parent)) { // We're looking at a join within a join. Recursively add this // child to its parent scope too. Example: // // select * // from (a join b on expr1) // join c on expr2 // where expr3 // // 'a' is a child namespace of 'a join b' and also of // 'a join b join c'. usingScope.addChild(ns, alias); } }
final SqlValidatorScope[] ancestorScopes = {null}; SqlValidatorNamespace foundNs = scope.resolve(name, ancestorScopes, offsets); if (foundNs == null) { return null;
id = scope.fullyQualify(id); scope.resolve(name, null, null); RelDataType colType = scope.resolveColumn(name, id); if (colType != null) { type = colType;
identifier = bb.scope.fullyQualify(identifier); namespace = bb.scope.resolve(identifier.names.get(0), null, null);
final SqlValidatorScope[] ancestorScopes = {null}; SqlValidatorNamespace foundNs = bb.scope.resolve( originalRelName, ancestorScopes, for (SqlNode groupItem : groupList) { bb.columnMonotonicities.add( bb.scope.getMonotonicity(groupItem)); for (SqlNode selectItem : selectList) { bb.columnMonotonicities.add( bb.scope.getMonotonicity(selectItem));