Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARROW-7744: [Java][FlightRPC] JDBC Driver for Arrow Flight SQL #13800

Merged
merged 1,532 commits into from
Sep 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1532 commits
Select commit Hold shift + click to select a range
9c3a0f5
Remove method getBytes.
iurysalino Mar 11, 2022
dc13aba
Refactor Tests Failures With Boolean Data Conversion `ResultSet.getBo…
iurysalino Mar 9, 2022
075e92f
Revert Change in to `getOperationNotSupported`
iurysalino Mar 9, 2022
b4b1196
Change ´UnsupportedOperationException´ message
iurysalino Mar 9, 2022
5d49b6f
Add Message to `SQLException`
iurysalino Mar 9, 2022
fccbd13
Revert changes about `interface Getter`
iurysalino Mar 9, 2022
817dad3
Change `assertGetBoolean` to `assertGetBooleanForSQLException`
iurysalino Mar 9, 2022
6b540c9
Adjust text message in the throw SQLException
iurysalino Mar 11, 2022
4afb631
Fix text in to SQLException
iurysalino Mar 11, 2022
09ec278
Changed test names in to `ArrowFlightJdbcVarCharVectorAccessorTest`
iurysalino Mar 11, 2022
2e30866
Adjusted name test methods.
iurysalino Mar 14, 2022
d248e3e
Use Avatica DateTimeUtils for getString in Date/Time (#7)
vfraga Mar 15, 2022
a471438
Remove dependencies of deprecated class `UrlSample` and `PropertiesSa…
iurysalino Feb 25, 2022
55fdd48
Remove deprecated classes `UrlSample` and `Properties`
iurysalino Feb 25, 2022
d8f8d8f
WIP Refactor Deprecated Classes.
iurysalino Mar 8, 2022
c766b50
Remove Deprecated Class `FlightTestUtils`.
iurysalino Mar 17, 2022
5bbe84d
WIP - Refactor Tests Using TLS Connection
iurysalino Mar 18, 2022
7baead4
Refactor apply method `FlightServerTestRule` for use TLS connection.
iurysalino Mar 21, 2022
9bf9f65
Remove FindBug Dependency.
iurysalino Mar 21, 2022
615d865
Remove unused methods `validade` and `validade2`
iurysalino Mar 21, 2022
2b36c36
Remove not necessary parameters for connection.
iurysalino Mar 21, 2022
5c1a9e7
Remove not necessary import
iurysalino Mar 21, 2022
41a66e4
Create ´getPort´and ´getHost´ methods.
iurysalino Mar 21, 2022
25e7c48
Remove unused parameters.
iurysalino Mar 21, 2022
124247f
Created `initiateServer` method to reduce redundancy of code.
iurysalino Mar 22, 2022
1040ee0
Extract `user` and `pass` for variables.
iurysalino Mar 22, 2022
b78ce73
Add `getPort` and `getHost` Javadoc.
iurysalino Mar 22, 2022
c2f0a59
Remove Blank Line.
iurysalino Mar 22, 2022
dcbe95e
Add support for getUnicodeStream for Text and Binary accessors (#16)
vfraga Mar 23, 2022
aecf26c
Create `FlightCerts` for reference certificates localed in `testing/d…
iurysalino Mar 22, 2022
71799f0
Move methods reference certificates localed in `testing/data/flight` …
iurysalino Mar 22, 2022
c43843c
Remove local certificated files.
iurysalino Mar 22, 2022
c72e1c8
Refactor `ConnectionTlsTest` to use `FlightServerTestRule` and `Fligh…
iurysalino Mar 22, 2022
27bd5df
Add plugin configuration to reference the folder where are the certif…
iurysalino Mar 22, 2022
0131706
Move `CertKeyPair` for `FlightSqlTestCertificates`
iurysalino Mar 23, 2022
f8f5351
Rename `FlightCerts` to `FlightSqlTestCertificates`
iurysalino Mar 23, 2022
97ef16e
Move `CertKeyPair` class to `FlightSqlTestCertificates`
iurysalino Mar 23, 2022
c7ec964
Changed the `builder.setType` for on the`setName` send `fieldType` co…
iurysalino Mar 23, 2022
bf99507
Changed this test to compare parameters with SqlTypes.
iurysalino Mar 23, 2022
7136297
Address all JDBC ratification comments with small fixes #1 (#14)
vfraga Mar 23, 2022
59148df
Add license to spotbugs exclusion xml and better shading filter for org.
vfraga Mar 25, 2022
293b949
Fix rebase automerge
vfraga Mar 29, 2022
7ded42a
Temporarily fix MockFlightSqlProducer - implementation needed
vfraga Mar 29, 2022
0ec7155
Add missing module of flight-jdbc-driver to pom.xml
jcralmeida Mar 29, 2022
b206219
Add parameters to disable certificate verification
jcralmeida Mar 28, 2022
c6175fb
Pass the disableCertificationVerification to the client
jcralmeida Mar 28, 2022
4259e5f
Test disableCertificateVerificaiton on ConnectionTlsTest
jcralmeida Mar 28, 2022
0e6dba2
Set useTls default behavior as true
jcralmeida Mar 29, 2022
b1b5e4e
Refactor tests because of the new behavior of useTls default value as…
jcralmeida Mar 29, 2022
04adac3
Remove if statement on setUseTls
jcralmeida Mar 29, 2022
a03aa1e
Create the ColumnMetaData `TYPE_NAME`, and a `getTypeName` method, an…
iurysalino Mar 28, 2022
a11b76d
Create the metadata `TYPE_NAME`.
iurysalino Mar 28, 2022
126dbba
Add TYPE_NAME on C++
rafael-telles Mar 29, 2022
d758f5c
Merge pull request #23 from rafael-telles/ssl-without-certificate
jcralmeida Mar 30, 2022
14e979c
Add joda time dependency
escobargabriel Mar 31, 2022
b91080c
Add methods for format interval Day, Year and milliseconds from period
escobargabriel Mar 31, 2022
c811904
Change getString to use formatIntervalYear and formatIntervalDay methods
escobargabriel Mar 31, 2022
c3a1a6a
Change getString to use formatIntervalYear and formatIntervalDay methods
escobargabriel Mar 31, 2022
cc1144a
Merge remote-tracking branch 'origin/change-interval-behaviour-for-ge…
escobargabriel Mar 31, 2022
9ce9e32
Remove unnecessary dependency from integration tests
escobargabriel Mar 31, 2022
dffe661
Extract methods from ArrowFlightJdbcIntervalVectorAccessor class to u…
escobargabriel Mar 31, 2022
9f86ea9
Add tests with negative values for year and day intervals
escobargabriel Mar 31, 2022
c881c1c
Remove getBytes from remaining numeric types
vfraga Apr 1, 2022
942538a
Change class name and related imports
escobargabriel Apr 1, 2022
061bc3f
Apply the asserts to tests
escobargabriel Apr 1, 2022
199660f
Refactor jdbc tls connection to use trustStore correctly
jcralmeida Apr 4, 2022
57d6fb4
Create the column metadata `TYPE_NAME`.
iurysalino Apr 4, 2022
d151750
Implement the base for the tls connection using systemCertificate
jcralmeida Apr 5, 2022
86b9a13
Refactor useTls to ssl as parameter
jcralmeida Apr 6, 2022
49f7ff6
Add missing java docs to the ssl options
jcralmeida Apr 6, 2022
18ae06f
Refactor keyStore to trustStore on methods and variables
jcralmeida Apr 6, 2022
7b1de26
Change import order
jcralmeida Apr 6, 2022
46b5b1b
Remove unused import
jcralmeida Apr 6, 2022
b9303d5
Refactor by adding methods that check the operating system and one th…
jcralmeida Apr 6, 2022
d0cfeb7
Remove unnecessary test from ConnectionTlsTest
jcralmeida Apr 6, 2022
b48cc22
Remove unnecessary validation of useSystemTrustStore
jcralmeida Apr 6, 2022
1f309fd
Load a new Windows system keyStore
jcralmeida Apr 6, 2022
8cc2e6c
Change parameter format
escobargabriel Apr 6, 2022
0ecf090
fix getDate() and getTime() with null calendar parameter
Apr 7, 2022
39ace00
Add more test cases of day and year interval
escobargabriel Apr 7, 2022
8e8082e
fix getTimestamp()
Apr 7, 2022
1c5ed6e
Add typeName to testGetTablesResultFilteredWithSchema
escobargabriel Apr 8, 2022
f2dce9c
remove empty line
escobargabriel Apr 8, 2022
7bac8d2
Change IntervalStringUtils class to final
escobargabriel Apr 8, 2022
44796fa
Merge pull request #26 from rafael-telles/change-interval-behaviour-f…
rafael-telles Apr 8, 2022
cc03378
Rename keyStore to trustStore in ArrowFlightSqlClientHandler
jcralmeida Apr 8, 2022
d978b13
Remove unnecessary method to check is the system is linux
jcralmeida Apr 8, 2022
84ab518
Refactor method to read systemTrustCertificates
jcralmeida Apr 8, 2022
11906d7
Refactor ConnectionTlsTest to set useSystemCertificate to false
jcralmeida Apr 8, 2022
42bbef5
Change top order of the if statement in the build method from ArrowFl…
jcralmeida Apr 11, 2022
d851ef5
Add @Visible for testing on methods from ClientAuthenticationUtils
jcralmeida Apr 11, 2022
0a827ab
Fix findbug errors on ClientAuthenticationUtils
jcralmeida Apr 11, 2022
d0d6b35
Fix tests due to the changes from the ssl default values as true and …
jcralmeida Apr 11, 2022
0fa843b
Add more test for the ClientAuthenticationUtilsTest class
jcralmeida Apr 11, 2022
4311bfa
Merge pull request #27 from rafael-telles/tls-truststore-fix
jcralmeida Apr 11, 2022
f6ac593
Merge branch 'apache:master' into flight-jdbc-driver
jduo Apr 12, 2022
98d4e73
Test if type is null
escobargabriel Apr 12, 2022
299392c
fix the case when Timestamp has a timezone
Apr 14, 2022
d033a99
UT rearranged
Apr 15, 2022
00808c0
Update java/flight/flight-jdbc-driver/src/test/java/org/apache/arrow/…
Eugene-Roslikov-BQ Apr 18, 2022
7924e7b
Merge pull request #29 from rafael-telles/Timestamp_fix
rafael-telles Apr 18, 2022
e6d01af
Change ssl parameter to UseEncryption
jcralmeida Apr 19, 2022
55eeed9
Merge pull request #32 from rafael-telles/change-ssl-parameter-to-use…
jcralmeida Apr 19, 2022
820f07a
Add column metadata when executing Statement
vfraga Apr 20, 2022
629988c
Remove wildcard import in FlightServerTestRule
vfraga Apr 20, 2022
32dbc66
Fix incorrect rename from useTls#FlightServer.Builder call
jcralmeida Apr 20, 2022
8494d09
Update tests for GetTables -- start refactor to use proper schemas
Jul 16, 2021
4af42ed
Flight SQL Ratification Based On Community Feedback #7 (#98)
rafael-telles Aug 26, 2021
1ea5e62
Fix maven build from different directories (#114)
rafael-telles Sep 3, 2021
a9d539d
Add CrossReference methods to SqlProducer
jcralmeida Oct 18, 2021
8f816b7
Create a module for keeping all Arrow Flight-related submodules
Jun 4, 2021
bd832a7
Fix checkstyle violations in Arrow Flight JDBC Driver
Jun 4, 2021
6164e47
Create a module for keeping all Arrow Flight-related submodules
Jun 4, 2021
e926b5e
Fix checkstyle violations in Arrow Flight JDBC Driver
Jun 4, 2021
6ea242d
Create a module for keeping all Arrow Flight-related submodules
Jun 4, 2021
49fec26
Fix checkstyle violations in Arrow Flight JDBC Driver
Jun 4, 2021
bd0bc59
Create a module for keeping all Arrow Flight-related submodules
Jun 4, 2021
5df0b7c
Fix checkstyle violations in Arrow Flight JDBC Driver
Jun 4, 2021
647eed7
Fix rebase issues
vfraga Oct 28, 2021
e8e7512
Add missing metadata on Arrow schemas returned by Flight SQL's GetTab…
rafael-telles Dec 9, 2021
5c67e9e
Change unsupported operation exception to SQL exception
escobargabriel Mar 9, 2022
ac6f516
Make getOperationSupported return a SQL Exception
escobargabriel Mar 9, 2022
a6ca630
Address all ratification comments with small fixes
vfraga Mar 14, 2022
e54c4d4
Small fixes
vfraga Mar 14, 2022
59d157a
Revert small changes
vfraga Mar 14, 2022
3d8d454
Change UnsupportedOperationException to SQLException
vfraga Mar 14, 2022
dc85668
Address all ratification comments with small fixes
vfraga Mar 14, 2022
9c629c5
Fix failing tests
vfraga Mar 16, 2022
1169d25
Address to James' review
vfraga Mar 16, 2022
f889488
Removed some suppressions by creating newChildAllocators
vfraga Mar 16, 2022
dd55ab2
Fix CONNECTION_STRING_EXPECTED
vfraga Mar 16, 2022
d27e460
nit on CONNECTION_STRING_EXPECTED
vfraga Mar 16, 2022
8b235fc
Address more review comments
vfraga Mar 21, 2022
54e5d89
nit on holder comment
vfraga Mar 21, 2022
ce367c0
Parse server-side parameters
vfraga Feb 14, 2022
51f19d5
Fix coverage tests after changing URL parsing
vfraga Feb 14, 2022
5252937
Properly avoid shading of Flight JDBC Properties
vfraga Feb 15, 2022
3f814d8
Rebase with flight-jdbc-driver
vfraga Mar 24, 2022
be1e7fa
Fix rebase automerge
vfraga Mar 29, 2022
baf0ed7
Replace the semicolons instead of removing and adding to properties
vfraga Mar 30, 2022
e650d56
Add temporary debugging to connection strings and properties
vfraga Mar 30, 2022
aefbbf9
Add temporary debugging for connection properties in query execution
vfraga Mar 30, 2022
01225d7
Remove logging
vfraga Apr 4, 2022
f2a3157
Update tests for GetTables -- start refactor to use proper schemas
Jul 16, 2021
0de5a28
Flight SQL Ratification Based On Community Feedback #7 (#98)
rafael-telles Aug 26, 2021
35c676a
Fix maven build from different directories (#114)
rafael-telles Sep 3, 2021
2536e57
Add CrossReference methods to SqlProducer
jcralmeida Oct 18, 2021
3ad80b9
Create a module for keeping all Arrow Flight-related submodules
Jun 4, 2021
16f291b
Fix checkstyle violations in Arrow Flight JDBC Driver
Jun 4, 2021
3d2eeae
Create a module for keeping all Arrow Flight-related submodules
Jun 4, 2021
21aa3d9
Fix checkstyle violations in Arrow Flight JDBC Driver
Jun 4, 2021
86659d3
Create a module for keeping all Arrow Flight-related submodules
Jun 4, 2021
adb5be7
Fix checkstyle violations in Arrow Flight JDBC Driver
Jun 4, 2021
9b1bb79
Create a module for keeping all Arrow Flight-related submodules
Jun 4, 2021
18632fe
Fix checkstyle violations in Arrow Flight JDBC Driver
Jun 4, 2021
0e0c245
Fix rebase issues
vfraga Oct 28, 2021
877d235
Add missing metadata on Arrow schemas returned by Flight SQL's GetTab…
rafael-telles Dec 9, 2021
db401f5
Change unsupported operation exception to SQL exception
escobargabriel Mar 9, 2022
d3601d1
Make getOperationSupported return a SQL Exception
escobargabriel Mar 9, 2022
29ef79d
Address all ratification comments with small fixes
vfraga Mar 14, 2022
2e4e4ba
Small fixes
vfraga Mar 14, 2022
e67b4ea
Revert small changes
vfraga Mar 14, 2022
aba4d4e
Change UnsupportedOperationException to SQLException
vfraga Mar 14, 2022
2b6b1de
Address all ratification comments with small fixes
vfraga Mar 14, 2022
fecd606
Fix failing tests
vfraga Mar 16, 2022
adc22a3
Address to James' review
vfraga Mar 16, 2022
e016d9e
Removed some suppressions by creating newChildAllocators
vfraga Mar 16, 2022
ceceb59
Fix CONNECTION_STRING_EXPECTED
vfraga Mar 16, 2022
963ecb6
nit on CONNECTION_STRING_EXPECTED
vfraga Mar 16, 2022
868ada2
Address more review comments
vfraga Mar 21, 2022
488dced
nit on holder comment
vfraga Mar 21, 2022
3df6452
Parse server-side parameters
vfraga Feb 14, 2022
2cf976b
Fix coverage tests after changing URL parsing
vfraga Feb 14, 2022
31626dd
Properly avoid shading of Flight JDBC Properties
vfraga Feb 15, 2022
6847812
Rebase with flight-jdbc-driver
vfraga Mar 24, 2022
24663c4
Fix rebase automerge
vfraga Mar 29, 2022
30733d7
Replace the semicolons instead of removing and adding to properties
vfraga Mar 30, 2022
0f643db
Add temporary debugging to connection strings and properties
vfraga Mar 30, 2022
8063bbe
Add temporary debugging for connection properties in query execution
vfraga Mar 30, 2022
dc7c91f
Fix rebase automerge
vfraga Apr 4, 2022
55c8b8f
Fix failing tests
vfraga Apr 4, 2022
5b3a53d
Fix statement missing column metadata
vfraga Apr 13, 2022
5baf234
Fix coverage
vfraga Apr 13, 2022
53b85fd
Fix rebase
vfraga Apr 19, 2022
74e66a1
Fix rebase
vfraga Apr 20, 2022
95a00f5
Add temporary fix for JdbcArray#toString
vfraga Apr 20, 2022
ee3c30c
Remove JdbcArray temporary fix
vfraga Apr 20, 2022
5f54c24
Implement toString
jvictorhuguenin Apr 20, 2022
f4b71c9
Fix string format
jvictorhuguenin Apr 20, 2022
e7b15d2
Change mapping type from STRUCT to JAVA Object
jcralmeida Apr 19, 2022
36ff017
Fix test that map arrows vector to jdbc types
jcralmeida Apr 19, 2022
36b43c9
Fix checkstyle
jvictorhuguenin Apr 21, 2022
f24ef45
Merge pull request #33 from rafael-telles/parse-connection-string
jcralmeida Apr 22, 2022
c1e0cc3
Ensure minimum ArrayList size.
jvictorhuguenin Apr 22, 2022
e2fee64
Merge pull request #35 from rafael-telles/to-string-array-jdbc-review
jcralmeida Apr 22, 2022
4883821
Merge pull request #37 from rafael-telles/fix-struct-type-on-jdbc
jcralmeida Apr 26, 2022
80148b7
Datetime fixes for regression (#36)
vfraga Apr 27, 2022
e745372
Change VarCharAccessor Getter to Bytes rather than Text (#38)
vfraga Apr 27, 2022
5f07a0e
Change getMillisReprValue to greater or equals
vfraga Apr 27, 2022
792a29c
Fix query exception message
jvictorhuguenin Apr 28, 2022
55fc9a1
Change the behavior to return the correct format for day and year int…
escobargabriel May 4, 2022
133d809
Test if holder.isSet indicates the value is null and return null dire…
escobargabriel May 5, 2022
6347675
Change the getString and getObject methods
escobargabriel May 5, 2022
bd16af2
Include a test passing a Joda object
escobargabriel May 5, 2022
7f09eb0
Remove checkstyle problem
escobargabriel May 5, 2022
7f1eeec
Merge pull request #40 from rafael-telles/fix-day-and-year-interval-f…
escobargabriel May 5, 2022
e383cef
Merge pull request #39 from rafael-telles/fix-exception-messages
rafael-telles May 9, 2022
c9b722d
Merge pull request #30 from rafael-telles/flight-jdbc-driver-create-m…
rafael-telles May 10, 2022
c9cdcac
Temporarily disable Spotbugs
vfraga May 24, 2022
360ee52
Fix attributes as headers bug and token value parsing error
jvictorhuguenin Jul 27, 2022
d66a60a
Fix crash for empty properties on the url
jvictorhuguenin Jul 27, 2022
1da5ba8
Merge pull request #43 from rafael-telles/fix-all-attributes-as-headers
jvictorhuguenin Jul 28, 2022
e7a7251
ARROW-15452: [FlightRPC][Java] JDBC driver for Flight SQL (#12830)
jduo Jul 29, 2022
e2798ec
Merge remote-tracking branch 'upstream/master' into flight-sql-jdbc
lidavidm Jul 29, 2022
cc746c7
Manually revert some apparently incidental changes
lidavidm Jul 29, 2022
e22f7e4
Implement case insensitive for the property keys
jvictorhuguenin Jul 30, 2022
b2af3a0
Fix property lowercasing only for the connection string
jvictorhuguenin Aug 2, 2022
6eb3cfa
Add unit tests and fix possible crash on the parser
jvictorhuguenin Aug 3, 2022
220e844
Merge pull request #44 from rafael-telles/implement-case-insensitive
jvictorhuguenin Aug 3, 2022
6c8a900
Fix checkstyle issues
vfraga Aug 4, 2022
892b2b1
[Java] Fix build
lidavidm Aug 5, 2022
6f2639c
Merge branch 'rf-flight-jdbc-driver' into merge-new-changes-from-rafa…
jhmannok Aug 12, 2022
f64cea9
Merge pull request #1 from lidavidm/flight-sql-jdbc
jduo Aug 16, 2022
d38c08e
Merge remote-tracking branch 'upstream/master' into flight-sql-jdbc
lidavidm Aug 23, 2022
ab6a975
Update version number
lidavidm Aug 22, 2022
46e5a33
Fix ErrorProne warnings on Java 11
lidavidm Aug 23, 2022
65dd309
Fix connection string tests
lidavidm Aug 23, 2022
1b2b395
Fix ResultSetTest
lidavidm Aug 23, 2022
15db6b3
Fix some Maven metadata
lidavidm Aug 23, 2022
b67ccf4
Fix TLS tests
lidavidm Aug 23, 2022
2eea4c9
Merge remote-tracking branch 'upstream/master' into flight-sql-jdbc
lidavidm Aug 29, 2022
a0e817c
Fix Java 17 compatibility
lidavidm Aug 29, 2022
08874ce
Cut down on log spam
lidavidm Aug 29, 2022
4b8102b
Try to fix Windows issues again
lidavidm Aug 30, 2022
bce0e3f
Must encode/decode URL parameters
lidavidm Aug 30, 2022
ab7cf6f
URL-encode in another spot
lidavidm Aug 30, 2022
f9d9de8
Fix spot
lidavidm Aug 30, 2022
9bd9ee3
Improve test coverage to make Jacoco happy
lidavidm Aug 30, 2022
2501a29
Suppress coverage warnings
lidavidm Aug 30, 2022
fa507f0
Rename Maven package
lidavidm Aug 30, 2022
f1e0019
Rename classes
lidavidm Aug 30, 2022
bc5fa87
Revert "Rename classes"
lidavidm Aug 31, 2022
fc3b327
Revert "Rename Maven package"
lidavidm Aug 31, 2022
44c53c7
Merge remote-tracking branch 'Bit-Quill/merge-new-changes-from-rafael…
lidavidm Aug 31, 2022
96e7431
Try both cased and lowercased property name when retrieving from prop…
lidavidm Aug 31, 2022
36cb44d
Fix exception type for missing property
lidavidm Aug 31, 2022
ab3db68
More lowercasing of properties
lidavidm Aug 31, 2022
4f39c02
Accept both arrow-flight: and arrow-flight-sql:
lidavidm Aug 31, 2022
7d2f95b
Rename
lidavidm Aug 31, 2022
6042d2e
Merge pull request #5 from lidavidm/flight-sql-jdbc
jduo Sep 12, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions java/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ install_manifest.txt
target/
?/
!/c/

# Generated properties file
flight/flight-sql-jdbc-driver/src/main/resources/properties/flight.properties
2 changes: 2 additions & 0 deletions java/dev/checkstyle/suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,6 @@
<!-- Suppress certain checks requiring many code changes, that add little benefit -->
<suppress checks="NoFinalizer|OverloadMethodsDeclarationOrder|VariableDeclarationUsageDistance" files=".*" />

<!-- No license header in generated file -->
<suppress checks="header" files="flight.properties"/>
</suppressions>
40 changes: 40 additions & 0 deletions java/flight/flight-sql-jdbc-driver/jdbc-spotbugs-exclude.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
license agreements. See the NOTICE file distributed with this work for additional
information regarding copyright ownership. The ASF licenses this file to
You under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of
the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
by applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
OF ANY KIND, either express or implied. See the License for the specific
language governing permissions and limitations under the License. -->

<FindBugsFilter>
<!-- These elements are supposed to be mutable -->
<Match>
<Package name="~org\.apache\.arrow\.driver\.jdbc\.accessor\.impl.*"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="org.apache.arrow.driver.jdbc.client.ArrowFlightSqlClientHandler"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="org.apache.arrow.driver.jdbc.utils.ConnectionWrapper"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="org.apache.arrow.driver.jdbc.ArrowFlightJdbcDataSource"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="org.apache.arrow.driver.jdbc.ArrowFlightJdbcCursor"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>

<Match>
<Class name="org.apache.arrow.driver.jdbc.ArrowFlightJdbcDataSource"/>
<Bug pattern="EI_EXPOSE_REP"/>
</Match>
</FindBugsFilter>
375 changes: 375 additions & 0 deletions java/flight/flight-sql-jdbc-driver/pom.xml

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.arrow.driver.jdbc;

import static org.apache.arrow.driver.jdbc.utils.ArrowFlightConnectionConfigImpl.ArrowFlightConnectionProperty.replaceSemiColons;

import java.sql.SQLException;
import java.util.Properties;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import org.apache.arrow.driver.jdbc.client.ArrowFlightSqlClientHandler;
import org.apache.arrow.driver.jdbc.utils.ArrowFlightConnectionConfigImpl;
import org.apache.arrow.flight.FlightClient;
import org.apache.arrow.memory.BufferAllocator;
import org.apache.arrow.util.AutoCloseables;
import org.apache.arrow.util.Preconditions;
import org.apache.calcite.avatica.AvaticaConnection;
import org.apache.calcite.avatica.AvaticaFactory;

import io.netty.util.concurrent.DefaultThreadFactory;

/**
* Connection to the Arrow Flight server.
*/
public final class ArrowFlightConnection extends AvaticaConnection {

private final BufferAllocator allocator;
private final ArrowFlightSqlClientHandler clientHandler;
private final ArrowFlightConnectionConfigImpl config;
private ExecutorService executorService;

/**
* Creates a new {@link ArrowFlightConnection}.
*
* @param driver the {@link ArrowFlightJdbcDriver} to use.
* @param factory the {@link AvaticaFactory} to use.
* @param url the URL to use.
* @param properties the {@link Properties} to use.
* @param config the {@link ArrowFlightConnectionConfigImpl} to use.
* @param allocator the {@link BufferAllocator} to use.
* @param clientHandler the {@link ArrowFlightSqlClientHandler} to use.
*/
private ArrowFlightConnection(final ArrowFlightJdbcDriver driver, final AvaticaFactory factory,
final String url, final Properties properties,
final ArrowFlightConnectionConfigImpl config,
final BufferAllocator allocator,
final ArrowFlightSqlClientHandler clientHandler) {
super(driver, factory, url, properties);
this.config = Preconditions.checkNotNull(config, "Config cannot be null.");
this.allocator = Preconditions.checkNotNull(allocator, "Allocator cannot be null.");
this.clientHandler = Preconditions.checkNotNull(clientHandler, "Handler cannot be null.");
}

/**
* Creates a new {@link ArrowFlightConnection} to a {@link FlightClient}.
*
* @param driver the {@link ArrowFlightJdbcDriver} to use.
* @param factory the {@link AvaticaFactory} to use.
* @param url the URL to establish the connection to.
* @param properties the {@link Properties} to use for this session.
* @param allocator the {@link BufferAllocator} to use.
* @return a new {@link ArrowFlightConnection}.
* @throws SQLException on error.
*/
static ArrowFlightConnection createNewConnection(final ArrowFlightJdbcDriver driver,
final AvaticaFactory factory,
String url, final Properties properties,
final BufferAllocator allocator)
throws SQLException {
url = replaceSemiColons(url);
final ArrowFlightConnectionConfigImpl config = new ArrowFlightConnectionConfigImpl(properties);
final ArrowFlightSqlClientHandler clientHandler = createNewClientHandler(config, allocator);
return new ArrowFlightConnection(driver, factory, url, properties, config, allocator, clientHandler);
}

private static ArrowFlightSqlClientHandler createNewClientHandler(
final ArrowFlightConnectionConfigImpl config,
final BufferAllocator allocator) throws SQLException {
try {
return new ArrowFlightSqlClientHandler.Builder()
.withHost(config.getHost())
.withPort(config.getPort())
.withUsername(config.getUser())
.withPassword(config.getPassword())
.withTrustStorePath(config.getTrustStorePath())
.withTrustStorePassword(config.getTrustStorePassword())
.withSystemTrustStore(config.useSystemTrustStore())
.withBufferAllocator(allocator)
.withEncryption(config.useEncryption())
.withDisableCertificateVerification(config.getDisableCertificateVerification())
.withToken(config.getToken())
.withCallOptions(config.toCallOption())
.build();
} catch (final SQLException e) {
try {
allocator.close();
} catch (final Exception allocatorCloseEx) {
e.addSuppressed(allocatorCloseEx);
}
throw e;
}
}

void reset() throws SQLException {
// Clean up any open Statements
try {
AutoCloseables.close(statementMap.values());
} catch (final Exception e) {
throw AvaticaConnection.HELPER.createException(e.getMessage(), e);
}

statementMap.clear();

// Reset Holdability
this.setHoldability(this.metaData.getResultSetHoldability());

// Reset Meta
((ArrowFlightMetaImpl) this.meta).setDefaultConnectionProperties();
}

/**
* Gets the client {@link #clientHandler} backing this connection.
*
* @return the handler.
*/
ArrowFlightSqlClientHandler getClientHandler() throws SQLException {
return clientHandler;
}

/**
* Gets the {@link ExecutorService} of this connection.
*
* @return the {@link #executorService}.
*/
synchronized ExecutorService getExecutorService() {
return executorService = executorService == null ?
Executors.newFixedThreadPool(config.threadPoolSize(),
new DefaultThreadFactory(getClass().getSimpleName())) :
executorService;
}

@Override
public Properties getClientInfo() {
final Properties copy = new Properties();
copy.putAll(info);
return copy;
}

@Override
public void close() throws SQLException {
if (executorService != null) {
executorService.shutdown();
}

try {
AutoCloseables.close(clientHandler);
allocator.getChildAllocators().forEach(AutoCloseables::closeNoChecked);
AutoCloseables.close(allocator);

super.close();
} catch (final Exception e) {
throw AvaticaConnection.HELPER.createException(e.getMessage(), e);
}
}

BufferAllocator getBufferAllocator() {
return allocator;
}

public ArrowFlightMetaImpl getMeta() {
return (ArrowFlightMetaImpl) this.meta;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.arrow.driver.jdbc;

import java.sql.SQLException;
import java.sql.Statement;

import org.apache.arrow.flight.FlightInfo;

/**
* A {@link Statement} that deals with {@link FlightInfo}.
*/
public interface ArrowFlightInfoStatement extends Statement {

@Override
ArrowFlightConnection getConnection() throws SQLException;

/**
* Executes the query this {@link Statement} is holding.
*
* @return the {@link FlightInfo} for the results.
* @throws SQLException on error.
*/
FlightInfo executeFlightInfoQuery() throws SQLException;
}
Loading