From ab0c5fad51d655cc3befd6ba5faf5d6d42ff7801 Mon Sep 17 00:00:00 2001 From: "Mateusz \"Serafin\" Gajewski" Date: Tue, 16 Apr 2024 13:26:09 +0200 Subject: [PATCH] Update to Phoenix 5.2.0 --- plugin/trino-phoenix5/pom.xml | 94 +++++++------------ .../trino/plugin/phoenix5/PhoenixClient.java | 2 +- .../plugin/phoenix5/PhoenixClientModule.java | 5 +- .../plugin/phoenix5/PhoenixSplitManager.java | 2 +- pom.xml | 11 +-- 5 files changed, 39 insertions(+), 75 deletions(-) diff --git a/plugin/trino-phoenix5/pom.xml b/plugin/trino-phoenix5/pom.xml index 18aa2d7ef050..655b45dddf96 100644 --- a/plugin/trino-phoenix5/pom.xml +++ b/plugin/trino-phoenix5/pom.xml @@ -15,7 +15,8 @@ ${project.parent.basedir} - 2.2.7 + 2.5.8 + 5.2.0 ${air.test.jvm.additional-arguments.default} --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED @@ -57,23 +58,17 @@ trino-base-jdbc - io.trino - trino-phoenix5-patched + trino-plugin-toolkit - org.apache.phoenix - * + org.slf4j + slf4j-api - - io.trino - trino-plugin-toolkit - - jakarta.annotation jakarta.annotation-api @@ -89,6 +84,12 @@ joda-time + + org.apache.phoenix + phoenix-client-embedded-hbase-2.5.0 + ${dep.phoenix5.version} + + org.weakref jmxutils @@ -130,16 +131,6 @@ provided - - - - ch.qos.reload4j - reload4j - 1.2.25 - runtime - - com.fasterxml.jackson.core jackson-databind @@ -162,10 +153,6 @@ org.slf4j jcl-over-slf4j - - org.slf4j - log4j-over-slf4j - org.slf4j slf4j-api @@ -251,6 +238,13 @@ test + + javax.servlet + javax.servlet-api + 4.0.1 + test + + org.apache.hadoop hadoop-hdfs @@ -386,47 +380,25 @@ org.basepom.maven duplicate-finder-maven-plugin - + mrapp-generated-classpath - - assets/org/apache/commons/math3/exception/util/LocalizedFormats_fr.properties - - tables/.*\.bin - jetty-dir.css - - - com.clearspring.analytics - stream - - + + + + org.apache.maven.plugins + maven-enforcer-plugin + + + + + + javax.servlet:javax.servlet-api + + + - - - - - lib/tools.jar - - - idea.maven.embedder.version - - - - - org.apache.phoenix - phoenix-client-embedded-hbase-2.2 - 5.1.3 - provided - true - - - - diff --git a/plugin/trino-phoenix5/src/main/java/io/trino/plugin/phoenix5/PhoenixClient.java b/plugin/trino-phoenix5/src/main/java/io/trino/plugin/phoenix5/PhoenixClient.java index 0f7b55cffc22..068447e6e0a1 100644 --- a/plugin/trino-phoenix5/src/main/java/io/trino/plugin/phoenix5/PhoenixClient.java +++ b/plugin/trino-phoenix5/src/main/java/io/trino/plugin/phoenix5/PhoenixClient.java @@ -209,7 +209,7 @@ import static java.util.stream.Collectors.joining; import static java.util.stream.Collectors.toSet; import static org.apache.hadoop.hbase.HConstants.FOREVER; -import static org.apache.phoenix.coprocessor.BaseScannerRegionObserver.SKIP_REGION_BOUNDARY_CHECK; +import static org.apache.phoenix.coprocessorclient.BaseScannerRegionObserverConstants.SKIP_REGION_BOUNDARY_CHECK; import static org.apache.phoenix.util.PhoenixRuntime.getTable; import static org.apache.phoenix.util.SchemaUtil.ESCAPE_CHARACTER; import static org.apache.phoenix.util.SchemaUtil.getEscapedArgument; diff --git a/plugin/trino-phoenix5/src/main/java/io/trino/plugin/phoenix5/PhoenixClientModule.java b/plugin/trino-phoenix5/src/main/java/io/trino/plugin/phoenix5/PhoenixClientModule.java index 2164885a16af..6639b6f87899 100644 --- a/plugin/trino-phoenix5/src/main/java/io/trino/plugin/phoenix5/PhoenixClientModule.java +++ b/plugin/trino-phoenix5/src/main/java/io/trino/plugin/phoenix5/PhoenixClientModule.java @@ -62,8 +62,8 @@ import io.trino.spi.connector.ConnectorSplitManager; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.Path; +import org.apache.phoenix.jdbc.ConnectionInfo; import org.apache.phoenix.jdbc.PhoenixDriver; -import org.apache.phoenix.jdbc.PhoenixEmbeddedDriver; import java.sql.SQLException; import java.util.Map; @@ -82,6 +82,7 @@ import static io.trino.plugin.phoenix5.PhoenixClient.DEFAULT_DOMAIN_COMPACTION_THRESHOLD; import static io.trino.plugin.phoenix5.PhoenixErrorCode.PHOENIX_CONFIG_ERROR; import static java.util.Objects.requireNonNull; +import static org.apache.phoenix.util.ReadOnlyProps.EMPTY_PROPS; import static org.weakref.jmx.guice.ExportBinder.newExporter; public class PhoenixClientModule @@ -195,7 +196,7 @@ public static Properties getConnectionProperties(PhoenixConfig config) connectionProperties.setProperty(entry.getKey(), entry.getValue()); } - PhoenixEmbeddedDriver.ConnectionInfo connectionInfo = PhoenixEmbeddedDriver.ConnectionInfo.create(config.getConnectionUrl()); + ConnectionInfo connectionInfo = ConnectionInfo.create(config.getConnectionUrl(), EMPTY_PROPS, new Properties()); connectionInfo.asProps().asMap().forEach(connectionProperties::setProperty); return connectionProperties; } diff --git a/plugin/trino-phoenix5/src/main/java/io/trino/plugin/phoenix5/PhoenixSplitManager.java b/plugin/trino-phoenix5/src/main/java/io/trino/plugin/phoenix5/PhoenixSplitManager.java index c4049636b315..a4f45eea650b 100644 --- a/plugin/trino-phoenix5/src/main/java/io/trino/plugin/phoenix5/PhoenixSplitManager.java +++ b/plugin/trino-phoenix5/src/main/java/io/trino/plugin/phoenix5/PhoenixSplitManager.java @@ -53,7 +53,7 @@ import static io.trino.plugin.phoenix5.PhoenixErrorCode.PHOENIX_SPLIT_ERROR; import static java.util.Objects.requireNonNull; import static java.util.stream.Collectors.toList; -import static org.apache.phoenix.coprocessor.BaseScannerRegionObserver.EXPECTED_UPPER_REGION_KEY; +import static org.apache.phoenix.coprocessorclient.BaseScannerRegionObserverConstants.EXPECTED_UPPER_REGION_KEY; public class PhoenixSplitManager implements ConnectorSplitManager diff --git a/pom.xml b/pom.xml index 2b2b488f3c33..53760bc1bc3e 100644 --- a/pom.xml +++ b/pom.xml @@ -54,8 +54,6 @@ lib/trino-memory-context lib/trino-orc lib/trino-parquet - - lib/trino-phoenix5-patched lib/trino-plugin-toolkit lib/trino-record-decoder plugin/trino-accumulo @@ -188,7 +186,7 @@ 1.12.701 4.17.0 7.5.1 - 93 + 94 1.21 2.26.1 10.11.0 @@ -1284,13 +1282,6 @@ ${project.version} - - - io.trino - trino-phoenix5-patched - ${project.version} - - io.trino trino-pinot