Search in sources :

Example 1 with HoodieHFileInputFormat

use of org.apache.hudi.hadoop.HoodieHFileInputFormat in project hudi by apache.

the class HoodieInputFormatUtils method getInputFormat.

public static FileInputFormat getInputFormat(HoodieFileFormat baseFileFormat, boolean realtime, Configuration conf) {
    switch(baseFileFormat) {
        case PARQUET:
            if (realtime) {
                HoodieParquetRealtimeInputFormat inputFormat = new HoodieParquetRealtimeInputFormat();
                inputFormat.setConf(conf);
                return inputFormat;
            } else {
                HoodieParquetInputFormat inputFormat = new HoodieParquetInputFormat();
                inputFormat.setConf(conf);
                return inputFormat;
            }
        case HFILE:
            if (realtime) {
                HoodieHFileRealtimeInputFormat inputFormat = new HoodieHFileRealtimeInputFormat();
                inputFormat.setConf(conf);
                return inputFormat;
            } else {
                HoodieHFileInputFormat inputFormat = new HoodieHFileInputFormat();
                inputFormat.setConf(conf);
                return inputFormat;
            }
        default:
            throw new HoodieIOException("Hoodie InputFormat not implemented for base file format " + baseFileFormat);
    }
}
Also used : HoodieHFileInputFormat(org.apache.hudi.hadoop.HoodieHFileInputFormat) HoodieParquetRealtimeInputFormat(org.apache.hudi.hadoop.realtime.HoodieParquetRealtimeInputFormat) HoodieIOException(org.apache.hudi.exception.HoodieIOException) HoodieHFileRealtimeInputFormat(org.apache.hudi.hadoop.realtime.HoodieHFileRealtimeInputFormat) HoodieParquetInputFormat(org.apache.hudi.hadoop.HoodieParquetInputFormat)

Aggregations

HoodieIOException (org.apache.hudi.exception.HoodieIOException)1 HoodieHFileInputFormat (org.apache.hudi.hadoop.HoodieHFileInputFormat)1 HoodieParquetInputFormat (org.apache.hudi.hadoop.HoodieParquetInputFormat)1 HoodieHFileRealtimeInputFormat (org.apache.hudi.hadoop.realtime.HoodieHFileRealtimeInputFormat)1 HoodieParquetRealtimeInputFormat (org.apache.hudi.hadoop.realtime.HoodieParquetRealtimeInputFormat)1