diff --git a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeMetadata.java b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeMetadata.java index ca70235b60d8..e9bbf1b4edd9 100644 --- a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeMetadata.java +++ b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/DeltaLakeMetadata.java @@ -3090,7 +3090,8 @@ private CommitInfoEntry getCommitInfoEntry( "trino-" + nodeVersion + "-" + nodeId, readVersion, isolationLevel.getValue(), - Optional.of(isBlindAppend)); + Optional.of(isBlindAppend), + ImmutableMap.of()); } @Override diff --git a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/CommitInfoEntry.java b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/CommitInfoEntry.java index 44a99a59ae61..8289774341a3 100644 --- a/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/CommitInfoEntry.java +++ b/plugin/trino-delta-lake/src/main/java/io/trino/plugin/deltalake/transactionlog/CommitInfoEntry.java @@ -30,7 +30,8 @@ public record CommitInfoEntry( String clusterId, long readVersion, String isolationLevel, - Optional isBlindAppend) + Optional isBlindAppend, + Map operationMetrics) { public CommitInfoEntry { @@ -39,7 +40,7 @@ public record CommitInfoEntry( public CommitInfoEntry withVersion(long version) { - return new CommitInfoEntry(version, timestamp, userId, userName, operation, operationParameters, job, notebook, clusterId, readVersion, isolationLevel, isBlindAppend); + return new CommitInfoEntry(version, timestamp, userId, userName, operation, operationParameters, job, notebook, clusterId, readVersion, isolationLevel, isBlindAppend, operationMetrics); } public record Job(String jobId, String jobName, String runId, String jobOwnerId, String triggerType) {} 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 ff31cdbd8857..a8f1998803e3 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 @@ -454,7 +454,8 @@ private DeltaLakeTransactionLogEntry buildCommitInfoEntry(ConnectorSession sessi commitInfo.getString("clusterId"), commitInfo.getInt("readVersion"), commitInfo.getString("isolationLevel"), - Optional.of(commitInfo.getBoolean("isBlindAppend"))); + Optional.of(commitInfo.getBoolean("isBlindAppend")), + commitInfo.getMap(stringMap, "operationMetrics")); log.debug("Result: %s", result); return DeltaLakeTransactionLogEntry.commitInfoEntry(result); } diff --git a/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/TestDeltaLakeAlluxioCacheFileOperations.java b/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/TestDeltaLakeAlluxioCacheFileOperations.java index cc6902dc0578..32bdc7c2cb7c 100644 --- a/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/TestDeltaLakeAlluxioCacheFileOperations.java +++ b/plugin/trino-delta-lake/src/test/java/io/trino/plugin/deltalake/TestDeltaLakeAlluxioCacheFileOperations.java @@ -84,15 +84,15 @@ public void testCacheFileOperations() assertFileSystemAccesses( "SELECT * FROM test_cache_file_operations", ImmutableMultiset.builder() - .add(new CacheOperation("Alluxio.readCached", "00000000000000000000.json", 0, 794)) + .add(new CacheOperation("Alluxio.readCached", "00000000000000000000.json", 0, 816)) .add(new CacheOperation("InputFile.length", "00000000000000000000.json")) - .add(new CacheOperation("Alluxio.readCached", "00000000000000000001.json", 0, 636)) + .add(new CacheOperation("Alluxio.readCached", "00000000000000000001.json", 0, 658)) .add(new CacheOperation("InputFile.length", "00000000000000000001.json")) - .add(new CacheOperation("Alluxio.readCached", "00000000000000000002.json", 0, 636)) + .add(new CacheOperation("Alluxio.readCached", "00000000000000000002.json", 0, 658)) .add(new CacheOperation("InputFile.length", "00000000000000000002.json")) - .add(new CacheOperation("Alluxio.readExternalStream", "00000000000000000002.json", 0, 636)) + .add(new CacheOperation("Alluxio.readExternalStream", "00000000000000000002.json", 0, 658)) .add(new CacheOperation("InputFile.newStream", "00000000000000000002.json")) - .add(new CacheOperation("Alluxio.writeCache", "00000000000000000002.json", 0, 636)) + .add(new CacheOperation("Alluxio.writeCache", "00000000000000000002.json", 0, 658)) .add(new CacheOperation("InputFile.length", "00000000000000000003.json")) .add(new CacheOperation("InputFile.newStream", "_last_checkpoint")) .add(new CacheOperation("Alluxio.readCached", "key=p1/", 0, 220)) @@ -105,11 +105,11 @@ public void testCacheFileOperations() assertFileSystemAccesses( "SELECT * FROM test_cache_file_operations", ImmutableMultiset.builder() - .add(new CacheOperation("Alluxio.readCached", "00000000000000000000.json", 0, 794)) + .add(new CacheOperation("Alluxio.readCached", "00000000000000000000.json", 0, 816)) .add(new CacheOperation("InputFile.length", "00000000000000000000.json")) - .add(new CacheOperation("Alluxio.readCached", "00000000000000000001.json", 0, 636)) + .add(new CacheOperation("Alluxio.readCached", "00000000000000000001.json", 0, 658)) .add(new CacheOperation("InputFile.length", "00000000000000000001.json")) - .add(new CacheOperation("Alluxio.readCached", "00000000000000000002.json", 0, 636)) + .add(new CacheOperation("Alluxio.readCached", "00000000000000000002.json", 0, 658)) .add(new CacheOperation("InputFile.length", "00000000000000000002.json")) .add(new CacheOperation("InputFile.length", "00000000000000000003.json")) .add(new CacheOperation("InputFile.newStream", "_last_checkpoint")) @@ -122,19 +122,19 @@ public void testCacheFileOperations() assertFileSystemAccesses( "SELECT * FROM test_cache_file_operations", ImmutableMultiset.builder() - .add(new CacheOperation("Alluxio.readCached", "00000000000000000000.json", 0, 794)) + .add(new CacheOperation("Alluxio.readCached", "00000000000000000000.json", 0, 816)) .add(new CacheOperation("InputFile.length", "00000000000000000000.json")) - .add(new CacheOperation("Alluxio.readCached", "00000000000000000001.json", 0, 636)) + .add(new CacheOperation("Alluxio.readCached", "00000000000000000001.json", 0, 658)) .add(new CacheOperation("InputFile.length", "00000000000000000001.json")) - .add(new CacheOperation("Alluxio.readCached", "00000000000000000002.json", 0, 636)) + .add(new CacheOperation("Alluxio.readCached", "00000000000000000002.json", 0, 658)) .add(new CacheOperation("InputFile.length", "00000000000000000002.json")) - .add(new CacheOperation("Alluxio.readCached", "00000000000000000003.json", 0, 636)) + .add(new CacheOperation("Alluxio.readCached", "00000000000000000003.json", 0, 658)) .add(new CacheOperation("InputFile.length", "00000000000000000003.json")) - .add(new CacheOperation("Alluxio.readCached", "00000000000000000004.json", 0, 636)) + .add(new CacheOperation("Alluxio.readCached", "00000000000000000004.json", 0, 658)) .add(new CacheOperation("InputFile.length", "00000000000000000004.json")) - .add(new CacheOperation("Alluxio.readCached", "00000000000000000005.json", 0, 636)) - .add(new CacheOperation("Alluxio.readExternalStream", "00000000000000000005.json", 0, 636)) - .add(new CacheOperation("Alluxio.writeCache", "00000000000000000005.json", 0, 636)) + .add(new CacheOperation("Alluxio.readCached", "00000000000000000005.json", 0, 658)) + .add(new CacheOperation("Alluxio.readExternalStream", "00000000000000000005.json", 0, 658)) + .add(new CacheOperation("Alluxio.writeCache", "00000000000000000005.json", 0, 658)) .add(new CacheOperation("InputFile.newStream", "00000000000000000005.json")) .add(new CacheOperation("InputFile.length", "00000000000000000005.json")) .add(new CacheOperation("InputFile.length", "00000000000000000006.json")) @@ -154,17 +154,17 @@ public void testCacheFileOperations() assertFileSystemAccesses( "SELECT * FROM test_cache_file_operations", ImmutableMultiset.builder() - .add(new CacheOperation("Alluxio.readCached", "00000000000000000000.json", 0, 794)) + .add(new CacheOperation("Alluxio.readCached", "00000000000000000000.json", 0, 816)) .add(new CacheOperation("InputFile.length", "00000000000000000000.json")) - .add(new CacheOperation("Alluxio.readCached", "00000000000000000001.json", 0, 636)) + .add(new CacheOperation("Alluxio.readCached", "00000000000000000001.json", 0, 658)) .add(new CacheOperation("InputFile.length", "00000000000000000001.json")) - .add(new CacheOperation("Alluxio.readCached", "00000000000000000002.json", 0, 636)) + .add(new CacheOperation("Alluxio.readCached", "00000000000000000002.json", 0, 658)) .add(new CacheOperation("InputFile.length", "00000000000000000002.json")) - .add(new CacheOperation("Alluxio.readCached", "00000000000000000003.json", 0, 636)) + .add(new CacheOperation("Alluxio.readCached", "00000000000000000003.json", 0, 658)) .add(new CacheOperation("InputFile.length", "00000000000000000003.json")) - .add(new CacheOperation("Alluxio.readCached", "00000000000000000004.json", 0, 636)) + .add(new CacheOperation("Alluxio.readCached", "00000000000000000004.json", 0, 658)) .add(new CacheOperation("InputFile.length", "00000000000000000004.json")) - .add(new CacheOperation("Alluxio.readCached", "00000000000000000005.json", 0, 636)) + .add(new CacheOperation("Alluxio.readCached", "00000000000000000005.json", 0, 658)) .add(new CacheOperation("InputFile.length", "00000000000000000005.json")) .add(new CacheOperation("InputFile.length", "00000000000000000006.json")) .add(new CacheOperation("InputFile.newStream", "_last_checkpoint")) @@ -488,10 +488,10 @@ public void testCreateOrReplaceTable() assertFileSystemAccesses("CREATE OR REPLACE TABLE test_create_or_replace (id VARCHAR, age INT)", ImmutableMultiset.builder() - .add(new CacheOperation("Alluxio.readCached", "00000000000000000000.json", 0, 799)) - .add(new CacheOperation("Alluxio.readExternalStream", "00000000000000000000.json", 0, 799)) + .add(new CacheOperation("Alluxio.readCached", "00000000000000000000.json", 0, 821)) + .add(new CacheOperation("Alluxio.readExternalStream", "00000000000000000000.json", 0, 821)) .add(new CacheOperation("InputFile.newStream", "00000000000000000000.json")) - .add(new CacheOperation("Alluxio.writeCache", "00000000000000000000.json", 0, 799)) + .add(new CacheOperation("Alluxio.writeCache", "00000000000000000000.json", 0, 821)) .add(new CacheOperation("InputFile.length", "00000000000000000000.json")) .add(new CacheOperation("InputFile.exists", "00000000000000000001.json")) .add(new CacheOperation("InputFile.length", "00000000000000000001.json")) @@ -515,9 +515,9 @@ public void testCreateOrReplaceTableAsSelect() assertFileSystemAccesses( "CREATE OR REPLACE TABLE test_create_or_replace_as_select AS SELECT 1 col_name", ImmutableMultiset.builder() - .add(new CacheOperation("Alluxio.readCached", "00000000000000000000.json", 0, 1041)) - .add(new CacheOperation("Alluxio.readExternalStream", "00000000000000000000.json", 0, 1041)) - .add(new CacheOperation("Alluxio.writeCache", "00000000000000000000.json", 0, 1041)) + .add(new CacheOperation("Alluxio.readCached", "00000000000000000000.json", 0, 1063)) + .add(new CacheOperation("Alluxio.readExternalStream", "00000000000000000000.json", 0, 1063)) + .add(new CacheOperation("Alluxio.writeCache", "00000000000000000000.json", 0, 1063)) .add(new CacheOperation("InputFile.newStream", "00000000000000000000.json")) .add(new CacheOperation("InputFile.length", "00000000000000000000.json")) .add(new CacheOperation("InputFile.length", "00000000000000000001.json"))