@Test
  public void testCommonClassUnionAll() {
    unionAll(TypeInfoFactory.doubleTypeInfo, TypeInfoFactory.intTypeInfo,
        TypeInfoFactory.doubleTypeInfo);
    unionAll(TypeInfoFactory.intTypeInfo, TypeInfoFactory.decimalTypeInfo,
        TypeInfoFactory.decimalTypeInfo);
    unionAll(TypeInfoFactory.doubleTypeInfo, TypeInfoFactory.decimalTypeInfo,
        TypeInfoFactory.doubleTypeInfo);

    unionAll(varchar5, varchar10, varchar10);
    unionAll(varchar10, varchar5, varchar10);
    unionAll(varchar10, TypeInfoFactory.stringTypeInfo, TypeInfoFactory.stringTypeInfo);
    unionAll(TypeInfoFactory.stringTypeInfo, varchar10, TypeInfoFactory.stringTypeInfo);

    unionAll(char5, char10, char10);
    unionAll(char10, char5, char10);
    unionAll(char10, TypeInfoFactory.stringTypeInfo, TypeInfoFactory.stringTypeInfo);
    unionAll(TypeInfoFactory.stringTypeInfo, char10, TypeInfoFactory.stringTypeInfo);

    unionAll(TypeInfoFactory.timestampTypeInfo, TypeInfoFactory.dateTypeInfo,
        TypeInfoFactory.timestampTypeInfo);

    // Invalid cases
    unionAll(TypeInfoFactory.stringTypeInfo, TypeInfoFactory.decimalTypeInfo, null);
    unionAll(TypeInfoFactory.doubleTypeInfo, varchar10, null);

  }
Method to print out the comparison/conversion behavior for data types.
ql/src/test/org/apache/hadoop/hive/ql/exec/TestFunctionRegistry.java