From 77732ca658a3483b45fa6e2997eadfc3ab9f85da Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Wed, 7 Jan 2026 13:32:35 +0100 Subject: [PATCH 1/2] chore(trino): Backport Kafka offset handling to 477 Backport https://github.com/trinodb/trino/pull/26789 to Trino 477 --- ...indOffsetsForTimestampGreaterOrEqual.patch | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 trino/trino/stackable/patches/477/0003-Fix-findOffsetsForTimestampGreaterOrEqual.patch diff --git a/trino/trino/stackable/patches/477/0003-Fix-findOffsetsForTimestampGreaterOrEqual.patch b/trino/trino/stackable/patches/477/0003-Fix-findOffsetsForTimestampGreaterOrEqual.patch new file mode 100644 index 000000000..b1c760f54 --- /dev/null +++ b/trino/trino/stackable/patches/477/0003-Fix-findOffsetsForTimestampGreaterOrEqual.patch @@ -0,0 +1,26 @@ +From a46ead926108b561ca6fa6b193dd38db5a8cb125 Mon Sep 17 00:00:00 2001 +From: Sebastian Bernauer +Date: Wed, 7 Jan 2026 13:30:17 +0100 +Subject: Fix findOffsetsForTimestampGreaterOrEqual + +Back-port of https://github.com/trinodb/trino/pull/26789 + +Co-authored-by: Mateusz "Serafin" Gajewski +--- + .../main/java/io/trino/plugin/kafka/KafkaFilterManager.java | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/plugin/trino-kafka/src/main/java/io/trino/plugin/kafka/KafkaFilterManager.java b/plugin/trino-kafka/src/main/java/io/trino/plugin/kafka/KafkaFilterManager.java +index 5c853d9011..25d3c83301 100644 +--- a/plugin/trino-kafka/src/main/java/io/trino/plugin/kafka/KafkaFilterManager.java ++++ b/plugin/trino-kafka/src/main/java/io/trino/plugin/kafka/KafkaFilterManager.java +@@ -182,8 +182,7 @@ public class KafkaFilterManager + { + Map topicPartitionOffsetAndTimestamps = kafkaConsumer.offsetsForTimes(timestamps); + return topicPartitionOffsetAndTimestamps.entrySet().stream() +- .collect(toMap(Map.Entry::getKey, entry -> Optional.of(entry.getValue()) +- .map(OffsetAndTimestamp::offset))); ++ .collect(toMap(Map.Entry::getKey, entry -> Optional.ofNullable(entry.getValue()).map(OffsetAndTimestamp::offset))); + } + + private static Map overridePartitionBeginOffsets(Map partitionBeginOffsets, From f42c92116d3d7cf995b2fb5987fa00b209b86751 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Wed, 7 Jan 2026 17:14:42 +0100 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a0f6211a..3d1e11d13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ All notable changes to this project will be documented in this file. - testing-tools: refactoring: Split image into multiple images, remove unnecessary components and switch to UBI as base image ([#1354]). - hive: fixed 4.0.1 shaded hive-metastore-opa-authorizer jar by relocating dependencies ([#1356]). - testing-tools: fix: add kubectl and openssl ([#1367]). +- trino: Backport Kafka offset handling to 477 ([#1373]). ### Removed @@ -32,6 +33,7 @@ All notable changes to this project will be documented in this file. [#1357]: https://github.com/stackabletech/docker-images/pull/1357 [#1358]: https://github.com/stackabletech/docker-images/pull/1358 [#1367]: https://github.com/stackabletech/docker-images/pull/1367 +[#1373]: https://github.com/stackabletech/docker-images/pull/1373 ## [25.11.0] - 2025-11-07