Search in sources :

Example 6 with MetadataVersion

use of org.apache.drill.exec.store.parquet.metadata.MetadataVersion in project drill by apache.

the class TestParquetMetadataVersion method testMinorVersion.

@Test
public void testMinorVersion() throws Exception {
    MetadataVersion withMinorVersion = new MetadataVersion("3.1");
    MetadataVersion expectedVersionWithMinorVersion = new MetadataVersion(3, 1);
    assertEquals("Parquet metadata version is parsed incorrectly", expectedVersionWithMinorVersion, withMinorVersion);
}
Also used : MetadataVersion(org.apache.drill.exec.store.parquet.metadata.MetadataVersion) BaseTest(org.apache.drill.test.BaseTest) ParquetTest(org.apache.drill.categories.ParquetTest) UnlikelyTest(org.apache.drill.categories.UnlikelyTest) Test(org.junit.Test)

Example 7 with MetadataVersion

use of org.apache.drill.exec.store.parquet.metadata.MetadataVersion in project drill by apache.

the class TestParquetMetadataVersion method testTwoDigitsMinorVersion.

@Test
public void testTwoDigitsMinorVersion() throws Exception {
    MetadataVersion twoDigitsMinorVersion = new MetadataVersion("3.13");
    MetadataVersion expectedVersionWithTwoDigitsMinorVersion = new MetadataVersion(3, 13);
    assertEquals("Parquet metadata version is parsed incorrectly", expectedVersionWithTwoDigitsMinorVersion, twoDigitsMinorVersion);
}
Also used : MetadataVersion(org.apache.drill.exec.store.parquet.metadata.MetadataVersion) BaseTest(org.apache.drill.test.BaseTest) ParquetTest(org.apache.drill.categories.ParquetTest) UnlikelyTest(org.apache.drill.categories.UnlikelyTest) Test(org.junit.Test)

Example 8 with MetadataVersion

use of org.apache.drill.exec.store.parquet.metadata.MetadataVersion in project drill by apache.

the class TestParquetMetadataVersion method testAfter.

@Test
public void testAfter() {
    MetadataVersion version = new MetadataVersion(4, 1);
    assertFalse(version.isHigherThan(4, 1));
    assertFalse(version.isHigherThan(4, 3));
    assertFalse(version.isHigherThan(5, 0));
    assertTrue(version.isHigherThan(4, 0));
    assertTrue(version.isHigherThan(3, 0));
    assertTrue(version.isHigherThan(2, 1));
    assertTrue(version.isHigherThan(1, 3));
    assertTrue(version.isHigherThan(1, 0));
}
Also used : MetadataVersion(org.apache.drill.exec.store.parquet.metadata.MetadataVersion) BaseTest(org.apache.drill.test.BaseTest) ParquetTest(org.apache.drill.categories.ParquetTest) UnlikelyTest(org.apache.drill.categories.UnlikelyTest) Test(org.junit.Test)

Example 9 with MetadataVersion

use of org.apache.drill.exec.store.parquet.metadata.MetadataVersion in project drill by apache.

the class TestParquetMetadataVersion method testTwoDigitsMajorVersion.

@Test
public void testTwoDigitsMajorVersion() throws Exception {
    MetadataVersion twoDigitsMetadataVersion = new MetadataVersion("10.2");
    MetadataVersion expectedVersion = new MetadataVersion(10, 2);
    assertEquals("Parquet metadata version is parsed incorrectly", expectedVersion, twoDigitsMetadataVersion);
}
Also used : MetadataVersion(org.apache.drill.exec.store.parquet.metadata.MetadataVersion) BaseTest(org.apache.drill.test.BaseTest) ParquetTest(org.apache.drill.categories.ParquetTest) UnlikelyTest(org.apache.drill.categories.UnlikelyTest) Test(org.junit.Test)

Example 10 with MetadataVersion

use of org.apache.drill.exec.store.parquet.metadata.MetadataVersion in project drill by apache.

the class TestParquetMetadataVersion method testAtLeast.

@Test
public void testAtLeast() {
    MetadataVersion version = new MetadataVersion("v4.2");
    assertTrue(version.isAtLeast(4, 0));
    assertTrue(version.isAtLeast(4, 1));
    assertTrue(version.isAtLeast(4, 2));
    assertFalse(version.isAtLeast(4, 3));
    assertFalse(version.isAtLeast(5, 1));
    assertTrue(version.isAtLeast(3, 0));
    assertTrue(version.isAtLeast(1, 0));
}
Also used : MetadataVersion(org.apache.drill.exec.store.parquet.metadata.MetadataVersion) BaseTest(org.apache.drill.test.BaseTest) ParquetTest(org.apache.drill.categories.ParquetTest) UnlikelyTest(org.apache.drill.categories.UnlikelyTest) Test(org.junit.Test)

Aggregations

MetadataVersion (org.apache.drill.exec.store.parquet.metadata.MetadataVersion)15 UnlikelyTest (org.apache.drill.categories.UnlikelyTest)10 Test (org.junit.Test)10 ParquetTest (org.apache.drill.categories.ParquetTest)9 BaseTest (org.apache.drill.test.BaseTest)9 TypeProtos (org.apache.drill.common.types.TypeProtos)3 LinkedHashMap (java.util.LinkedHashMap)2 SchemaPath (org.apache.drill.common.expression.SchemaPath)2 MetadataBase (org.apache.drill.exec.store.parquet.metadata.MetadataBase)2 ColumnMetadata (org.apache.drill.exec.store.parquet.metadata.MetadataBase.ColumnMetadata)2 ParquetFileMetadata (org.apache.drill.exec.store.parquet.metadata.MetadataBase.ParquetFileMetadata)2 RowGroupMetadata (org.apache.drill.exec.store.parquet.metadata.MetadataBase.RowGroupMetadata)2 Metadata_V4 (org.apache.drill.exec.store.parquet.metadata.Metadata_V4)2 OriginalType (org.apache.parquet.schema.OriginalType)2 File (java.io.File)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 ColumnTypeMetadata_v2 (org.apache.drill.exec.store.parquet.metadata.Metadata_V2.ColumnTypeMetadata_v2)1 Stopwatch (org.apache.drill.shaded.guava.com.google.common.base.Stopwatch)1 Category (org.junit.experimental.categories.Category)1