Search in sources :

Example 1 with OrcSplit

use of org.apache.hadoop.hive.ql.io.orc.OrcSplit in project hive by apache.

the class OrcEncodedDataReader method ensureOrcReader.

/**
   * Ensures orcReader is initialized for the split.
   */
private void ensureOrcReader() throws IOException {
    if (orcReader != null)
        return;
    path = split.getPath();
    if (fileKey instanceof Long && HiveConf.getBoolVar(conf, ConfVars.LLAP_IO_USE_FILEID_PATH)) {
        path = HdfsUtils.getFileIdPath(fs, path, (long) fileKey);
    }
    LlapIoImpl.ORC_LOGGER.trace("Creating reader for {} ({})", path, split.getPath());
    long startTime = counters.startTimeCounter();
    ReaderOptions opts = OrcFile.readerOptions(conf).filesystem(fs).fileMetadata(fileMetadata);
    if (split instanceof OrcSplit) {
        OrcTail orcTail = ((OrcSplit) split).getOrcTail();
        if (orcTail != null) {
            LlapIoImpl.ORC_LOGGER.debug("Setting OrcTail. path={}", path);
            opts.orcTail(orcTail);
        }
    }
    orcReader = EncodedOrcFile.createReader(path, opts);
    counters.incrTimeCounter(LlapIOCounters.HDFS_TIME_NS, startTime);
}
Also used : ReaderOptions(org.apache.hadoop.hive.ql.io.orc.OrcFile.ReaderOptions) OrcSplit(org.apache.hadoop.hive.ql.io.orc.OrcSplit) OrcTail(org.apache.orc.impl.OrcTail)

Aggregations

ReaderOptions (org.apache.hadoop.hive.ql.io.orc.OrcFile.ReaderOptions)1 OrcSplit (org.apache.hadoop.hive.ql.io.orc.OrcSplit)1 OrcTail (org.apache.orc.impl.OrcTail)1