From 4af42ed6f72fd5537b7cda72644a69773a67f36b Mon Sep 17 00:00:00 2001 From: Rafael Telles Date: Thu, 26 Aug 2021 13:32:47 -0300 Subject: [PATCH] Flight SQL Ratification Based On Community Feedback #7 (#98) * Remove scope from 'hamcrest' dependency on java/pom.xml * Use flight top-level module on parent pom.xml instead of declaring each one * Avoid using getStatement inside StatementContext methods * Make StatementContext.getQuery() return String * Minor fixes on pom.xml * Move 'os-maven-plugin' to parent pom.xml * Update protobuf generation on pom.xml files * Use ClassLoader#getResource to get network.properties on TestFlightSql * Bind to any ephemeral port on TestFlightSql * Move JDBC-Arrow type default conversion from JdbcToArrowConfig to JdbcToArrowUtils * Micro-optimization: initialize ArrayList with the right size * Fix null-check on PreparedStatement#setParameters * Avoid wrapping vector into a ImmutableList and then into an ArrayList on FlightSqlExample#getTablesRoot * Remove null-check on VectorSchemaRoot on FlightSqlClient#setParameters() * Remove the need of separate cache for ResultSets * Add missing 'final' modifiers --- .../apache/arrow/flight/TestFlightSql.java | 4 +-- java/flight/pom.xml | 31 +++++++----------- java/pom.xml | 32 +++++++++++++++++++ 3 files changed, 44 insertions(+), 23 deletions(-) diff --git a/java/flight/flight-sql/src/test/java/org/apache/arrow/flight/TestFlightSql.java b/java/flight/flight-sql/src/test/java/org/apache/arrow/flight/TestFlightSql.java index 115f85f0d419b..505b905d73009 100644 --- a/java/flight/flight-sql/src/test/java/org/apache/arrow/flight/TestFlightSql.java +++ b/java/flight/flight-sql/src/test/java/org/apache/arrow/flight/TestFlightSql.java @@ -27,9 +27,7 @@ import static org.hamcrest.CoreMatchers.notNullValue; import static org.hamcrest.CoreMatchers.nullValue; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.nio.channels.Channels; +import java.nio.ByteBuffer; import java.sql.SQLException; import java.util.ArrayList; import java.util.Arrays; diff --git a/java/flight/pom.xml b/java/flight/pom.xml index 9cc8acb94c0e0..ba5a72acfb1c0 100644 --- a/java/flight/pom.xml +++ b/java/flight/pom.xml @@ -25,9 +25,8 @@ pom - 1.44.1 - 2.0.46.Final - 3.19.4 + 1.30.2 + 3.7.1 @@ -39,22 +38,14 @@ - - - - org.xolstice.maven.plugins - protobuf-maven-plugin - 0.6.1 - - - com.google.protobuf:protoc:${dep.protobuf.version}:exe:${os.detected.classifier} - - grpc-java - io.grpc:protoc-gen-grpc-java:${dep.grpc.version}:exe:${os.detected.classifier} - - - - - + + + + kr.motd.maven + os-maven-plugin + 1.5.0.Final + + + diff --git a/java/pom.xml b/java/pom.xml index 495cdab0576ff..418f98d793b8d 100644 --- a/java/pom.xml +++ b/java/pom.xml @@ -506,6 +506,38 @@ + + + org.xolstice.maven.plugins + protobuf-maven-plugin + 0.6.1 + + com.google.protobuf:protoc:${dep.protobuf.version}:exe:${os.detected.classifier} + grpc-java + io.grpc:protoc-gen-grpc-java:${dep.grpc.version}:exe:${os.detected.classifier} + + + + proto-compile + generate-sources + + ${basedir}/../format/ + + + compile + compile-custom + + + + proto-test-compile + generate-test-sources + + test-compile + test-compile-custom + + + +