protected RelDataType adjustType( SqlValidator validator, SqlCall call, RelDataType type) { if (SqlTypeUtil.inCharFamily(type)) { // Determine coercibility and resulting collation name of // unary operator if needed. RelDataType operandType = validator.getValidatedNodeType(call.operand(0)); if (null == operandType) { throw new AssertionError("operand's type should have been derived"); } if (SqlTypeUtil.inCharFamily(operandType)) { SqlCollation collation = operandType.getCollation(); assert null != collation : "An implicit or explicit collation should have been set"; type = validator.getTypeFactory() .createTypeWithCharsetAndCollation( type, type.getCharset(), new SqlCollation( collation.getCollationName(), collation.getCoercibility())); } } return type; }
protected RelDataType adjustType( SqlValidator validator, SqlCall call, RelDataType type) { if (SqlTypeUtil.inCharFamily(type)) { // Determine coercibility and resulting collation name of // unary operator if needed. RelDataType operandType = validator.getValidatedNodeType(call.operand(0)); if (null == operandType) { throw new AssertionError("operand's type should have been derived"); } if (SqlTypeUtil.inCharFamily(operandType)) { SqlCollation collation = operandType.getCollation(); assert null != collation : "An implicit or explicit collation should have been set"; type = validator.getTypeFactory() .createTypeWithCharsetAndCollation( type, type.getCharset(), new SqlCollation( collation.getCollationName(), collation.getCoercibility())); } } return type; }
protected RelDataType adjustType( SqlValidator validator, SqlCall call, RelDataType type) { if (SqlTypeUtil.inCharFamily(type)) { // Determine coercibility and resulting collation name of // unary operator if needed. RelDataType operandType = validator.getValidatedNodeType(call.operand(0)); if (null == operandType) { throw new AssertionError("operand's type should have been derived"); } if (SqlTypeUtil.inCharFamily(operandType)) { SqlCollation collation = operandType.getCollation(); assert null != collation : "An implicit or explicit collation should have been set"; type = validator.getTypeFactory() .createTypeWithCharsetAndCollation( type, type.getCharset(), new SqlCollation( collation.getCollationName(), collation.getCoercibility())); } } return type; }
protected RelDataType adjustType( SqlValidator validator, SqlCall call, RelDataType type) { if (SqlTypeUtil.inCharFamily(type)) { // Determine coercibility and resulting collation name of // unary operator if needed. RelDataType operandType = validator.getValidatedNodeType(call.operand(0)); if (null == operandType) { throw new AssertionError("operand's type should have been derived"); } if (SqlTypeUtil.inCharFamily(operandType)) { SqlCollation collation = operandType.getCollation(); assert null != collation : "An implicit or explicit collation should have been set"; type = validator.getTypeFactory() .createTypeWithCharsetAndCollation( type, type.getCharset(), new SqlCollation( collation.getCollationName(), collation.getCoercibility())); } } return type; }
assert null != col1; assert null != col2; final Coercibility coercibility1 = col1.getCoercibility(); final Coercibility coercibility2 = col2.getCoercibility(); switch (coercibility1) { case COERCIBLE:
assert null != col1; assert null != col2; final Coercibility coercibility1 = col1.getCoercibility(); final Coercibility coercibility2 = col2.getCoercibility(); switch (coercibility1) { case COERCIBLE:
public void checkCollation( String expression, String expectedCollationName, SqlCollation.Coercibility expectedCoercibility) { for (String sql : buildQueries(expression)) { RelDataType actualType = getColumnType(sql); SqlCollation collation = actualType.getCollation(); assertEquals( expectedCollationName, collation.getCollationName()); assertEquals(expectedCoercibility, collation.getCoercibility()); } }
public void checkCollation( String expression, String expectedCollationName, SqlCollation.Coercibility expectedCoercibility) { for (String sql : buildQueries(expression)) { RelDataType actualType = getColumnType(sql); SqlCollation collation = actualType.getCollation(); assertEquals( expectedCollationName, collation.getCollationName()); assertEquals(expectedCoercibility, collation.getCoercibility()); } }