From 4f1260ce9b967cf21cc285e1c331325f33a5ccee Mon Sep 17 00:00:00 2001 From: Mike Pigott Date: Sat, 8 Dec 2018 15:54:12 -0500 Subject: [PATCH 1/2] Adding documentation for public static VectorSchemaRoot sqlToArrow(ResultSet resultSet, JdbcToArrowConfig config) --- .../java/org/apache/arrow/adapter/jdbc/JdbcToArrow.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/java/adapter/jdbc/src/main/java/org/apache/arrow/adapter/jdbc/JdbcToArrow.java b/java/adapter/jdbc/src/main/java/org/apache/arrow/adapter/jdbc/JdbcToArrow.java index c71e5eff0db81..17d5fb1bd1983 100644 --- a/java/adapter/jdbc/src/main/java/org/apache/arrow/adapter/jdbc/JdbcToArrow.java +++ b/java/adapter/jdbc/src/main/java/org/apache/arrow/adapter/jdbc/JdbcToArrow.java @@ -197,6 +197,14 @@ public static VectorSchemaRoot sqlToArrow(ResultSet resultSet, BaseAllocator all return sqlToArrow(resultSet, new JdbcToArrowConfig(allocator, calendar)); } + /** + * For the given JDBC {@link ResultSet}, fetch the data from Relational DB and convert it to Arrow objects. + * + * @param resultSet ResultSet to use to fetch the data from underlying database + * @param config Configuration of the conversion from JDBC to Arrow. + * @return Arrow Data Objects {@link VectorSchemaRoot} + * @throws SQLException on error + */ public static VectorSchemaRoot sqlToArrow(ResultSet resultSet, JdbcToArrowConfig config) throws SQLException, IOException { Preconditions.checkNotNull(resultSet, "JDBC ResultSet object can not be null"); From 8d6cf0089a3ceaa5148c4600b2291f960bc2f9a3 Mon Sep 17 00:00:00 2001 From: Mike Pigott Date: Sat, 8 Dec 2018 15:55:06 -0500 Subject: [PATCH 2/2] Documentation for public static VectorSchemaRoot sqlToArrow(Connection connection, String query, JdbcToArrowConfig config) --- .../org/apache/arrow/adapter/jdbc/JdbcToArrow.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/java/adapter/jdbc/src/main/java/org/apache/arrow/adapter/jdbc/JdbcToArrow.java b/java/adapter/jdbc/src/main/java/org/apache/arrow/adapter/jdbc/JdbcToArrow.java index 17d5fb1bd1983..87a2d556a6388 100644 --- a/java/adapter/jdbc/src/main/java/org/apache/arrow/adapter/jdbc/JdbcToArrow.java +++ b/java/adapter/jdbc/src/main/java/org/apache/arrow/adapter/jdbc/JdbcToArrow.java @@ -120,6 +120,18 @@ public static VectorSchemaRoot sqlToArrow( return sqlToArrow(connection, query, new JdbcToArrowConfig(allocator, calendar)); } + /** + * For the given SQL query, execute and fetch the data from Relational DB and convert it to Arrow objects. + * + * @param connection Database connection to be used. This method will not close the passed connection object. + * Since the caller has passed the connection object it's the responsibility of the caller + * to close or return the connection to the pool. + * @param query The DB Query to fetch the data. + * @param config Configuration + * @return Arrow Data Objects {@link VectorSchemaRoot} + * @throws SQLException Propagate any SQL Exceptions to the caller after closing any resources opened such as + * ResultSet and Statement objects. + */ public static VectorSchemaRoot sqlToArrow(Connection connection, String query, JdbcToArrowConfig config) throws SQLException, IOException { Preconditions.checkNotNull(connection, "JDBC connection object can not be null");