Java Code Examples for org.apache.calcite.sql.fun.SqlStdOperatorTable#LESS_THAN

The following examples show how to use org.apache.calcite.sql.fun.SqlStdOperatorTable#LESS_THAN . 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: SqlImplementor.java    From Bats with Apache License 2.0 6 votes vote down vote up
private static SqlOperator reverseOperatorDirection(SqlOperator op) {
    switch (op.kind) {
    case GREATER_THAN:
        return SqlStdOperatorTable.LESS_THAN;
    case GREATER_THAN_OR_EQUAL:
        return SqlStdOperatorTable.LESS_THAN_OR_EQUAL;
    case LESS_THAN:
        return SqlStdOperatorTable.GREATER_THAN;
    case LESS_THAN_OR_EQUAL:
        return SqlStdOperatorTable.GREATER_THAN_OR_EQUAL;
    case EQUALS:
    case IS_NOT_DISTINCT_FROM:
    case NOT_EQUALS:
        return op;
    default:
        throw new AssertionError(op);
    }
}
 
Example 2
Source File: RelOptUtil.java    From Bats with Apache License 2.0 6 votes vote down vote up
public static SqlOperator op(SqlKind kind, SqlOperator operator) {
    switch (kind) {
    case EQUALS:
        return SqlStdOperatorTable.EQUALS;
    case NOT_EQUALS:
        return SqlStdOperatorTable.NOT_EQUALS;
    case GREATER_THAN:
        return SqlStdOperatorTable.GREATER_THAN;
    case GREATER_THAN_OR_EQUAL:
        return SqlStdOperatorTable.GREATER_THAN_OR_EQUAL;
    case LESS_THAN:
        return SqlStdOperatorTable.LESS_THAN;
    case LESS_THAN_OR_EQUAL:
        return SqlStdOperatorTable.LESS_THAN_OR_EQUAL;
    case IS_DISTINCT_FROM:
        return SqlStdOperatorTable.IS_DISTINCT_FROM;
    case IS_NOT_DISTINCT_FROM:
        return SqlStdOperatorTable.IS_NOT_DISTINCT_FROM;
    default:
        return operator;
    }
}
 
Example 3
Source File: SqlImplementor.java    From dremio-oss with Apache License 2.0 6 votes vote down vote up
private static SqlOperator reverseOperatorDirection(SqlOperator op) {
  switch (op.kind) {
    case GREATER_THAN:
      return SqlStdOperatorTable.LESS_THAN;
    case GREATER_THAN_OR_EQUAL:
      return SqlStdOperatorTable.LESS_THAN_OR_EQUAL;
    case LESS_THAN:
      return SqlStdOperatorTable.GREATER_THAN;
    case LESS_THAN_OR_EQUAL:
      return SqlStdOperatorTable.GREATER_THAN_OR_EQUAL;
    case EQUALS:
    case IS_NOT_DISTINCT_FROM:
    case NOT_EQUALS:
      return op;
    default:
      throw new AssertionError(op);
  }
}
 
Example 4
Source File: RelToSqlConverter.java    From quark with Apache License 2.0 6 votes vote down vote up
private static SqlOperator reverseOperatorDirection(SqlOperator op) {
  switch (op.kind) {
    case GREATER_THAN:
      return SqlStdOperatorTable.LESS_THAN;
    case GREATER_THAN_OR_EQUAL:
      return SqlStdOperatorTable.LESS_THAN_OR_EQUAL;
    case LESS_THAN:
      return SqlStdOperatorTable.GREATER_THAN;
    case LESS_THAN_OR_EQUAL:
      return SqlStdOperatorTable.GREATER_THAN_OR_EQUAL;
    case EQUALS:
    case IS_NOT_DISTINCT_FROM:
    case NOT_EQUALS:
      return op;
    default:
      throw new AssertionError(op);
  }
}
 
Example 5
Source File: SqlImplementor.java    From calcite with Apache License 2.0 6 votes vote down vote up
private static SqlOperator reverseOperatorDirection(SqlOperator op) {
  switch (op.kind) {
  case GREATER_THAN:
    return SqlStdOperatorTable.LESS_THAN;
  case GREATER_THAN_OR_EQUAL:
    return SqlStdOperatorTable.LESS_THAN_OR_EQUAL;
  case LESS_THAN:
    return SqlStdOperatorTable.GREATER_THAN;
  case LESS_THAN_OR_EQUAL:
    return SqlStdOperatorTable.GREATER_THAN_OR_EQUAL;
  case EQUALS:
  case IS_NOT_DISTINCT_FROM:
  case NOT_EQUALS:
    return op;
  default:
    throw new AssertionError(op);
  }
}
 
Example 6
Source File: RelOptUtil.java    From calcite with Apache License 2.0 6 votes vote down vote up
public static SqlOperator op(SqlKind kind, SqlOperator operator) {
  switch (kind) {
  case EQUALS:
    return SqlStdOperatorTable.EQUALS;
  case NOT_EQUALS:
    return SqlStdOperatorTable.NOT_EQUALS;
  case GREATER_THAN:
    return SqlStdOperatorTable.GREATER_THAN;
  case GREATER_THAN_OR_EQUAL:
    return SqlStdOperatorTable.GREATER_THAN_OR_EQUAL;
  case LESS_THAN:
    return SqlStdOperatorTable.LESS_THAN;
  case LESS_THAN_OR_EQUAL:
    return SqlStdOperatorTable.LESS_THAN_OR_EQUAL;
  case IS_DISTINCT_FROM:
    return SqlStdOperatorTable.IS_DISTINCT_FROM;
  case IS_NOT_DISTINCT_FROM:
    return SqlStdOperatorTable.IS_NOT_DISTINCT_FROM;
  default:
    return operator;
  }
}
 
Example 7
Source File: MoreRelOptUtil.java    From dremio-oss with Apache License 2.0 5 votes vote down vote up
public static SqlOperator op(SqlKind kind) {
  switch (kind) {
  case IS_FALSE:
    return SqlStdOperatorTable.IS_FALSE;
  case IS_TRUE:
    return SqlStdOperatorTable.IS_TRUE;
  case IS_UNKNOWN:
    return SqlStdOperatorTable.IS_UNKNOWN;
  case IS_NULL:
    return SqlStdOperatorTable.IS_NULL;
  case IS_NOT_FALSE:
    return SqlStdOperatorTable.IS_NOT_FALSE;
  case IS_NOT_TRUE:
    return SqlStdOperatorTable.IS_NOT_TRUE;
  case IS_NOT_NULL:
    return SqlStdOperatorTable.IS_NOT_NULL;
  case EQUALS:
    return SqlStdOperatorTable.EQUALS;
  case NOT_EQUALS:
    return SqlStdOperatorTable.NOT_EQUALS;
  case LESS_THAN:
    return SqlStdOperatorTable.LESS_THAN;
  case GREATER_THAN:
    return SqlStdOperatorTable.GREATER_THAN;
  case LESS_THAN_OR_EQUAL:
    return SqlStdOperatorTable.LESS_THAN_OR_EQUAL;
  case GREATER_THAN_OR_EQUAL:
    return SqlStdOperatorTable.GREATER_THAN_OR_EQUAL;
  default:
    throw new AssertionError(kind);
  }
}
 
Example 8
Source File: RexUtil.java    From Bats with Apache License 2.0 4 votes vote down vote up
static SqlOperator op(SqlKind kind) {
    switch (kind) {
    case IS_FALSE:
        return SqlStdOperatorTable.IS_FALSE;
    case IS_TRUE:
        return SqlStdOperatorTable.IS_TRUE;
    case IS_UNKNOWN:
        return SqlStdOperatorTable.IS_UNKNOWN;
    case IS_NULL:
        return SqlStdOperatorTable.IS_NULL;
    case IS_NOT_FALSE:
        return SqlStdOperatorTable.IS_NOT_FALSE;
    case IS_NOT_TRUE:
        return SqlStdOperatorTable.IS_NOT_TRUE;
    case IS_NOT_NULL:
        return SqlStdOperatorTable.IS_NOT_NULL;
    case IS_DISTINCT_FROM:
        return SqlStdOperatorTable.IS_DISTINCT_FROM;
    case IS_NOT_DISTINCT_FROM:
        return SqlStdOperatorTable.IS_NOT_DISTINCT_FROM;
    case EQUALS:
        return SqlStdOperatorTable.EQUALS;
    case NOT_EQUALS:
        return SqlStdOperatorTable.NOT_EQUALS;
    case LESS_THAN:
        return SqlStdOperatorTable.LESS_THAN;
    case GREATER_THAN:
        return SqlStdOperatorTable.GREATER_THAN;
    case LESS_THAN_OR_EQUAL:
        return SqlStdOperatorTable.LESS_THAN_OR_EQUAL;
    case GREATER_THAN_OR_EQUAL:
        return SqlStdOperatorTable.GREATER_THAN_OR_EQUAL;
    case AND:
        return SqlStdOperatorTable.AND;
    case OR:
        return SqlStdOperatorTable.OR;
    case COALESCE:
        return SqlStdOperatorTable.COALESCE;
    default:
        throw new AssertionError(kind);
    }
}
 
Example 9
Source File: RexUtil.java    From calcite with Apache License 2.0 4 votes vote down vote up
static SqlOperator op(SqlKind kind) {
  switch (kind) {
  case IS_FALSE:
    return SqlStdOperatorTable.IS_FALSE;
  case IS_TRUE:
    return SqlStdOperatorTable.IS_TRUE;
  case IS_UNKNOWN:
    return SqlStdOperatorTable.IS_UNKNOWN;
  case IS_NULL:
    return SqlStdOperatorTable.IS_NULL;
  case IS_NOT_FALSE:
    return SqlStdOperatorTable.IS_NOT_FALSE;
  case IS_NOT_TRUE:
    return SqlStdOperatorTable.IS_NOT_TRUE;
  case IS_NOT_NULL:
    return SqlStdOperatorTable.IS_NOT_NULL;
  case IS_DISTINCT_FROM:
    return SqlStdOperatorTable.IS_DISTINCT_FROM;
  case IS_NOT_DISTINCT_FROM:
    return SqlStdOperatorTable.IS_NOT_DISTINCT_FROM;
  case EQUALS:
    return SqlStdOperatorTable.EQUALS;
  case NOT_EQUALS:
    return SqlStdOperatorTable.NOT_EQUALS;
  case LESS_THAN:
    return SqlStdOperatorTable.LESS_THAN;
  case GREATER_THAN:
    return SqlStdOperatorTable.GREATER_THAN;
  case LESS_THAN_OR_EQUAL:
    return SqlStdOperatorTable.LESS_THAN_OR_EQUAL;
  case GREATER_THAN_OR_EQUAL:
    return SqlStdOperatorTable.GREATER_THAN_OR_EQUAL;
  case AND:
    return SqlStdOperatorTable.AND;
  case OR:
    return SqlStdOperatorTable.OR;
  case COALESCE:
    return SqlStdOperatorTable.COALESCE;
  default:
    throw new AssertionError(kind);
  }
}