private SqlValidatorNamespace getNamespace(SqlNode node, SqlValidatorScope scope) { if (node instanceof SqlIdentifier && scope instanceof DelegatingScope) { final SqlIdentifier id = (SqlIdentifier) node; final DelegatingScope idScope = (DelegatingScope) ((DelegatingScope) scope).getParent(); return getNamespace(id, idScope); } else if (node instanceof SqlCall) { // Handle extended identifiers. final SqlCall call = (SqlCall) node; switch (call.getOperator().getKind()) { case EXTEND: final SqlIdentifier id = (SqlIdentifier) call.getOperandList().get(0); final DelegatingScope idScope = (DelegatingScope) scope; return getNamespace(id, idScope); case AS: final SqlNode nested = call.getOperandList().get(0); switch (nested.getKind()) { case EXTEND: return getNamespace(nested, scope); } break; } } return getNamespace(node); }
public static AggregatingSelectScope getEnclosingAggregateSelectScope( SqlValidatorScope scope) { while (scope instanceof DelegatingScope) { if (scope instanceof AggregatingSelectScope) { return (AggregatingSelectScope) scope; } scope = ((DelegatingScope) scope).getParent(); } return null; }
public static SelectScope getEnclosingSelectScope(SqlValidatorScope scope) { while (scope instanceof DelegatingScope) { if (scope instanceof SelectScope) { return (SelectScope) scope; } scope = ((DelegatingScope) scope).getParent(); } return null; }
public static AggregatingSelectScope getEnclosingAggregateSelectScope( SqlValidatorScope scope) { while (scope instanceof DelegatingScope) { if (scope instanceof AggregatingSelectScope) { return (AggregatingSelectScope) scope; } scope = ((DelegatingScope) scope).getParent(); } return null; }
public static SelectScope getEnclosingSelectScope(SqlValidatorScope scope) { while (scope instanceof DelegatingScope) { if (scope instanceof SelectScope) { return (SelectScope) scope; } scope = ((DelegatingScope) scope).getParent(); } return null; }
private SqlValidatorNamespace getNamespace(SqlNode node, SqlValidatorScope scope) { if (node instanceof SqlIdentifier && scope instanceof DelegatingScope) { final SqlIdentifier id = (SqlIdentifier) node; final DelegatingScope idScope = (DelegatingScope) ((DelegatingScope) scope).getParent(); return getNamespace(id, idScope); } else if (node instanceof SqlCall) { // Handle extended identifiers. final SqlCall call = (SqlCall) node; switch (call.getOperator().getKind()) { case EXTEND: final SqlIdentifier id = (SqlIdentifier) call.getOperandList().get(0); final DelegatingScope idScope = (DelegatingScope) scope; return getNamespace(id, idScope); case AS: final SqlNode nested = call.getOperandList().get(0); switch (nested.getKind()) { case EXTEND: return getNamespace(nested, scope); } break; } } return getNamespace(node); }
parentScope = ((DelegatingScope) parentScope).getParent(); } else { break;
private SqlValidatorNamespace getNamespace(SqlNode node, SqlValidatorScope scope) { if (node instanceof SqlIdentifier && scope instanceof DelegatingScope) { final SqlIdentifier id = (SqlIdentifier) node; final DelegatingScope idScope = (DelegatingScope) ((DelegatingScope) scope).getParent(); return getNamespace(id, idScope); } else if (node instanceof SqlCall) { // Handle extended identifiers. final SqlCall call = (SqlCall) node; switch (call.getOperator().getKind()) { case EXTEND: final SqlIdentifier id = (SqlIdentifier) call.getOperandList().get(0); final DelegatingScope idScope = (DelegatingScope) scope; return getNamespace(id, idScope); case AS: final SqlNode nested = call.getOperandList().get(0); switch (nested.getKind()) { case EXTEND: return getNamespace(nested, scope); } break; } } return getNamespace(node); }
parentScope = ((DelegatingScope) parentScope).getParent(); } else { break;
parentScope = ((DelegatingScope) parentScope).getParent(); } else { break;
parentScope = ((DelegatingScope) parentScope).getParent(); } else { break;
final SqlValidatorScope leftScope = Util.first(validator.getJoinScope(left), ((DelegatingScope) bb.scope).getParent()); final Blackboard leftBlackboard = createBlackboard(leftScope, null, false); final SqlValidatorScope rightScope = Util.first(validator.getJoinScope(right), ((DelegatingScope) bb.scope).getParent()); final Blackboard rightBlackboard = createBlackboard(rightScope, null, false);
final SqlValidatorScope leftScope = Util.first(validator.getJoinScope(left), ((DelegatingScope) bb.scope).getParent()); final Blackboard leftBlackboard = createBlackboard(leftScope, null, false); final SqlValidatorScope rightScope = Util.first(validator.getJoinScope(right), ((DelegatingScope) bb.scope).getParent()); final Blackboard rightBlackboard = createBlackboard(rightScope, null, false);
final SqlValidatorScope leftScope = Util.first(validator.getJoinScope(left), ((DelegatingScope) bb.scope).getParent()); final Blackboard leftBlackboard = createBlackboard(leftScope, null, false); final SqlValidatorScope rightScope = Util.first(validator.getJoinScope(right), ((DelegatingScope) bb.scope).getParent()); final Blackboard rightBlackboard = createBlackboard(rightScope, null, false);
final SqlValidatorScope leftScope = Util.first(validator.getJoinScope(left), ((DelegatingScope) bb.scope).getParent()); final Blackboard leftBlackboard = createBlackboard(leftScope, null, false); final SqlValidatorScope rightScope = Util.first(validator.getJoinScope(right), ((DelegatingScope) bb.scope).getParent()); final Blackboard rightBlackboard = createBlackboard(rightScope, null, false);