Search in sources :

Example 1 with DwrfMetadataReader

use of com.facebook.presto.orc.metadata.DwrfMetadataReader in project presto by prestodb.

the class OrcTester method assertRoundTrip.

public void assertRoundTrip(ObjectInspector objectInspector, Iterable<?> readValues, Type type) throws Exception {
    for (Format formatVersion : formats) {
        MetadataReader metadataReader;
        if (DWRF == formatVersion) {
            if (hasType(objectInspector, PrimitiveCategory.DATE)) {
                // DWRF doesn't support dates
                return;
            }
            if (hasType(objectInspector, PrimitiveCategory.DECIMAL)) {
                // DWRF doesn't support decimals
                return;
            }
            if (hasType(objectInspector, PrimitiveCategory.CHAR)) {
                // DWRF doesn't support chars
                return;
            }
            metadataReader = new DwrfMetadataReader();
        } else {
            metadataReader = new OrcMetadataReader();
        }
        for (Compression compression : compressions) {
            try (TempFile tempFile = new TempFile()) {
                writeOrcColumn(tempFile.getFile(), formatVersion, compression, objectInspector, readValues.iterator());
                assertFileContents(objectInspector, tempFile, readValues, false, false, metadataReader, type);
                if (skipBatchTestsEnabled) {
                    assertFileContents(objectInspector, tempFile, readValues, true, false, metadataReader, type);
                }
                if (skipStripeTestsEnabled) {
                    assertFileContents(objectInspector, tempFile, readValues, false, true, metadataReader, type);
                }
            }
        }
    }
}
Also used : OrcOutputFormat(org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat) OrcMetadataReader(com.facebook.presto.orc.metadata.OrcMetadataReader) OrcMetadataReader(com.facebook.presto.orc.metadata.OrcMetadataReader) DwrfMetadataReader(com.facebook.presto.orc.metadata.DwrfMetadataReader) MetadataReader(com.facebook.presto.orc.metadata.MetadataReader) DwrfMetadataReader(com.facebook.presto.orc.metadata.DwrfMetadataReader)

Example 2 with DwrfMetadataReader

use of com.facebook.presto.orc.metadata.DwrfMetadataReader in project presto by prestodb.

the class TestStorageOrcFileTailSource method setUp.

@BeforeMethod
public void setUp() throws Exception {
    this.file = new TempFile();
    this.metadataReader = new DwrfMetadataReader(new RuntimeStats());
}
Also used : RuntimeStats(com.facebook.presto.common.RuntimeStats) DwrfMetadataReader(com.facebook.presto.orc.metadata.DwrfMetadataReader) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

DwrfMetadataReader (com.facebook.presto.orc.metadata.DwrfMetadataReader)2 RuntimeStats (com.facebook.presto.common.RuntimeStats)1 MetadataReader (com.facebook.presto.orc.metadata.MetadataReader)1 OrcMetadataReader (com.facebook.presto.orc.metadata.OrcMetadataReader)1 OrcOutputFormat (org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat)1 BeforeMethod (org.testng.annotations.BeforeMethod)1