Search in sources :

Example 1 with RecordReaderImpl

use of org.apache.orc.impl.RecordReaderImpl in project hive by apache.

the class TestCrudCompactorOnTez method checkBloomFilterInAcidFile.

private void checkBloomFilterInAcidFile(FileSystem fs, Path bucketFilePath) throws IOException {
    Reader orcReader = OrcFile.createReader(bucketFilePath, OrcFile.readerOptions(fs.getConf()).filesystem(fs));
    StripeInformation stripe = orcReader.getStripes().get(0);
    try (RecordReaderImpl rows = (RecordReaderImpl) orcReader.rows()) {
        boolean bloomFilter = rows.readStripeFooter(stripe).getStreamsList().stream().anyMatch(s -> s.getKind() == OrcProto.Stream.Kind.BLOOM_FILTER_UTF8 || s.getKind() == OrcProto.Stream.Kind.BLOOM_FILTER);
        Assert.assertTrue("Bloom filter is missing", bloomFilter);
    }
}
Also used : Reader(org.apache.orc.Reader) ProtoMessageReader(org.apache.tez.dag.history.logging.proto.ProtoMessageReader) RecordReader(org.apache.orc.RecordReader) StripeInformation(org.apache.orc.StripeInformation) RecordReaderImpl(org.apache.orc.impl.RecordReaderImpl)

Aggregations

Reader (org.apache.orc.Reader)1 RecordReader (org.apache.orc.RecordReader)1 StripeInformation (org.apache.orc.StripeInformation)1 RecordReaderImpl (org.apache.orc.impl.RecordReaderImpl)1 ProtoMessageReader (org.apache.tez.dag.history.logging.proto.ProtoMessageReader)1