Search in sources :

Example 6 with AcidInfo

use of io.trino.plugin.hive.AcidInfo in project trino by trinodb.

the class TestOrcPageSourceFactory method testReadWithAcidVersionValidationHive3.

@Test
public void testReadWithAcidVersionValidationHive3() throws Exception {
    File tableFile = new File(getResource("acid_version_validation/acid_version_hive_3/00000_0").toURI());
    String tablePath = tableFile.getParent();
    Optional<AcidInfo> acidInfo = AcidInfo.builder(new Path(tablePath)).setOrcAcidVersionValidated(false).build();
    List<Nation> result = readFile(Map.of(), OptionalLong.empty(), acidInfo, tableFile.getPath(), 625);
    assertEquals(result.size(), 1);
}
Also used : Path(org.apache.hadoop.fs.Path) Nation(io.trino.tpch.Nation) File(java.io.File) AcidInfo(io.trino.plugin.hive.AcidInfo) Test(org.testng.annotations.Test)

Example 7 with AcidInfo

use of io.trino.plugin.hive.AcidInfo in project trino by trinodb.

the class TestOrcPageSourceFactory method testDeletedRows.

@Test
public void testDeletedRows() {
    Path partitionLocation = new Path(getClass().getClassLoader().getResource("nation_delete_deltas") + "/");
    Optional<AcidInfo> acidInfo = AcidInfo.builder(partitionLocation).addDeleteDelta(new Path(partitionLocation, deleteDeltaSubdir(3L, 3L, 0))).addDeleteDelta(new Path(partitionLocation, deleteDeltaSubdir(4L, 4L, 0))).build();
    assertRead(ALL_COLUMNS, OptionalLong.empty(), acidInfo, nationKey -> nationKey == 5 || nationKey == 19);
}
Also used : Path(org.apache.hadoop.fs.Path) AcidInfo(io.trino.plugin.hive.AcidInfo) Test(org.testng.annotations.Test)

Aggregations

AcidInfo (io.trino.plugin.hive.AcidInfo)7 Path (org.apache.hadoop.fs.Path)7 Test (org.testng.annotations.Test)5 Preconditions.checkArgument (com.google.common.base.Preconditions.checkArgument)4 ImmutableList (com.google.common.collect.ImmutableList)4 ImmutableList.toImmutableList (com.google.common.collect.ImmutableList.toImmutableList)4 HiveColumnHandle (io.trino.plugin.hive.HiveColumnHandle)4 Domain (io.trino.spi.predicate.Domain)4 TupleDomain (io.trino.spi.predicate.TupleDomain)4 File (java.io.File)4 List (java.util.List)4 Map (java.util.Map)4 Optional (java.util.Optional)4 OptionalInt (java.util.OptionalInt)4 Properties (java.util.Properties)4 ImmutableMap (com.google.common.collect.ImmutableMap)3 FileFormatDataSourceStats (io.trino.plugin.hive.FileFormatDataSourceStats)3 REGULAR (io.trino.plugin.hive.HiveColumnHandle.ColumnType.REGULAR)3 HiveConfig (io.trino.plugin.hive.HiveConfig)3 HivePageSourceFactory (io.trino.plugin.hive.HivePageSourceFactory)3