use of org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory.floatTypeInfo in project hive by apache.
the class TestFunctionRegistry method testImplicitConversion.
public void testImplicitConversion() {
implicit(TypeInfoFactory.intTypeInfo, TypeInfoFactory.decimalTypeInfo, true);
implicit(TypeInfoFactory.longTypeInfo, TypeInfoFactory.decimalTypeInfo, true);
implicit(TypeInfoFactory.floatTypeInfo, TypeInfoFactory.decimalTypeInfo, false);
implicit(TypeInfoFactory.doubleTypeInfo, TypeInfoFactory.decimalTypeInfo, false);
implicit(TypeInfoFactory.stringTypeInfo, TypeInfoFactory.decimalTypeInfo, false);
implicit(TypeInfoFactory.dateTypeInfo, TypeInfoFactory.decimalTypeInfo, false);
implicit(TypeInfoFactory.timestampTypeInfo, TypeInfoFactory.decimalTypeInfo, false);
implicit(varchar10, TypeInfoFactory.stringTypeInfo, true);
implicit(TypeInfoFactory.stringTypeInfo, varchar10, true);
// Try with parameterized varchar types
TypeInfo varchar10 = TypeInfoFactory.getPrimitiveTypeInfo("varchar(10)");
TypeInfo varchar20 = TypeInfoFactory.getPrimitiveTypeInfo("varchar(20)");
implicit(varchar10, TypeInfoFactory.stringTypeInfo, true);
implicit(varchar20, TypeInfoFactory.stringTypeInfo, true);
implicit(TypeInfoFactory.stringTypeInfo, varchar10, true);
implicit(TypeInfoFactory.stringTypeInfo, varchar20, true);
implicit(varchar20, varchar10, true);
implicit(char10, TypeInfoFactory.stringTypeInfo, true);
implicit(TypeInfoFactory.stringTypeInfo, char10, true);
implicit(char5, char10, true);
implicit(char5, varchar10, true);
implicit(varchar5, char10, true);
implicit(TypeInfoFactory.intTypeInfo, char10, true);
implicit(TypeInfoFactory.intTypeInfo, varchar10, true);
implicit(TypeInfoFactory.intTypeInfo, TypeInfoFactory.stringTypeInfo, true);
}
Aggregations