Search in sources :

Example 6 with ColumnEncoding

use of org.apache.orc.OrcProto.ColumnEncoding in project hive by apache.

the class SerDeEncodedDataReader method processAsyncCacheData.

private void processAsyncCacheData(CacheWriter.CacheStripeData diskData, boolean[] splitIncludes) throws IOException {
    StripeData sliceToCache = new StripeData(diskData.knownTornStart, diskData.firstRowStart, diskData.lastRowStart, diskData.lastRowEnd, diskData.rowCount, diskData.encodings.toArray(new ColumnEncoding[diskData.encodings.size()]));
    for (int colIx = 0; colIx < splitIncludes.length; ++colIx) {
        if (!splitIncludes[colIx])
            continue;
        // The column has been read from disk.
        List<CacheWriter.CacheStreamData> streams = diskData.colStreams.get(colIx);
        LlapDataBuffer[][] newCacheDataForCol = createArrayToCache(sliceToCache, colIx, streams);
        // Struct column, such as root?
        if (streams == null)
            continue;
        Iterator<CacheWriter.CacheStreamData> iter = streams.iterator();
        while (iter.hasNext()) {
            CacheWriter.CacheStreamData stream = iter.next();
            if (stream.isSuppressed) {
                if (LlapIoImpl.LOG.isTraceEnabled()) {
                    LlapIoImpl.LOG.trace("Removing a suppressed stream " + stream.name);
                }
                iter.remove();
                discardUncachedBuffers(stream.data);
                continue;
            }
            setStreamDataToCache(newCacheDataForCol, stream);
        }
    }
    if (LlapIoImpl.CACHE_LOGGER.isTraceEnabled()) {
        LlapIoImpl.CACHE_LOGGER.trace("Data to cache from async read " + sliceToCache);
    }
    try {
        cacheFileData(sliceToCache);
    } finally {
        unlockAllBuffers(sliceToCache);
    }
}
Also used : ColumnEncoding(org.apache.orc.OrcProto.ColumnEncoding) StripeData(org.apache.hadoop.hive.llap.cache.SerDeLowLevelCacheImpl.StripeData) CacheWriter(org.apache.hadoop.hive.llap.io.encoded.SerDeEncodedDataReader.CacheWriter)

Aggregations

ColumnEncoding (org.apache.orc.OrcProto.ColumnEncoding)6 StripeData (org.apache.hadoop.hive.llap.cache.SerDeLowLevelCacheImpl.StripeData)3 LlapDataBuffer (org.apache.hadoop.hive.llap.cache.LlapDataBuffer)2 SerDeStripeMetadata (org.apache.hadoop.hive.llap.io.decode.GenericColumnVectorProducer.SerDeStripeMetadata)2 CacheWriter (org.apache.hadoop.hive.llap.io.encoded.SerDeEncodedDataReader.CacheWriter)2 OrcEncodedColumnBatch (org.apache.hadoop.hive.ql.io.orc.encoded.Reader.OrcEncodedColumnBatch)2 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 ColumnStreamData (org.apache.hadoop.hive.common.io.encoded.EncodedColumnBatch.ColumnStreamData)1 FileData (org.apache.hadoop.hive.llap.cache.SerDeLowLevelCacheImpl.FileData)1 ColumnVector (org.apache.hadoop.hive.ql.exec.vector.ColumnVector)1