From 47a255f049891c663ea05be96d99595eb9725983 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Wa=C5=9B?= Date: Mon, 16 Oct 2023 11:39:28 +0200 Subject: [PATCH] Update dependencies --- pom.xml | 16 ++++++++-------- .../trino/storage/StoragePageSourceProvider.java | 8 +++++++- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/pom.xml b/pom.xml index 41a88c9..a5a6b73 100644 --- a/pom.xml +++ b/pom.xml @@ -45,17 +45,17 @@ true false - 428 - 235 + 429 + 237 2.2 - 1.30.1 - 1.30.0 + 1.31.0 + 1.31.0 ${dep.airlift.version} - 1.12.561 - 32.1.2-jre + 1.12.566 + 32.1.3-jre 7.0.0 2.22.0 - 2.15.2 + 2.15.3 1.19.1 3.3.3 7.8.0 @@ -78,7 +78,7 @@ net.bytebuddy byte-buddy - 1.14.8 + 1.14.9 net.java.dev.jna diff --git a/src/main/java/org/ebyhr/trino/storage/StoragePageSourceProvider.java b/src/main/java/org/ebyhr/trino/storage/StoragePageSourceProvider.java index 25f7122..f3344a7 100644 --- a/src/main/java/org/ebyhr/trino/storage/StoragePageSourceProvider.java +++ b/src/main/java/org/ebyhr/trino/storage/StoragePageSourceProvider.java @@ -14,6 +14,7 @@ package org.ebyhr.trino.storage; import com.google.inject.Inject; +import io.trino.spi.Page; import io.trino.spi.connector.ColumnHandle; import io.trino.spi.connector.ConnectorPageSource; import io.trino.spi.connector.ConnectorPageSourceProvider; @@ -29,8 +30,10 @@ import org.ebyhr.trino.storage.operator.PluginFactory; import java.util.List; +import java.util.stream.StreamSupport; import static java.util.Objects.requireNonNull; +import static java.util.stream.Collectors.toList; import static org.ebyhr.trino.storage.StorageSplit.Mode.LIST; public class StoragePageSourceProvider @@ -65,7 +68,10 @@ public ConnectorPageSource createPageSource( FilePlugin plugin = PluginFactory.create(schemaName); try { - return new FixedPageSource(plugin.getPagesIterator(tableName, path -> storageClient.getInputStream(session, path))); + Iterable iterable = plugin.getPagesIterator(tableName, path -> storageClient.getInputStream(session, path)); + List pages = StreamSupport.stream(iterable.spliterator(), false) + .collect(toList()); + return new FixedPageSource(pages); } catch (UnsupportedOperationException ignored) { // Ignore it when a plugin doesn't implement getPagesIterator