Skip to content

Commit

Permalink
Refactor ArrowDatabaseMetadata tests (apache#177)
Browse files Browse the repository at this point in the history
* Flight SQL Ratification Based On Community Feedback #7 (apache#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

* Fix maven build from different directories (apache#114)

* Add CrossReference methods to SqlProducer

* Clean-up: remove boilerplate code by replacing with tools provided by Arrow Flight JDBC Adapter

* Fix checkstyle and dependency management errors

* Ignore broken tests

* Fix broken tests for CreatePreparedStatement

* Fix Schema generation not setting an unknown column type to nullable

* Change FlightSqlProducer from abstract class to interface

* Refactor tests due to creation of new column of primaryKey

* Nit: fix checkstyle

* Fix leaking connections on connection pool

* [WIP] FlightSQL Ratification based on Community Comments (apache#73)

* Move FlightSql examples to their own subpackage

* Fix checkstyle issues

* fix: change Status use to CallStatus

* Remove unnecessary overhead of wrapping nullable objects into Optionals for the sole purpose of null-checking

* Replace Guava's Preconditions with the ones provided by Apache

* Fix typo in FlightSql.proto

* Fix ordering of schema for FlightSql.proto

* Explain why reserved range of IDs for GetSqlInfo is not entirely in use

* Add comment to CommandGetTables to explain the encoding of table_schema

* Remove redundat information on schemas

* Fixed Javadoc on some methods, added Thread interrupt to executeUpdate methods, and updated Signal exceptions to CallStatus with description

* Replace int32 with uint32 for GetSqlInfo name representation

* Replace AssertionError with StatusRuntimeException for whenever attempting to unpack an invalid protobuf message

* add comment to FlightSql.proto to update_rule and delete_rule

* Replace inconsistent exception handling with CallStatus predetermined exceptions

* correct comment to CreatePreparedStatement on FlightSql.proto

* Remove unused dependencies

* fix: change Status use to CallStatus on FlightSqlProducer

* Changed from if not null check to Objects requireNonNull on Flight SQL Client

* Remove Nullable annotation

* Changed from checkNotNull to Objects#requireNotNull with description on Flight SQL Example

* Add CallOptions to every RPC call by the client

* Fix Maven dependency problems and checkstyle violations

* Replace generic Collections with Lists when order matters in an RPC call

* Fix Javadoc for FlightSqlClient

* Add description to StatusRuntimeExceptions

* Add descriptions to Exceptions

* Correct update_rule and delete_rule description on FlighSql.proto

* Verify wheter Root is empty before sending request to server

* Add call options to PreparedStatement

* Replace constant checking of whether client is open with #checkOpen

* Add CallOptions to #close for PreparedStatement

* Refactor PreparedStatement usages of CallOptions

* Fix broken tests

* Fix FlightSql.proto documentation

* Update documentation for format/FlightSql.proto

Co-authored-by: kylep-dremio <[email protected]>

* Fix checkstyle violations

* Require non null tables for GetExportedKeys and GetImportedKeys

* Not storing CallOptions in PreparedStatement

* Update documentation comments for protobuf

* Replace IntVector for UInt1Vector for delete_rule and update_rule

* Fix protobuf for FlightSQL

* Fix bug with empty metadata

* Update update_rule and delete_rule documentation on proto

* Remove explicit dependency on JDBC's DatabaseMetaData on UpdateDeleteRules

* Use MessageOptions instead of FieldOptions on proto

* Add missing JavaDoc about 'options' parameter

* Fix CommandGetSqlInfo documentation

* Add @throws to FlightSqlClient#checkOpen JavaDoc

Co-authored-by: Juscelino Junior <[email protected]>
Co-authored-by: Vinicius Fraga <[email protected]>
Co-authored-by: Rafael Telles <[email protected]>
Co-authored-by: kylep-dremio <[email protected]>

* Create a module for keeping all Arrow Flight-related submodules

* Fix checkstyle violations in Arrow Flight JDBC Driver

* Create a module for keeping all Arrow Flight-related submodules

* Fix checkstyle violations in Arrow Flight JDBC Driver

* Fix Minor POM Issues to allow Maven build (apache#161)

* Fix minor POM Issues to allow Maven Build

* Revert Flight SQL POM State

* Remove unused imports

Co-authored-by: Rafael Telles <[email protected]>

* Ignore broken tests

* Refactor tests due to creation of new column of primaryKey

* Create a module for keeping all Arrow Flight-related submodules

* Fix checkstyle violations in Arrow Flight JDBC Driver

* Create a module for keeping all Arrow Flight-related submodules

* Fix checkstyle violations in Arrow Flight JDBC Driver

* [FlightRPC] Flight SQL POC

Add extensions in the Apache Arrow project’s Arrow Flight modules
to provide a standard way for clients and servers to communicate
with SQL-like semantics.

Do not pull to master. A message to the mailing list will accompany this
and another proposal in the coming days for discussion.

* Update FlightSqlProducer to conform to new design.
Rename files for SQL -> Sql.
Correct compilation errors in client code, but design needs to be updated.

Tests do not yet compile.

* Correct the dense_union type for schema return of SQL info.
Correct some additional SQL -> Sql file renames.
Reduce the test compilation problems (still more to do).

* Additional CR changes.

Note - FlightSqlExample is not functional and needs to be updated.

* Add support for primary and foreign keys.

* Fix broken Maven build

* Add Hamcrest as a root-level dependency

* Create test for GetCatalogs

* Update tests for GetTables

* Fix test for GetTables

* Enable support for includeSchema in GetTables

* Fix checkstyle and dependency management errors

* Remove boilerplate code for creating a new Schema by reusing default converter from JdbcToArrowConfig#DEFAULT_JDBC_TO_ARROW_TYPE_CONVERTER

* WIP: Working on fixing data consistency issue where catalog is null in some parts and "" in others

* Implement FlightSqlExample's GetPrimaryKey command

* WIP: Add support for GetCatalogs: GetFlightInfoCatalogs

* WIP: Add support for GetCatalogs: GetStreamCatalogs

* WIP: Add support for GetTableTypes: getFlightInfoTableTypes

* WIP: Add support for GetTableTypes: getStreamTableTypes

* Fix rebase conflicts

* Minor refactor: apply DRY principle to repeated methods

* Ignore broken tests

* Fix broken tests for CreatePreparedStatement

* Fix Schema generation not setting an unknown column type to nullable

* Change FlightSqlProducer from abstract class to interface

* Update FlightSql protobuf to allow nullable values as parameters for nullable fields

* Start separating commandForeignKey into two new commands

* Fix CheckStyle issues

* Change empty string to null value

* Implement CommandGetImportedKeys

* Fix checkstyle violations

* Minor refactor: remove unused methods

* Implement FlightSqlClient.executeUpdate

* Refactor the code to not use string when getting from cache

* Nit: fix checkstyle

* Fix conflicts between tests for creating a new statement and checking its schema

* Minor refactor: remove unused fields @ FlightSqlUtils

* Fix wrong StreamListener usages and multiple instances of RootAllocators

* Fix checkstyle

* Modify execute preparedStatement flow

* Fix leaking connections on connection pool

* Deal with query with parameter in the preparedStatement

* Fix rebase issues with FlightSql.proto

* Fix missing code on adapter/jdbc/JdbcToArrowUtils.java due to rebase issue

* [WIP] FlightSQL Ratification based on Community Comments (apache#73)

* Move FlightSql examples to their own subpackage

* Fix checkstyle issues

* fix: change Status use to CallStatus

* Remove unnecessary overhead of wrapping nullable objects into Optionals for the sole purpose of null-checking

* Replace Guava's Preconditions with the ones provided by Apache

* Fix typo in FlightSql.proto

* Fix ordering of schema for FlightSql.proto

* Explain why reserved range of IDs for GetSqlInfo is not entirely in use

* Add comment to CommandGetTables to explain the encoding of table_schema

* Remove redundat information on schemas

* Fixed Javadoc on some methods, added Thread interrupt to executeUpdate methods, and updated Signal exceptions to CallStatus with description

* Replace int32 with uint32 for GetSqlInfo name representation

* Replace AssertionError with StatusRuntimeException for whenever attempting to unpack an invalid protobuf message

* add comment to FlightSql.proto to update_rule and delete_rule

* Replace inconsistent exception handling with CallStatus predetermined exceptions

* correct comment to CreatePreparedStatement on FlightSql.proto

* Remove unused dependencies

* fix: change Status use to CallStatus on FlightSqlProducer

* Changed from if not null check to Objects requireNonNull on Flight SQL Client

* Remove Nullable annotation

* Changed from checkNotNull to Objects#requireNotNull with description on Flight SQL Example

* Add CallOptions to every RPC call by the client

* Fix Maven dependency problems and checkstyle violations

* Replace generic Collections with Lists when order matters in an RPC call

* Fix Javadoc for FlightSqlClient

* Add description to StatusRuntimeExceptions

* Add descriptions to Exceptions

* Correct update_rule and delete_rule description on FlighSql.proto

* Verify wheter Root is empty before sending request to server

* Add call options to PreparedStatement

* Replace constant checking of whether client is open with #checkOpen

* Add CallOptions to #close for PreparedStatement

* Refactor PreparedStatement usages of CallOptions

* Fix broken tests

* Fix FlightSql.proto documentation

* Update documentation for format/FlightSql.proto

Co-authored-by: kylep-dremio <[email protected]>

* Fix checkstyle violations

* Require non null tables for GetExportedKeys and GetImportedKeys

* Not storing CallOptions in PreparedStatement

* Update documentation comments for protobuf

* Replace IntVector for UInt1Vector for delete_rule and update_rule

* Fix protobuf for FlightSQL

* Fix bug with empty metadata

* Update update_rule and delete_rule documentation on proto

* Remove explicit dependency on JDBC's DatabaseMetaData on UpdateDeleteRules

* Use MessageOptions instead of FieldOptions on proto

* Add missing JavaDoc about 'options' parameter

* Fix CommandGetSqlInfo documentation

* Add @throws to FlightSqlClient#checkOpen JavaDoc

Co-authored-by: Juscelino Junior <[email protected]>
Co-authored-by: Vinicius Fraga <[email protected]>
Co-authored-by: Rafael Telles <[email protected]>
Co-authored-by: kylep-dremio <[email protected]>

* FlightSQL Ratification based on Community Comments (round 2) (apache#85)

* Remove unused client_execution_handler from Protobuf

* Update documentation on CommandGetPrimaryKeys

* Update documentation on CommandGetImportedKeys and CommandGetExportedKeys

* Change exception type on FlightSqlClient#executeUpdate

* Add @return to FlightSqlClient#executeUpdate JavaDoc

* Switch order of key_name and key_sequence on CommandGetTableKeys documentation

* Update JavaDoc for FlIghtSqlClient#clearParameters

* Add private constructor to FlightSqlProducer.SqlInfo

* Update JavaDoc for FlIghtSqlClient#clearParameters

* Fix wrong CommandGetPrimaryKeys documentation on Proto file

* Fix order of key_name and key_sequence

* Split CommandStatementQuery in 2 messages, one for Command and other for Ticket

* Fix leaking Connections on FlightSqlExample

* Remove unused variable of cache

* Flight SQL Ratification Based On Community Feedback #5 (apache#91)

* Delegate GetSchemaImportedKeys

* Remove schema retrieval methods for catalog functions and delegate to constants

* Add IPC encapsulation to Schema serialization

* Fix checkstyle violations

* Update javadoc for FlightSqlClient

* Update documentation for FlightSql.proto

Co-authored-by: Abner Eduardo Ferreira <[email protected]>

* Flight SQL Ratification Based On Community Feedback #6 (apache#94)

* Refactored FlightSql Statement Constant names

* Defined non-nullable parameters for FlightSql proto

* Resolved minimal checkstyle issues

* Added further documentation for catalog and schema

* Refactored FlightSql proto comments to include more information

* Added Field/FieldType notNullable methods

* Refactored FlightSqlClient and FlightSqlExample to leverage Field notNullable method

* Removed opaque query warning from FlightSql proto

* Added the optional tag for the returned schema of getTables to proto

* Flight SQL Ratification Based On Community Feedback #7 (apache#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

* Fix missing generated sources on built flight-sql jar (apache#101)

* Bump protobuf version

* Flight SQL Ratification Based On Community Feedback #8 (apache#113)

* Change scope of arrow-memory-netty to test for flight-sql

* Remove unused dependency arrow-memory-netty

* Update common-pool2 and common-dbcp2 dependencies

* Remove 'executions' from parent pom.xml for plugin protobuf-maven-plugin

* Adjust protobuf-maven-plugin settings on pom.xml files

* Move dep.protobuf.version and dep.grpc.version to top pom.xml

* Remove <url> from arrow-flight's pom.xml

* Fix maven build from different directories (apache#114)

* Add test cases for bitshifting operations required for filtering out some SqlInfo data

* Fix Schema serialization and deserialization on Flight SQL methods

* [FlightSQL] Add missing method for creating bitmask from GetSqlInfo option enum (apache#148)

* Add util method for creating bitmask from multiple protobuf enums for FlightSql GetSqlInfo enum

* Add test cases for utility method for creating bitmask from protobuf options

* Make changes regarding to reviews

Co-authored-by: Rafael Telles <[email protected]>

* Create a module for keeping all Arrow Flight-related submodules

* Fix checkstyle violations in Arrow Flight JDBC Driver

* Create a module for keeping all Arrow Flight-related submodules

* Fix checkstyle violations in Arrow Flight JDBC Driver

* WIP: Refactor SqlInfoProvider

* WIP

* WIP

* WIP

* Fix rebase issues

* Restore FlightSql.proto state

* Fix checkstyle

* Fix rebase colateral

* Restore FlightSql.proto

Co-authored-by: Jose Almeida <[email protected]>
Co-authored-by: Abner Eduardo Ferreira <[email protected]>
Co-authored-by: Juscelino Junior <[email protected]>
Co-authored-by: Vinicius Fraga <[email protected]>
Co-authored-by: kylep-dremio <[email protected]>
Co-authored-by: Vinicius Fraga <[email protected]>
Co-authored-by: Ryan Nicholson <[email protected]>
Co-authored-by: Kyle Porter <[email protected]>
  • Loading branch information
9 people committed Mar 29, 2022
1 parent 82c55b8 commit 3603990
Show file tree
Hide file tree
Showing 4 changed files with 137 additions and 761 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -764,8 +764,8 @@ public ResultSet getExportedKeys(final String catalog, final String schema, fina
}

@Override
public ResultSet getCrossReference(String parentCatalog, String parentSchema, String parentTable,
String foreignCatalog, String foreignSchema, String foreignTable)
public ResultSet getCrossReference(final String parentCatalog, final String parentSchema, final String parentTable,
final String foreignCatalog, final String foreignSchema, final String foreignTable)
throws SQLException {
final ArrowFlightConnection connection = getConnection();
final FlightInfo flightInfoCrossReference = connection.getClientHandler().getCrossReference(
Expand Down
Loading

0 comments on commit 3603990

Please sign in to comment.