Java Code Examples for org.apache.calcite.sql.validate.SqlValidatorScope#getValidator()

The following examples show how to use org.apache.calcite.sql.validate.SqlValidatorScope#getValidator() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SqlIdentifier.java    From Bats with Apache License 2.0 6 votes vote down vote up
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));
}
 
Example 2
Source File: SqlIdentifier.java    From calcite with Apache License 2.0 6 votes vote down vote up
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();
  final SqlCall call = validator.makeNullaryCall(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));
}
 
Example 3
Source File: SqlCall.java    From Bats with Apache License 2.0 4 votes vote down vote up
public SqlMonotonicity getMonotonicity(SqlValidatorScope scope) {
  // Delegate to operator.
  final SqlCallBinding binding =
      new SqlCallBinding(scope.getValidator(), scope, this);
  return getOperator().getMonotonicity(binding);
}
 
Example 4
Source File: SqlCall.java    From calcite with Apache License 2.0 4 votes vote down vote up
public SqlMonotonicity getMonotonicity(SqlValidatorScope scope) {
  // Delegate to operator.
  final SqlCallBinding binding =
      new SqlCallBinding(scope.getValidator(), scope, this);
  return getOperator().getMonotonicity(binding);
}