Search in sources :

Example 16 with MetadataEntry

use of io.trino.plugin.deltalake.transactionlog.MetadataEntry in project trino by trinodb.

the class TestTransactionLogAccess method testGetMetadataEntry.

@Test
public void testGetMetadataEntry() throws Exception {
    setupTransactionLogAccess("person");
    MetadataEntry metadataEntry = transactionLogAccess.getMetadataEntry(tableSnapshot, SESSION).get();
    assertEquals(metadataEntry.getCreatedTime(), 1579190100722L);
    assertEquals(metadataEntry.getId(), "b6aeffad-da73-4dde-b68e-937e468b1fdf");
    assertThat(metadataEntry.getOriginalPartitionColumns()).containsOnly("age");
    assertThat(metadataEntry.getCanonicalPartitionColumns()).containsOnly("age");
    MetadataEntry.Format format = metadataEntry.getFormat();
    assertEquals(format.getOptions().keySet().size(), 0);
    assertEquals(format.getProvider(), "parquet");
    assertEquals(tableSnapshot.getCachedMetadata(), Optional.of(metadataEntry));
}
Also used : MetadataEntry(io.trino.plugin.deltalake.transactionlog.MetadataEntry) Test(org.testng.annotations.Test)

Aggregations

MetadataEntry (io.trino.plugin.deltalake.transactionlog.MetadataEntry)16 Test (org.testng.annotations.Test)9 ProtocolEntry (io.trino.plugin.deltalake.transactionlog.ProtocolEntry)6 AddFileEntry (io.trino.plugin.deltalake.transactionlog.AddFileEntry)5 Path (org.apache.hadoop.fs.Path)5 TableSnapshot (io.trino.plugin.deltalake.transactionlog.TableSnapshot)4 Table (io.trino.plugin.hive.metastore.Table)4 TrinoException (io.trino.spi.TrinoException)4 RemoveFileEntry (io.trino.plugin.deltalake.transactionlog.RemoveFileEntry)3 Block (io.trino.spi.block.Block)3 ImmutableSet.toImmutableSet (com.google.common.collect.ImmutableSet.toImmutableSet)2 DeltaLakeTableHandle (io.trino.plugin.deltalake.DeltaLakeTableHandle)2 DeltaLakeStatistics (io.trino.plugin.deltalake.statistics.DeltaLakeStatistics)2 DeltaLakeTransactionLogEntry (io.trino.plugin.deltalake.transactionlog.DeltaLakeTransactionLogEntry)2 TransactionEntry (io.trino.plugin.deltalake.transactionlog.TransactionEntry)2 DeltaLakeParquetFileStatistics (io.trino.plugin.deltalake.transactionlog.statistics.DeltaLakeParquetFileStatistics)2 RowBlock (io.trino.spi.block.RowBlock)2 Utils.nativeValueToBlock (io.trino.spi.predicate.Utils.nativeValueToBlock)2 TypeManager (io.trino.spi.type.TypeManager)2 File (java.io.File)2