Java Code Examples for org.apache.calcite.config.NullCollation#HIGH

The following examples show how to use org.apache.calcite.config.NullCollation#HIGH . 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: SqlDialectFactoryImpl.java    From Bats with Apache License 2.0 6 votes vote down vote up
private NullCollation getNullCollation(DatabaseMetaData databaseMetaData) {
  try {
    if (databaseMetaData.nullsAreSortedAtEnd()) {
      return NullCollation.LAST;
    } else if (databaseMetaData.nullsAreSortedAtStart()) {
      return NullCollation.FIRST;
    } else if (databaseMetaData.nullsAreSortedLow()) {
      return NullCollation.LOW;
    } else if (databaseMetaData.nullsAreSortedHigh()) {
      return NullCollation.HIGH;
    } else {
      throw new IllegalArgumentException("cannot deduce null collation");
    }
  } catch (SQLException e) {
    throw new IllegalArgumentException("cannot deduce null collation", e);
  }
}
 
Example 2
Source File: SqlDialectFactoryImpl.java    From calcite with Apache License 2.0 6 votes vote down vote up
private NullCollation getNullCollation(DatabaseMetaData databaseMetaData) {
  try {
    if (databaseMetaData.nullsAreSortedAtEnd()) {
      return NullCollation.LAST;
    } else if (databaseMetaData.nullsAreSortedAtStart()) {
      return NullCollation.FIRST;
    } else if (databaseMetaData.nullsAreSortedLow()) {
      return NullCollation.LOW;
    } else if (databaseMetaData.nullsAreSortedHigh()) {
      return NullCollation.HIGH;
    } else if (isBigQuery(databaseMetaData)) {
      return NullCollation.LOW;
    } else {
      throw new IllegalArgumentException("cannot deduce null collation");
    }
  } catch (SQLException e) {
    throw new IllegalArgumentException("cannot deduce null collation", e);
  }
}
 
Example 3
Source File: SqlDialect.java    From calcite with Apache License 2.0 5 votes vote down vote up
/** Creates an empty context. Use {@link #EMPTY_CONTEXT} to reference the instance. */
private static Context emptyContext() {
  return new ContextImpl(DatabaseProduct.UNKNOWN, null, null, -1, -1,
      "'", "''", null,
      Casing.UNCHANGED, Casing.TO_UPPER, true, SqlConformanceEnum.DEFAULT,
      NullCollation.HIGH, RelDataTypeSystemImpl.DEFAULT,
      JethroDataSqlDialect.JethroInfo.EMPTY);
}
 
Example 4
Source File: SqlDialect.java    From Bats with Apache License 2.0 4 votes vote down vote up
/** Creates an empty context. Use {@link #EMPTY_CONTEXT} if possible. */
protected static Context emptyContext() {
  return new ContextImpl(DatabaseProduct.UNKNOWN, null, null, -1, -1, null,
      NullCollation.HIGH, RelDataTypeSystemImpl.DEFAULT, JethroDataSqlDialect.JethroInfo.EMPTY);
}