private static TypeReader createBooleanConvertTreeReader()

in java/core/src/java/org/apache/orc/impl/ConvertTreeReaderFactory.java [1890:1940]


  private static TypeReader createBooleanConvertTreeReader(int columnId,
                                                           TypeDescription fileType,
                                                           TypeDescription readerType,
                                                           Context context) throws IOException {

    // CONVERT from BOOLEAN to schema type.
    //
    switch (readerType.getCategory()) {

      case BOOLEAN:
      case BYTE:
      case SHORT:
      case INT:
      case LONG:
        if (fileType.getCategory() == readerType.getCategory()) {
          throw new IllegalArgumentException("No conversion of type " +
              readerType.getCategory() + " to self needed");
        }
        return new AnyIntegerFromAnyIntegerTreeReader(columnId, fileType, readerType,
            context);

      case FLOAT:
      case DOUBLE:
        return new DoubleFromAnyIntegerTreeReader(columnId, fileType, context);

      case DECIMAL:
        return new DecimalFromAnyIntegerTreeReader(columnId, fileType, context);

      case STRING:
      case CHAR:
      case VARCHAR:
        return new StringGroupFromBooleanTreeReader(columnId, fileType, readerType,
            context);

      case TIMESTAMP:
      case TIMESTAMP_INSTANT:
        return new TimestampFromAnyIntegerTreeReader(columnId, fileType, context,
            readerType.getCategory() == Category.TIMESTAMP_INSTANT);

      // Not currently supported conversion(s):
      case BINARY:
      case DATE:
      case STRUCT:
      case LIST:
      case MAP:
      case UNION:
      default:
        throw new IllegalArgumentException("Unsupported type " +
            readerType.getCategory());
    }
  }