Java Code Examples for org.apache.calcite.sql.type.SqlTypeName#OTHER

The following examples show how to use org.apache.calcite.sql.type.SqlTypeName#OTHER . 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: RelDataTypeFactoryImpl.java    From Bats with Apache License 2.0 5 votes vote down vote up
public SqlTypeName getSqlTypeName() {
  final SqlTypeName typeName =
      JavaToSqlTypeConversionRules.instance().lookup(clazz);
  if (typeName == null) {
    return SqlTypeName.OTHER;
  }
  return typeName;
}
 
Example 2
Source File: JoinTranslator.java    From samza with Apache License 2.0 5 votes vote down vote up
private void validateJoinKeyType(RexInputRef ref) {
  SqlTypeName sqlTypeName = ref.getType().getSqlTypeName();

  // Primitive types and ANY (for the record key) are supported in the key
  if (sqlTypeName != SqlTypeName.BOOLEAN && sqlTypeName != SqlTypeName.TINYINT && sqlTypeName != SqlTypeName.SMALLINT
      && sqlTypeName != SqlTypeName.INTEGER && sqlTypeName != SqlTypeName.CHAR && sqlTypeName != SqlTypeName.BIGINT
      && sqlTypeName != SqlTypeName.VARCHAR && sqlTypeName != SqlTypeName.DOUBLE && sqlTypeName != SqlTypeName.FLOAT
      && sqlTypeName != SqlTypeName.ANY && sqlTypeName != SqlTypeName.OTHER) {
    log.error("Unsupported key type " + sqlTypeName + " used in join condition.");
    throw new SamzaException("Unsupported key type used in join condition.");
  }
}
 
Example 3
Source File: RelDataTypeFactoryImpl.java    From calcite with Apache License 2.0 5 votes vote down vote up
public SqlTypeName getSqlTypeName() {
  final SqlTypeName typeName =
      JavaToSqlTypeConversionRules.instance().lookup(clazz);
  if (typeName == null) {
    return SqlTypeName.OTHER;
  }
  return typeName;
}
 
Example 4
Source File: RexImpTable.java    From calcite with Apache License 2.0 5 votes vote down vote up
private static RelDataType toSql(RelDataTypeFactory typeFactory,
    RelDataType type) {
  if (type instanceof RelDataTypeFactoryImpl.JavaType) {
    final SqlTypeName typeName = type.getSqlTypeName();
    if (typeName != null && typeName != SqlTypeName.OTHER) {
      return typeFactory.createTypeWithNullability(
          typeFactory.createSqlType(typeName),
          type.isNullable());
    }
  }
  return type;
}
 
Example 5
Source File: RawRelDataType.java    From flink with Apache License 2.0 4 votes vote down vote up
public RawRelDataType(RawType<?> rawType) {
	super(SqlTypeName.OTHER, rawType.isNullable(), null);
	this.rawType = rawType;
	computeDigest();
}