diff --git a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/checkpoint/CheckpointEntryIterator.java b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/checkpoint/CheckpointEntryIterator.java index 353a291027eb..85c1bed2be34 100644 --- a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/checkpoint/CheckpointEntryIterator.java +++ b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/checkpoint/CheckpointEntryIterator.java @@ -521,8 +521,12 @@ private DeltaLakeTransactionLogEntry buildTxnEntry(ConnectorSession session, Blo return DeltaLakeTransactionLogEntry.transactionEntry(result); } + @Nullable private String getString(Block block, int position) { + if (block.isNull(position)) { + return null; + } return block.getSlice(position, 0, block.getSliceLength(position)).toString(UTF_8); } diff --git a/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/transactionlog/checkpoint/TestCheckpointEntryIterator.java b/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/transactionlog/checkpoint/TestCheckpointEntryIterator.java index 984ad11f7823..3c8109f189c1 100644 --- a/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/transactionlog/checkpoint/TestCheckpointEntryIterator.java +++ b/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/transactionlog/checkpoint/TestCheckpointEntryIterator.java @@ -87,8 +87,8 @@ public void testReadMetadataEntry() .isEqualTo( new MetadataEntry( "b6aeffad-da73-4dde-b68e-937e468b1fde", - "", - "", + null, + null, new MetadataEntry.Format("parquet", Map.of()), "{\"type\":\"struct\",\"fields\":[" + "{\"name\":\"name\",\"type\":\"string\",\"nullable\":true,\"metadata\":{}}," +