Search in sources :

Example 1 with HoodieOrcReader

use of org.apache.hudi.io.storage.HoodieOrcReader in project hudi by apache.

the class TableSchemaResolver method readSchemaFromORCBaseFile.

/**
 * Read the parquet schema from a ORC file.
 */
public MessageType readSchemaFromORCBaseFile(Path orcFilePath) throws IOException {
    LOG.info("Reading schema from " + orcFilePath);
    FileSystem fs = metaClient.getRawFs();
    HoodieOrcReader<IndexedRecord> orcReader = new HoodieOrcReader<>(fs.getConf(), orcFilePath);
    return convertAvroSchemaToParquet(orcReader.getSchema());
}
Also used : IndexedRecord(org.apache.avro.generic.IndexedRecord) FileSystem(org.apache.hadoop.fs.FileSystem) HoodieOrcReader(org.apache.hudi.io.storage.HoodieOrcReader)

Aggregations

IndexedRecord (org.apache.avro.generic.IndexedRecord)1 FileSystem (org.apache.hadoop.fs.FileSystem)1 HoodieOrcReader (org.apache.hudi.io.storage.HoodieOrcReader)1