private Pair<String, String> findTableColumnPair(SqlIdentifier identifier, SqlValidatorScope scope) { SqlCall call = SqlUtil.makeCall(getOperatorTable(), identifier); if (call != null) { return null; } SqlQualified qualified = scope.fullyQualify(identifier); List<String> names = qualified.identifier.names; if (names.size() < 2) { return null; } return new Pair<>(names.get(names.size() - 2), Util.last(names)); }
SqlUtil.makeCall( validator.getOperatorTable(), curOpId);
public RelDataType visit(SqlIdentifier id) { SqlCall call = SqlUtil.makeCall(opTab, id); if (call != null) { return call.getOperator().validateOperands(
SqlUtil.makeCall( validator.getOperatorTable(), id);
private Pair<String, String> findTableColumnPair(SqlIdentifier identifier, SqlValidatorScope scope) { SqlCall call = SqlUtil.makeCall(getOperatorTable(), identifier); if (call != null) { return null; } SqlQualified qualified = scope.fullyQualify(identifier); List<String> names = qualified.identifier.names; if (names.size() < 2) { return null; } return new Pair<>(names.get(names.size() - 2), Util.last(names)); }
private Pair<String, String> findTableColumnPair(SqlIdentifier identifier, SqlValidatorScope scope) { SqlCall call = SqlUtil.makeCall(getOperatorTable(), identifier); if (call != null) { return null; } SqlQualified qualified = scope.fullyQualify(identifier); List<String> names = qualified.identifier.names; if (names.size() < 2) { return null; } return new Pair<>(names.get(names.size() - 2), Util.last(names)); }
public void validateExpr(SqlValidator validator, SqlValidatorScope scope) { // First check for builtin functions which don't have parentheses, // like "LOCALTIME". SqlCall call = SqlUtil.makeCall( validator.getOperatorTable(), this); if (call != null) { validator.validateCall(call, scope); return; } validator.validateIdentifier(this, scope); }
public void validateExpr(SqlValidator validator, SqlValidatorScope scope) { // First check for builtin functions which don't have parentheses, // like "LOCALTIME". SqlCall call = SqlUtil.makeCall( validator.getOperatorTable(), this); if (call != null) { validator.validateCall(call, scope); return; } validator.validateIdentifier(this, scope); }
public SqlNode visit(SqlIdentifier id) { // First check for builtin functions which don't have parentheses, // like "LOCALTIME". final SqlCall call = SqlUtil.makeCall(getScope().getValidator().getOperatorTable(), id); if (call != null) { return call; } return getScope().fullyQualify(id).identifier; }
public SqlNode visit(SqlIdentifier id) { // First check for builtin functions which don't have parentheses, // like "LOCALTIME". final SqlCall call = SqlUtil.makeCall(getScope().getValidator().getOperatorTable(), id); if (call != null) { return call; } return getScope().fullyQualify(id).identifier; }
@Override public SqlNode visit(SqlIdentifier id) { // First check for builtin functions which don't have // parentheses, like "LOCALTIME". SqlCall call = SqlUtil.makeCall( validator.getOperatorTable(), id); if (call != null) { return call.accept(this); } final SqlIdentifier fqId = getScope().fullyQualify(id).identifier; SqlNode expandedExpr = expandDynamicStar(id, fqId); validator.setOriginal(expandedExpr, id); return expandedExpr; }
@Override public SqlNode visit(SqlIdentifier id) { // First check for builtin functions which don't have // parentheses, like "LOCALTIME". SqlCall call = SqlUtil.makeCall( validator.getOperatorTable(), id); if (call != null) { return call.accept(this); } final SqlIdentifier fqId = getScope().fullyQualify(id).identifier; SqlNode expandedExpr = expandDynamicStar(id, fqId); validator.setOriginal(expandedExpr, id); return expandedExpr; }
SqlUtil.makeCall( validator.getOperatorTable(), curOpId);
SqlUtil.makeCall( validator.getOperatorTable(), curOpId);
public SqlMonotonicity getMonotonicity(SqlValidatorScope scope) { // for "star" column, whether it's static or dynamic return not_monotonic directly. if (Util.last(names).equals("") || DynamicRecordType.isDynamicStarColName(Util.last(names))) { return SqlMonotonicity.NOT_MONOTONIC; } // 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 SqlQualified qualified = scope.fullyQualify(this); final SqlIdentifier fqId = qualified.identifier; return qualified.namespace.resolve().getMonotonicity(Util.last(fqId.names)); } }
public SqlMonotonicity getMonotonicity(SqlValidatorScope scope) { // for "star" column, whether it's static or dynamic return not_monotonic directly. if (Util.last(names).equals("") || DynamicRecordType.isDynamicStarColName(Util.last(names))) { return SqlMonotonicity.NOT_MONOTONIC; } // 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 SqlQualified qualified = scope.fullyQualify(this); final SqlIdentifier fqId = qualified.identifier; return qualified.namespace.resolve().getMonotonicity(Util.last(fqId.names)); } }
SqlIdentifier identifier) { final SqlCall call = SqlUtil.makeCall(opTab, identifier); if (call != null) { return bb.convertExpression(call);
public Void visit(SqlIdentifier id) { if (isGroupExpr(id) || id.isStar()) { // Star may validly occur in "SELECT COUNT(*) OVER w" return null; } // Is it a call to a parentheses-free function? SqlCall call = SqlUtil.makeCall( validator.getOperatorTable(), id); if (call != null) { return call.accept(this); } // Didn't find the identifier in the group-by list as is, now find // it fully-qualified. // TODO: It would be better if we always compared fully-qualified // to fully-qualified. final SqlQualified fqId = scopes.peek().fullyQualify(id); if (isGroupExpr(fqId.identifier)) { return null; } SqlNode originalExpr = validator.getOriginal(id); final String exprString = originalExpr.toString(); throw validator.newValidationError(originalExpr, distinct ? RESOURCE.notSelectDistinctExpr(exprString) : RESOURCE.notGroupExpr(exprString)); }
public Void visit(SqlIdentifier id) { if (isGroupExpr(id) || id.isStar()) { // Star may validly occur in "SELECT COUNT(*) OVER w" return null; } // Is it a call to a parentheses-free function? SqlCall call = SqlUtil.makeCall( validator.getOperatorTable(), id); if (call != null) { return call.accept(this); } // Didn't find the identifier in the group-by list as is, now find // it fully-qualified. // TODO: It would be better if we always compared fully-qualified // to fully-qualified. final SqlQualified fqId = scopes.peek().fullyQualify(id); if (isGroupExpr(fqId.identifier)) { return null; } SqlNode originalExpr = validator.getOriginal(id); final String exprString = originalExpr.toString(); throw validator.newValidationError(originalExpr, distinct ? RESOURCE.notSelectDistinctExpr(exprString) : RESOURCE.notGroupExpr(exprString)); }
public Void visit(SqlIdentifier id) { if (isGroupExpr(id) || id.isStar()) { // Star may validly occur in "SELECT COUNT(*) OVER w" return null; } // Is it a call to a parentheses-free function? SqlCall call = SqlUtil.makeCall( validator.getOperatorTable(), id); if (call != null) { return call.accept(this); } // Didn't find the identifier in the group-by list as is, now find // it fully-qualified. // TODO: It would be better if we always compared fully-qualified // to fully-qualified. final SqlQualified fqId = scopes.peek().fullyQualify(id); if (isGroupExpr(fqId.identifier)) { return null; } SqlNode originalExpr = validator.getOriginal(id); final String exprString = originalExpr.toString(); throw validator.newValidationError(originalExpr, distinct ? RESOURCE.notSelectDistinctExpr(exprString) : RESOURCE.notGroupExpr(exprString)); }