/** * Creates a <code>DelegatingScope</code>. * * @param parent Parent scope */ DelegatingScope(SqlValidatorScope parent) { super(); assert parent != null; this.validator = (SqlValidatorImpl) parent.getValidator(); this.parent = parent; }
/** * Creates a <code>DelegatingScope</code>. * * @param parent Parent scope */ DelegatingScope(SqlValidatorScope parent) { super(); assert parent != null; this.validator = (SqlValidatorImpl) parent.getValidator(); this.parent = parent; }
/** * Creates a CollectNamespace. * * @param child Parse tree node * @param scope Scope * @param enclosingNode Enclosing parse tree node */ CollectNamespace( SqlCall child, SqlValidatorScope scope, SqlNode enclosingNode) { super((SqlValidatorImpl) scope.getValidator(), enclosingNode); this.child = child; this.scope = scope; }
/** * Creates a CollectNamespace. * * @param child Parse tree node * @param scope Scope * @param enclosingNode Enclosing parse tree node */ CollectNamespace( SqlCall child, SqlValidatorScope scope, SqlNode enclosingNode) { super((SqlValidatorImpl) scope.getValidator(), enclosingNode); this.child = child; this.scope = scope; assert child.getKind() == SqlKind.MULTISET_VALUE_CONSTRUCTOR || child.getKind() == SqlKind.MULTISET_QUERY_CONSTRUCTOR; }
@Override public SqlMonotonicity getMonotonicity( SqlCall call, SqlValidatorScope scope) { RelDataTypeFamily castFrom = scope.getValidator().deriveType(scope, call.operands[0]) .getFamily(); RelDataTypeFamily castTo = scope.getValidator().deriveType(scope, call.operands[1]) .getFamily(); if (isMonotonicPreservingCast(castFrom, castTo)) { return call.operands[0].getMonotonicity(scope); } else { return SqlMonotonicity.NotMonotonic; } }
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]); }
@Override public SqlMonotonicity getMonotonicity( SqlCall call, SqlValidatorScope scope) { RelDataTypeFamily castFrom = scope.getValidator().deriveType(scope, call.operand(0)).getFamily(); RelDataTypeFamily castTo = scope.getValidator().deriveType(scope, call.operand(1)).getFamily(); if (isMonotonicPreservingCast(castFrom, castTo)) { return call.operand(0).getMonotonicity(scope); } else { return SqlMonotonicity.NOT_MONOTONIC; } }
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, Util.skipLast(fqId.names)); return ns.resolve().getMonotonicity(Util.last(fqId.names)); } }