From a059c152deef642c8e7eb9b3ab405d0ee71567d8 Mon Sep 17 00:00:00 2001 From: Vinicius Fraga <62815192+vfraga@users.noreply.github.com> Date: Tue, 12 Oct 2021 13:54:06 -0300 Subject: [PATCH] Fix Minor POM Issues to allow Maven build (#161) * Fix minor POM Issues to allow Maven Build * Revert Flight SQL POM State * Remove unused imports Co-authored-by: Rafael Telles --- java/flight/flight-jdbc-driver/pom.xml | 6 ------ .../text/ArrowFlightJdbcVarCharVectorAccessorTest.java | 1 - .../driver/jdbc/test/adhoc/MockFlightSqlProducer.java | 2 -- java/flight/flight-sql/pom.xml | 10 ++++++++++ .../org/apache/arrow/flight/sql/FlightSqlClient.java | 4 ++-- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/java/flight/flight-jdbc-driver/pom.xml b/java/flight/flight-jdbc-driver/pom.xml index b3b2191754fbf..994cc548b3ec8 100644 --- a/java/flight/flight-jdbc-driver/pom.xml +++ b/java/flight/flight-jdbc-driver/pom.xml @@ -147,12 +147,6 @@ flight-sql ${project.version} - - - org.apache.arrow - arrow-format - ${project.version} - diff --git a/java/flight/flight-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/accessor/impl/text/ArrowFlightJdbcVarCharVectorAccessorTest.java b/java/flight/flight-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/accessor/impl/text/ArrowFlightJdbcVarCharVectorAccessorTest.java index e8d9336061b70..c51db784ec406 100644 --- a/java/flight/flight-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/accessor/impl/text/ArrowFlightJdbcVarCharVectorAccessorTest.java +++ b/java/flight/flight-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/accessor/impl/text/ArrowFlightJdbcVarCharVectorAccessorTest.java @@ -17,7 +17,6 @@ package org.apache.arrow.driver.jdbc.accessor.impl.text; -import static org.apache.calcite.avatica.util.Cursor.Accessor; import static org.apache.commons.io.IOUtils.toByteArray; import static org.apache.commons.io.IOUtils.toCharArray; import static org.hamcrest.CoreMatchers.equalTo; diff --git a/java/flight/flight-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/test/adhoc/MockFlightSqlProducer.java b/java/flight/flight-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/test/adhoc/MockFlightSqlProducer.java index aca3c53afb735..5b8b18c98004a 100644 --- a/java/flight/flight-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/test/adhoc/MockFlightSqlProducer.java +++ b/java/flight/flight-jdbc-driver/src/test/java/org/apache/arrow/driver/jdbc/test/adhoc/MockFlightSqlProducer.java @@ -22,7 +22,6 @@ import static java.lang.String.format; import static java.util.UUID.randomUUID; import static java.util.stream.Collectors.toList; -import static java.util.stream.IntStream.range; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -80,7 +79,6 @@ import org.apache.arrow.util.Preconditions; import org.apache.arrow.vector.VectorSchemaRoot; import org.apache.arrow.vector.ipc.WriteChannel; -import org.apache.arrow.vector.ipc.message.IpcOption; import org.apache.arrow.vector.ipc.message.MessageSerializer; import org.apache.arrow.vector.types.pojo.Schema; import org.apache.calcite.avatica.Meta.StatementType; diff --git a/java/flight/flight-sql/pom.xml b/java/flight/flight-sql/pom.xml index 55eaf921f4815..4e94de37291fe 100644 --- a/java/flight/flight-sql/pom.xml +++ b/java/flight/flight-sql/pom.xml @@ -53,6 +53,16 @@ arrow-format ${project.version} + + org.apache.arrow + arrow-format + ${project.version} + + + org.apache.arrow + arrow-jdbc + ${project.version} + org.apache.arrow arrow-jdbc diff --git a/java/flight/flight-sql/src/main/java/org/apache/arrow/flight/sql/FlightSqlClient.java b/java/flight/flight-sql/src/main/java/org/apache/arrow/flight/sql/FlightSqlClient.java index c1ff92a379621..e3071e354dd97 100644 --- a/java/flight/flight-sql/src/main/java/org/apache/arrow/flight/sql/FlightSqlClient.java +++ b/java/flight/flight-sql/src/main/java/org/apache/arrow/flight/sql/FlightSqlClient.java @@ -34,7 +34,7 @@ import static org.apache.arrow.flight.sql.impl.FlightSql.DoPutUpdateResult; import static org.apache.arrow.flight.sql.impl.FlightSql.SqlInfo; -import java.io.ByteArrayInputStream; +import com.fasterxml.jackson.databind.util.ByteBufferBackedInputStream; import java.io.IOException; import java.nio.channels.Channels; import java.sql.SQLException; @@ -514,7 +514,7 @@ private Schema deserializeSchema(final ByteString bytes) { new Schema(Collections.emptyList()) : MessageSerializer.deserializeSchema( new ReadChannel(Channels.newChannel( - new ByteArrayInputStream(bytes.toByteArray())))); + new ByteBufferBackedInputStream(bytes.asReadOnlyByteBuffer())))); } catch (final IOException e) { throw new RuntimeException("Failed to deserialize schema", e); }