Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
237 commits
Select commit Hold shift + click to select a range
370c92e
WIP: Set up flight-sql project on cpp directory
rafael-telles Aug 23, 2021
7dc836e
Update FindArrowFlightSql.cmake
rafael-telles Aug 24, 2021
2ed7b0e
WIP: Clean up changes
rafael-telles Aug 24, 2021
f3fe962
Fix checkstyle issues
rafael-telles Sep 6, 2021
fde5c00
[C++] Implements methods from flight-sql-client (#120)
jcralmeida Sep 14, 2021
69dbdec
[C++] Implement Flight SQL client test application (#121)
rafael-telles Sep 15, 2021
e078c05
Implement executeUpdate logic on sql client
jcralmeida Sep 14, 2021
83db012
Create a mock test for execute_update method on sql_client
jcralmeida Sep 14, 2021
015d015
Refactor client_impl to reduce duplication on FlightDescriptor build
rafael-telles Sep 16, 2021
7aa4c14
Change rows on executeUpdate to a unique_ptr
jcralmeida Sep 17, 2021
59e1c28
Change order of output parameters on methods from flight-sql
jcralmeida Sep 17, 2021
5e11c82
Checkstyle fix on flight-sql
jcralmeida Sep 17, 2021
bd2890e
Change order of call from ExecuteUpdate on test_app.cc
jcralmeida Sep 17, 2021
bf5cfef
Change ExecuteUpdate output argument to raw pointer instead of unique…
rafael-telles Sep 20, 2021
03425db
Add flight-sql server header file
jcralmeida Sep 22, 2021
eeb4a35
Remove flight-sql from CMakeLists.txt
jcralmeida Sep 22, 2021
a25bb90
Remove doPut* methods (not used yet)
rafael-telles Sep 22, 2021
c5d6301
Add more statement to the getFlightInfo methods
jcralmeida Sep 22, 2021
5f7a4c8
Implement missing branches on DoGet
rafael-telles Sep 22, 2021
8aaee1e
Fix wrong arguments on server header file
rafael-telles Sep 22, 2021
4099ad2
Improve documentation on sql_server.h
rafael-telles Sep 22, 2021
685ccd0
Add missing else if on DoGet method
jcralmeida Sep 23, 2021
cffd1f4
Separate implementation from header file
jcralmeida Sep 24, 2021
5bd548f
Remove empty constructor and destructor from FlightSqlServerBase header
rafael-telles Sep 24, 2021
9dd9a32
Change default Status return on GetFlightInfo and DoGet
rafael-telles Sep 28, 2021
87fc8aa
Implement Flight SQL example server using SQLite3
rafael-telles Sep 24, 2021
3584fc0
Add missing sqlite3 dependency on vcpkg.json
rafael-telles Sep 24, 2021
f7b6461
Add documentation to example classes
rafael-telles Sep 24, 2021
2232dd6
Add integration tests for Flight SQL server example
rafael-telles Sep 27, 2021
93c5a4b
Fix checkstyle errors
rafael-telles Sep 28, 2021
68bec01
Fix minor comments on PR
rafael-telles Sep 28, 2021
5d3bc66
Improve readability for SqliteFlightSqlServer setup
rafael-telles Sep 28, 2021
7add18f
Implement CommandGetCatalogs
rafael-telles Sep 28, 2021
060e9b4
Refactor tests to reduce duplication
rafael-telles Sep 28, 2021
d754fde
Fix minor comments on PR
rafael-telles Sep 28, 2021
a631b4f
Add comment about hardcoded GetCatalogs implementation
rafael-telles Sep 29, 2021
b8f5dda
Make GetCatalogs return empty results
rafael-telles Sep 29, 2021
5e57cd1
Implement CommandGetSchemas
rafael-telles Oct 5, 2021
2fdc7c8
Fix problem when linking protobuf to flight-sql targets
rafael-telles Sep 30, 2021
f1d9f9d
Fix checkstyle errors
rafael-telles Sep 30, 2021
e68f6e6
Implement CommandGetSchemas
rafael-telles Sep 29, 2021
b22fe92
Undo unscoped changes to other files
rafael-telles Sep 30, 2021
c750b15
Fix style issues
rafael-telles Oct 6, 2021
cac2d9f
Fix style issues
rafael-telles Oct 6, 2021
203e64f
Create a class to deal the DoGetTables when schema is included
jcralmeida Sep 28, 2021
6b6d9c2
Include methods GetTablesFlightInfo and DoGetTables
jcralmeida Sep 28, 2021
86a0ba0
Add the schemas to be used by the GetTabkes
jcralmeida Sep 28, 2021
7d53dd6
Add class to tge CMakeLists.txt
jcralmeida Sep 28, 2021
814dc10
Refactor the name of class sqlite table schema batch reader
jcralmeida Sep 29, 2021
aef712a
Add new filter to the query on GetTables
jcralmeida Sep 29, 2021
8a3dc6d
Add new tests to GetTables
jcralmeida Sep 29, 2021
a0f32ba
Refactor test from GetTables
jcralmeida Sep 30, 2021
8a02752
Refactor methods that parse the table type to field type
jcralmeida Sep 30, 2021
01266d7
Add table type filter to the query
jcralmeida Sep 30, 2021
5bc0e9f
Add a DECLARE_BINARY_ARRAY for testing
jcralmeida Sep 30, 2021
60b8326
Add more test for the GetTables
jcralmeida Sep 30, 2021
8e846c8
Fix checkstyle
jcralmeida Sep 30, 2021
b8d8396
change constructor initialization
jcralmeida Sep 30, 2021
0aa1cab
Modify Macro from builder to deal with null values
jcralmeida Sep 30, 2021
574878f
Set values from catalogs and schema as null
jcralmeida Sep 30, 2021
9a838a9
Update CMakeLists.txt
jcralmeida Sep 30, 2021
bd19a66
Fix checkstyle
jcralmeida Sep 30, 2021
4a99053
Add method prepareQuery
jcralmeida Oct 1, 2021
abe5af8
Invert order of vector on tests
jcralmeida Oct 1, 2021
e5ea5eb
Pass the query to the batch reader vector for the table with schemas
jcralmeida Oct 1, 2021
449938b
Remove extra space
jcralmeida Oct 5, 2021
5e2071c
Decouple method PrepareQueryForGetTables from the class
jcralmeida Oct 5, 2021
61af7d4
Fix import order
jcralmeida Oct 5, 2021
9f90bde
Refactor constructor from the class sqlite_tables_schema_batch_reader
jcralmeida Oct 5, 2021
d962a33
Fix checkstyle
jcralmeida Oct 5, 2021
05d6280
Move anonymous function to the top of file
jcralmeida Oct 6, 2021
4f0807a
Remove status from sqlite use
jcralmeida Oct 6, 2021
6bf3fde
change parameter from string to char* on GetArrowType method
jcralmeida Oct 6, 2021
ec0319c
Fix checkstyle
jcralmeida Oct 6, 2021
d10d191
Add a method to reset the statement to its original condition
jcralmeida Oct 6, 2021
acfaec0
Add a variable to control the execution flow
jcralmeida Oct 6, 2021
95e7507
Fix missing files from rebase
jcralmeida Oct 6, 2021
250a3c4
Add missing include
jcralmeida Oct 6, 2021
b708954
Remove unused RecordBatchReader
jcralmeida Oct 7, 2021
6c52c28
Passes the rc variable as reference to Reset method
jcralmeida Oct 7, 2021
a7ff457
Add missing return at docs from SqlSchema methods
jcralmeida Oct 7, 2021
1036ec8
Remove extra line
jcralmeida Oct 7, 2021
2a221a6
Implement CommandGetSchemas
rafael-telles Oct 5, 2021
70800d0
Add the schemas to be used by the GetTabkes
jcralmeida Sep 28, 2021
3066113
Fix checkstyle
jcralmeida Sep 30, 2021
3b08157
Implement CommandGetSchemas
rafael-telles Sep 29, 2021
83b1c16
Add PreparedStatementClass to sql client
jcralmeida Oct 6, 2021
ee1ed19
implemenet methods PreparedStatemenetClass in sql_client
jcralmeida Oct 6, 2021
ea75e69
Create a mocked sql_client test for the preparedStatement
jcralmeida Oct 6, 2021
fe96fe0
Refactor the creation of the PreparedStatement on sql_client
jcralmeida Oct 6, 2021
a5c362c
Add a branch on test_app to execute a query with PreparedStatement mode
jcralmeida Oct 6, 2021
9414a2e
Fix checkstyle
jcralmeida Oct 6, 2021
a46dd6d
Adding missing files from rebase
jcralmeida Oct 6, 2021
297b7f0
Treat if the statement is already closed
jcralmeida Oct 6, 2021
4b0adb6
Fix test_app for prepared statement execution
jcralmeida Oct 6, 2021
f80bfaf
Pass options to the client calls
jcralmeida Oct 6, 2021
78b4540
Modify the constructor of the PreparedStatement
jcralmeida Oct 6, 2021
8d60000
Remove duplicate function due to rebase
jcralmeida Oct 6, 2021
de161ec
Remove extra lines and duplicated import
jcralmeida Oct 7, 2021
d30cef2
Move constructor to the top of the file
jcralmeida Oct 7, 2021
8f23bd5
rename the variable of the CommandPreparedStatementQuery
jcralmeida Oct 7, 2021
6759818
Make the destructor call the Close method
jcralmeida Oct 7, 2021
a9361aa
Remove options as parameter from PreparedStatement methods
jcralmeida Oct 7, 2021
3c3b928
Make the mock object be called twice
jcralmeida Oct 7, 2021
f8f404a
Remove duplicate import
rafael-telles Oct 7, 2021
dcc8f7f
Add GetSqlInfo on client side for FlightSQL
Oct 7, 2021
ac77dbc
Change SqliteStatement.Reset argumento to pointer
rafael-telles Oct 7, 2021
08b0294
Implement CommandStatementUpdate on server example
rafael-telles Oct 7, 2021
ca73815
Add missing docs for DoPutCommandStatementUpdate
rafael-telles Oct 7, 2021
46c5681
Implement CommandGetSchemas
rafael-telles Oct 5, 2021
e85e8f8
Fix checkstyle
jcralmeida Sep 30, 2021
e98fd67
Add methods to set and get parameters
jcralmeida Oct 7, 2021
832aec3
add paremter binding to query execution with prepared statement
jcralmeida Oct 7, 2021
7f9daa9
remove unused code from test_app
jcralmeida Oct 7, 2021
9ccb72e
remove TODO
jcralmeida Oct 7, 2021
b2b1b8c
Add macro ARRROW_RETURN_NOT_OK
jcralmeida Oct 7, 2021
b19552e
Fix add a break line
jcralmeida Oct 8, 2021
15a6b3d
Pass option to DoPut CALL
jcralmeida Oct 8, 2021
b59afc6
Create a mocked client test for parameter binding
jcralmeida Oct 8, 2021
e3facf7
Add prepared statement parameter binding to test app
jcralmeida Oct 8, 2021
eb2f76c
Add missing docs to prepared statement methods
jcralmeida Oct 8, 2021
432b026
Implement method GetResultSetSchema
jcralmeida Oct 8, 2021
8327b47
change (void) to ASSERT_OK on test
jcralmeida Oct 8, 2021
2f1c935
change const references from setParameters method
jcralmeida Oct 8, 2021
5146279
Sort includes alphabetically
jcralmeida Oct 8, 2021
afd0e3e
Add comment when calling ReadMetadata on DoPut
jcralmeida Oct 8, 2021
042fcc2
use variable close to its use
jcralmeida Oct 8, 2021
e8efe63
Implement CommandGetTableTypes on server example
rafael-telles Oct 8, 2021
171d540
[CPP] Implements GetPrimaryKeys on flight sql server (#162)
jcralmeida Oct 12, 2021
6e2c9e9
[C++] Implement CommandGetImportedKeys and CommandGetExportedKeys (#163)
rafael-telles Oct 12, 2021
1e437aa
Add Create/Close prepared statement actions to sql_server
rafael-telles Oct 5, 2021
1bf1ea0
WIP: Implement prepared statement on server example
rafael-telles Oct 5, 2021
66a0e41
Implement parameter binding on Flight SQL server and example
rafael-telles Oct 7, 2021
b8417b1
Remove GetArrowType method duplicate
rafael-telles Oct 8, 2021
54ecc38
Add missing docs for GetArrowType
rafael-telles Oct 8, 2021
a9c11db
Add integration tests for PreparedStatement query
rafael-telles Oct 8, 2021
247be5b
Make changes regarding to reviews
rafael-telles Oct 8, 2021
22320fd
Make changes regarding to reviews
rafael-telles Oct 8, 2021
2d23d07
Fix broken test for PreparedStatement.ExecuteUpdate without parameter…
Oct 12, 2021
d9ab934
Add test case for PreparedStatement.ExecuteUpdate with parameter binding
Oct 12, 2021
86fe046
Fix rebase issues
Oct 12, 2021
464248d
WIP: Refactor test cases for PreparedStatement.ExecuteUpdate
Oct 13, 2021
14d2725
WIP: Refactor test cases for PreparedStatement.ExecuteUpdate to use l…
Oct 13, 2021
b9205c1
Refactor ExecuteUpdate with parameter binding test
jcralmeida Oct 13, 2021
ade534d
Fix SIGSEV in test case for PreparedStatement.ExecuteUpdate with para…
Oct 13, 2021
5d03029
Minor refactor: move variables closer to used
Oct 13, 2021
b300415
Fix resource leak where record batch is being created for client_impl.h
Oct 14, 2021
a89a8ff
Fix CheckStyle issues
rafael-telles Oct 14, 2021
6248009
Rename server files
rafael-telles Oct 14, 2021
d0e9476
Fix wrong error messages on server.cpp
rafael-telles Oct 18, 2021
84ae269
Implement CommandPreparedStatementUpdate on SQL server example (#169)
rafael-telles Oct 18, 2021
e9aafe7
[C++] CommandGetCrossReference (#172)
rafael-telles Oct 19, 2021
8b5324f
Rename flight-sql/server.cpp to server.cc
rafael-telles Oct 19, 2021
87e02ac
Fix linter issues
rafael-telles Oct 21, 2021
655d8dd
Use ASSERT_OK on client_test.cc
rafael-telles Oct 22, 2021
3895b53
[C++] Improve Client interface (#180)
rafael-telles Oct 25, 2021
9a96bbd
[CPP] Change the way arrays are created in flight-sql tests (#179)
jcralmeida Oct 25, 2021
ba73327
[C++] Improvements on CMakeLists.txt (#178)
rafael-telles Oct 25, 2021
5010c1b
Fix flaky tests
rafael-telles Oct 25, 2021
fdbe5f1
[C++] Wrap Protobufs on server (#182)
rafael-telles Oct 26, 2021
5acfa23
Fix compiler warnings on client_impl.h
rafael-telles Oct 26, 2021
30929b7
Fix linting issues
rafael-telles Oct 26, 2021
6ab6e27
Change ASSERT_TRUE to AsserTableEqual()
jcralmeida Oct 26, 2021
92b7b48
Improve DoPutUpdateResult parsing
rafael-telles Oct 26, 2021
4dfa026
Handle errors on all Parse and Unpack calls to Protobuf (#185)
rafael-telles Oct 27, 2021
f1199de
Add ARROW_EXPORT and change designated initializer from struct (#189)
jcralmeida Oct 28, 2021
3d0dcfe
[C++] Remove templating from client interface (#184)
rafael-telles Oct 28, 2021
838469f
Remove explicit using of GFlags namespaces
rafael-telles Oct 28, 2021
d89a82e
Remove unnecessary const modifiers on client interface
rafael-telles Oct 28, 2021
166bb6b
Rename directory flight-sql to flight_sql
rafael-telles Nov 1, 2021
8095b6e
Remove unused includes on server.h
rafael-telles Nov 1, 2021
b26bfc4
[C++] Other fixes for ratification (#190)
rafael-telles Nov 2, 2021
c079a47
[C++] Use util::optional on Flight SQL structs (#191)
rafael-telles Nov 2, 2021
f080caa
[CPP] Fix on sqlite classes from FlightSqlServer (#181)
jcralmeida Nov 2, 2021
92c5464
Remove unused variable on CMakeLists.txt
rafael-telles Nov 3, 2021
9716a20
Fix issues reported by cppcheck
rafael-telles Nov 3, 2021
697cde3
[C++] Ensure client_test.cc does not violate ODR (#192)
rafael-telles Nov 3, 2021
9ef1cae
Fix some issues on CMake and Server Test
JrJuscelino Oct 27, 2021
39f63c2
Made fixture to client_test.cc to avoid duplication
JrJuscelino Oct 28, 2021
4abcd45
fix: merge test client
JrJuscelino Nov 2, 2021
75f67ad
Fix some issues on CMake and Server Test
JrJuscelino Oct 27, 2021
d480e77
Made fixture to client_test.cc to avoid duplication
JrJuscelino Oct 28, 2021
996c708
Format test files
JrJuscelino Nov 2, 2021
89b4f17
fix: correct issues on tests
JrJuscelino Nov 3, 2021
24343e2
Fix memory leak with mock
JrJuscelino Nov 3, 2021
70bda0c
Fix test_server
JrJuscelino Nov 3, 2021
698645d
fix server stop on serve rt
JrJuscelino Nov 3, 2021
4656975
Change server to unique pointer on server tests
JrJuscelino Nov 3, 2021
2483ff4
Change sql_client to unique_pointer on server test
JrJuscelino Nov 4, 2021
9135703
server.reset() and sql_client.reset() on server test TearDown
JrJuscelino Nov 4, 2021
f604d46
Fix sql_cliente close before server on server test
JrJuscelino Nov 4, 2021
e2e57ae
Fix sql_client close before server stop server test
JrJuscelino Nov 4, 2021
0b32b27
implement FindSQLite3Alt on cmake modules
JrJuscelino Nov 8, 2021
71f877d
Remove wrong line on CmakeLists
JrJuscelino Nov 8, 2021
093b539
Fix protobuf version on flight-core
JrJuscelino Nov 9, 2021
d40ef99
Reestructure FlightSqlClient to use virtual methods (#195)
rafael-telles Nov 9, 2021
5f5ea06
Fix wrong parameter name on SetParameters docs on client.h
JrJuscelino Nov 10, 2021
5e1c200
Fix linter erros on FindSQLite3Alt.cmake
JrJuscelino Nov 10, 2021
35a530a
Fix FindSQLite3Alt.cmake
JrJuscelino Nov 10, 2021
df1ce71
[CPP] Modify the way arrays are created in tests (#199)
jcralmeida Nov 10, 2021
0519976
Update vcpkg.json and remove unused variable on CMakeLists.txt (#200)
rafael-telles Nov 10, 2021
93f93c4
[CPP] Fix issues from client files in flight-sql (#201)
jcralmeida Nov 10, 2021
817baf9
Fix code style issues
rafael-telles Nov 10, 2021
404b27d
[C++] Implement GetSqlInfo on server example (#193)
rafael-telles Nov 10, 2021
776d739
Fix method docs errors on server.h and sqlite example
JrJuscelino Nov 11, 2021
9e352e3
Change CreateStatementQueryTicket to a free function
jcralmeida Nov 10, 2021
8ececc8
Remove old use of CreateStatementQueryTicket
jcralmeida Nov 10, 2021
26f0c19
Make parameter ordering consistent
jcralmeida Nov 10, 2021
6908d38
Change status type on sqlite classes
jcralmeida Nov 10, 2021
45b58cb
Add documentation on public method GetFlightInfo
jcralmeida Nov 10, 2021
c778682
Change Status to arrow::Result on CreateStatementQueryTicket method
jcralmeida Nov 11, 2021
2e48187
Fix method docs on server.h
JrJuscelino Nov 11, 2021
ec1c4d0
Fix ODR violation when linking protobuf
rafael-telles Nov 11, 2021
3cee40c
Fix code style issues
rafael-telles Nov 11, 2021
6c98d52
Fix FindSQLite3Alt.cmake
JrJuscelino Nov 11, 2021
f055570
Enable Flight SQL C++ on CI
rafael-telles Nov 12, 2021
fd9bd94
Fix build when BUILD_EXAMPLES or BUILD_TESTS is OFF
rafael-telles Nov 15, 2021
76d04ea
[C++] Fix comments on ratification PR (round 3) (#205)
rafael-telles Nov 15, 2021
9fcacf2
Fix CMake minor issue, add sql_info_types.h
rafael-telles Nov 15, 2021
56d84e9
Rename directory flight_sql to sql (#210)
rafael-telles Nov 19, 2021
7d74b7e
[C++] Address ratification comments (round 4) (#212)
rafael-telles Nov 25, 2021
9e3c928
[C++] Address ratification comments (round 4 - part 2) (#213)
rafael-telles Nov 25, 2021
c36b817
Remove PRECOMPILED_HEADERS option on arrow_flight_sql's CMakeList.txt
rafael-telles Nov 26, 2021
e8d8a13
[C++] Address ratification comments (round 4 - part 3) (#214)
rafael-telles Nov 26, 2021
fe9d7dc
Make sure to wait for server to be ready before running tests (#220)
rafael-telles Dec 2, 2021
8431e41
[C++] Address ratification comments (round 4 - part 4) (#215)
rafael-telles Dec 2, 2021
2b3839a
Remove generated protobuf enum from example application
rafael-telles Dec 2, 2021
99ae021
Remove need of RunServerInternal
rafael-telles Dec 3, 2021
ea94097
Use TCP instead on unix sockets on server_test.cc
rafael-telles Dec 3, 2021
de8600c
nit: Fix indentation on cpp_build.sh
rafael-telles Dec 3, 2021
cfe9e2a
Use EXPECT_RAISES_WITH_MESSAGE_THAT on TestFlightSqlServer#TestComman…
rafael-telles Dec 3, 2021
6a928ca
Move implementation of methods and data from SQLiteFlightSqlServer to…
rafael-telles Dec 3, 2021
023f71a
Use std::generate_n to generate random string on sqlite_server.cc
rafael-telles Dec 3, 2021
dd9d507
Remove dependency on boost/lexical_cast.hpp
rafael-telles Dec 6, 2021
9a9b536
Change SQL_NUMERIC_FUNCTIONS result on sqlite_sql_info to uppercase
rafael-telles Dec 6, 2021
076187e
Add better description to table types on FlightSql.proto
rafael-telles Dec 6, 2021
72ce72b
Fix documentation for GetSqlInfo on FlightSql.proto
rafael-telles Dec 6, 2021
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
1 change: 1 addition & 0 deletions ci/docker/conda-cpp.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ ENV ARROW_BUILD_TESTS=ON \
ARROW_DATASET=ON \
ARROW_DEPENDENCY_SOURCE=CONDA \
ARROW_FLIGHT=ON \
ARROW_FLIGHT_SQL=ON \
ARROW_GANDIVA=ON \
ARROW_HOME=$CONDA_PREFIX \
ARROW_ORC=ON \
Expand Down
1 change: 1 addition & 0 deletions ci/scripts/cpp_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ cmake \
-DARROW_EXTRA_ERROR_CONTEXT=${ARROW_EXTRA_ERROR_CONTEXT:-OFF} \
-DARROW_FILESYSTEM=${ARROW_FILESYSTEM:-ON} \
-DARROW_FLIGHT=${ARROW_FLIGHT:-OFF} \
-DARROW_FLIGHT_SQL=${ARROW_FLIGHT_SQL:-OFF} \
-DARROW_FUZZING=${ARROW_FUZZING:-OFF} \
-DARROW_GANDIVA_JAVA=${ARROW_GANDIVA_JAVA:-OFF} \
-DARROW_GANDIVA_PC_CXX_FLAGS=${ARROW_GANDIVA_PC_CXX_FLAGS:-} \
Expand Down
4 changes: 4 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,10 @@ if(ARROW_GANDIVA)
set(ARROW_WITH_RE2 ON)
endif()

if(ARROW_FLIGHT_SQL)
set(ARROW_FLIGHT ON)
endif()

if(ARROW_CUDA
OR ARROW_FLIGHT
OR ARROW_PARQUET
Expand Down
2 changes: 2 additions & 0 deletions cpp/cmake_modules/DefineOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
define_option(ARROW_FLIGHT
"Build the Arrow Flight RPC System (requires GRPC, Protocol Buffers)" OFF)

define_option(ARROW_FLIGHT_SQL "Build the Arrow Flight SQL extension" OFF)

define_option(ARROW_GANDIVA "Build the Gandiva libraries" OFF)

define_option(ARROW_GCS
Expand Down
93 changes: 93 additions & 0 deletions cpp/cmake_modules/FindArrowFlightSql.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# 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.

# - Find Arrow Flight SQL
#
# This module requires Arrow from which it uses
# arrow_find_package()
#
# This module defines
# ARROW_FLIGHT_SQL_FOUND, whether Flight has been found
# ARROW_FLIGHT_SQL_IMPORT_LIB,
# path to libarrow_flight's import library (Windows only)
# ARROW_FLIGHT_SQL_INCLUDE_DIR, directory containing headers
# ARROW_FLIGHT_SQL_LIBS, deprecated. Use ARROW_FLIGHT_SQL_LIB_DIR instead
# ARROW_FLIGHT_SQL_LIB_DIR, directory containing Flight libraries
# ARROW_FLIGHT_SQL_SHARED_IMP_LIB, deprecated. Use ARROW_FLIGHT_SQL_IMPORT_LIB instead
# ARROW_FLIGHT_SQL_SHARED_LIB, path to libarrow_flight's shared library
# ARROW_FLIGHT_SQL_STATIC_LIB, path to libarrow_flight.a

if(DEFINED ARROW_FLIGHT_SQL_FOUND)
return()
endif()

set(find_package_arguments)
if(${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION)
list(APPEND find_package_arguments "${${CMAKE_FIND_PACKAGE_NAME}_FIND_VERSION}")
endif()
if(${CMAKE_FIND_PACKAGE_NAME}_FIND_REQUIRED)
list(APPEND find_package_arguments REQUIRED)
endif()
if(${CMAKE_FIND_PACKAGE_NAME}_FIND_QUIETLY)
list(APPEND find_package_arguments QUIET)
endif()
find_package(Arrow ${find_package_arguments})

if(ARROW_FOUND)
arrow_find_package(ARROW_FLIGHT_SQL
"${ARROW_HOME}"
arrow_flight_sql
arrow/flight/sql/api.h
ArrowFlightSql
arrow-flight-sql)
if(NOT ARROW_FLIGHT_SQL_VERSION)
set(ARROW_FLIGHT_SQL_VERSION "${ARROW_VERSION}")
endif()
endif()

if("${ARROW_FLIGHT_SQL_VERSION}" VERSION_EQUAL "${ARROW_VERSION}")
set(ARROW_FLIGHT_SQL_VERSION_MATCH TRUE)
else()
set(ARROW_FLIGHT_SQL_VERSION_MATCH FALSE)
endif()

mark_as_advanced(ARROW_FLIGHT_SQL_IMPORT_LIB
ARROW_FLIGHT_SQL_INCLUDE_DIR
ARROW_FLIGHT_SQL_LIBS
ARROW_FLIGHT_SQL_LIB_DIR
ARROW_FLIGHT_SQL_SHARED_IMP_LIB
ARROW_FLIGHT_SQL_SHARED_LIB
ARROW_FLIGHT_SQL_STATIC_LIB
ARROW_FLIGHT_SQL_VERSION
ARROW_FLIGHT_SQL_VERSION_MATCH)

find_package_handle_standard_args(
ArrowFlightSql
REQUIRED_VARS ARROW_FLIGHT_SQL_INCLUDE_DIR ARROW_FLIGHT_SQL_LIB_DIR
ARROW_FLIGHT_SQL_VERSION_MATCH
VERSION_VAR ARROW_FLIGHT_SQL_VERSION)
set(ARROW_FLIGHT_SQL_FOUND ${ArrowFlightSql_FOUND})

if(ArrowFlightSql_FOUND AND NOT ArrowFlightSql_FIND_QUIETLY)
message(STATUS "Found the Arrow Flight SQL by ${ARROW_FLIGHT_SQL_FIND_APPROACH}")
message(STATUS "Found the Arrow Flight SQL shared library: ${ARROW_FLIGHT_SQL_SHARED_LIB}"
)
message(STATUS "Found the Arrow Flight SQL import library: ${ARROW_FLIGHT_SQL_IMPORT_LIB}"
)
message(STATUS "Found the Arrow Flight SQL static library: ${ARROW_FLIGHT_SQL_STATIC_LIB}"
)
endif()
43 changes: 43 additions & 0 deletions cpp/cmake_modules/FindSQLite3Alt.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 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.

# Once done this will define
# - FindSQLite3Alt
#
# This module will set the following variables if found:
# SQLite3_INCLUDE_DIRS - SQLite3 include dir.
# SQLite3_LIBRARIES - List of libraries when using SQLite3.
# SQLite3_FOUND - True if SQLite3 found.
#
# Usage of this module as follows:
# find_package(SQLite3Alt)

find_path(SQLite3_INCLUDE_DIR sqlite3.h)
find_library(SQLite3_LIBRARY NAMES sqlite3)

# handle the QUIETLY and REQUIRED arguments and set SQLite3_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SQLite3Alt REQUIRED_VARS SQLite3_LIBRARY
SQLite3_INCLUDE_DIR)

mark_as_advanced(SQLite3_LIBRARY SQLite3_INCLUDE_DIR)

if(SQLite3Alt_FOUND)
set(SQLite3_INCLUDE_DIRS ${SQLite3_INCLUDE_DIR})
set(SQLite3_LIBRARIES ${SQLite3_LIBRARY})
endif()
4 changes: 4 additions & 0 deletions cpp/src/arrow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,10 @@ if(ARROW_FLIGHT)
add_subdirectory(flight)
endif()

if(ARROW_FLIGHT_SQL)
add_subdirectory(flight/sql)
endif()

if(ARROW_HIVESERVER2)
add_subdirectory(dbi/hiveserver2)
endif()
Expand Down
18 changes: 17 additions & 1 deletion cpp/src/arrow/flight/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,23 @@ if(WIN32)
list(APPEND ARROW_FLIGHT_LINK_LIBS ws2_32.lib)
endif()

if(ARROW_TEST_LINKAGE STREQUAL "static")
set(ARROW_FLIGHT_TEST_LINKAGE
"${ARROW_TEST_LINKAGE}"
PARENT_SCOPE)
if(Protobuf_USE_STATIC_LIBS)
message(STATUS "Linking Arrow Flight tests statically due to static Protobuf")
set(ARROW_FLIGHT_TEST_LINKAGE
"static"
PARENT_SCOPE)
endif()
if(NOT ARROW_GRPC_USE_SHARED)
message(STATUS "Linking Arrow Flight tests statically due to static gRPC")
set(ARROW_FLIGHT_TEST_LINKAGE
"static"
PARENT_SCOPE)
endif()

if(ARROW_FLIGHT_TEST_LINKAGE STREQUAL "static")
set(ARROW_FLIGHT_TEST_LINK_LIBS
arrow_flight_static arrow_flight_testing_static ${ARROW_FLIGHT_STATIC_LINK_LIBS}
${ARROW_TEST_LINK_LIBS})
Expand Down
36 changes: 36 additions & 0 deletions cpp/src/arrow/flight/sql/ArrowFlightSqlConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 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.
#
# This config sets the following variables in your project::
#
# ArrowFlightSql_FOUND - true if Arrow Flight SQL found on the system
#
# This config sets the following targets in your project::
#
# arrow_flight_sql_shared - for linked as shared library if shared library is built
# arrow_flight_sql_static - for linked as static library if static library is built

@PACKAGE_INIT@

include(CMakeFindDependencyMacro)
find_dependency(ArrowFlight)

# Load targets only once. If we load targets multiple times, CMake reports
# already existent target error.
if(NOT (TARGET arrow_flight_sql_shared OR TARGET arrow_flight_sql_static))
include("${CMAKE_CURRENT_LIST_DIR}/ArrowFlightSqlTargets.cmake")
endif()
100 changes: 100 additions & 0 deletions cpp/src/arrow/flight/sql/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# 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.

add_custom_target(arrow_flight_sql)

arrow_install_all_headers("arrow/flight/sql")

set(FLIGHT_SQL_PROTO_PATH "${ARROW_SOURCE_DIR}/../format")
set(FLIGHT_SQL_PROTO ${ARROW_SOURCE_DIR}/../format/FlightSql.proto)

set(FLIGHT_SQL_GENERATED_PROTO_FILES "${CMAKE_CURRENT_BINARY_DIR}/FlightSql.pb.cc"
"${CMAKE_CURRENT_BINARY_DIR}/FlightSql.pb.h")

set(PROTO_DEPENDS ${FLIGHT_SQL_PROTO} ${ARROW_PROTOBUF_LIBPROTOBUF})

add_custom_command(OUTPUT ${FLIGHT_SQL_GENERATED_PROTO_FILES}
COMMAND ${ARROW_PROTOBUF_PROTOC} "-I${FLIGHT_SQL_PROTO_PATH}"
"--cpp_out=${CMAKE_CURRENT_BINARY_DIR}" "${FLIGHT_SQL_PROTO}"
DEPENDS ${PROTO_DEPENDS})

set_source_files_properties(${FLIGHT_SQL_GENERATED_PROTO_FILES} PROPERTIES GENERATED TRUE)

add_custom_target(flight_sql_protobuf_gen ALL DEPENDS ${FLIGHT_SQL_GENERATED_PROTO_FILES})

set(ARROW_FLIGHT_SQL_SRCS server.cc sql_info_internal.cc client.cc
"${CMAKE_CURRENT_BINARY_DIR}/FlightSql.pb.cc")

add_arrow_lib(arrow_flight_sql
CMAKE_PACKAGE_NAME
ArrowFlightSql
PKG_CONFIG_NAME
arrow-flight-sql
OUTPUTS
ARROW_FLIGHT_SQL_LIBRARIES
SOURCES
${ARROW_FLIGHT_SQL_SRCS}
DEPENDENCIES
flight_sql_protobuf_gen
SHARED_LINK_FLAGS
${ARROW_VERSION_SCRIPT_FLAGS} # Defined in cpp/arrow/CMakeLists.txt
SHARED_LINK_LIBS
arrow_flight_shared
STATIC_LINK_LIBS
arrow_flight_static)

if(ARROW_FLIGHT_TEST_LINKAGE STREQUAL "static")
set(ARROW_FLIGHT_SQL_TEST_LINK_LIBS
arrow_flight_sql_static arrow_flight_testing_static
${ARROW_FLIGHT_STATIC_LINK_LIBS} ${ARROW_TEST_LINK_LIBS})
else()
set(ARROW_FLIGHT_SQL_TEST_LINK_LIBS arrow_flight_sql_shared arrow_flight_testing_shared
${ARROW_TEST_LINK_LIBS})
endif()

# Build test server for unit tests
if(ARROW_BUILD_TESTS OR ARROW_BUILD_EXAMPLES)
find_package(SQLite3Alt REQUIRED)

set(ARROW_FLIGHT_SQL_TEST_SERVER_SRCS
example/sqlite_sql_info.cc
example/sqlite_statement.cc
example/sqlite_statement_batch_reader.cc
example/sqlite_server.cc
example/sqlite_tables_schema_batch_reader.cc)

add_arrow_test(flight_sql_test
SOURCES
client_test.cc
server_test.cc
${ARROW_FLIGHT_SQL_TEST_SERVER_SRCS}
STATIC_LINK_LIBS
${ARROW_FLIGHT_SQL_TEST_LINK_LIBS}
${SQLite3_LIBRARIES}
LABELS
"arrow_flight_sql")

add_executable(flight_sql_test_server test_server_cli.cc
${ARROW_FLIGHT_SQL_TEST_SERVER_SRCS})
target_link_libraries(flight_sql_test_server
PRIVATE ${ARROW_FLIGHT_SQL_TEST_LINK_LIBS} ${GFLAGS_LIBRARIES}
${SQLite3_LIBRARIES})

add_executable(flight_sql_test_app test_app_cli.cc)
target_link_libraries(flight_sql_test_app PRIVATE ${ARROW_FLIGHT_SQL_TEST_LINK_LIBS}
${GFLAGS_LIBRARIES})
endif()
20 changes: 20 additions & 0 deletions cpp/src/arrow/flight/sql/api.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// 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.

#pragma once

#include "arrow/flight/sql/client.h"
25 changes: 25 additions & 0 deletions cpp/src/arrow/flight/sql/arrow-flight-sql.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 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.

libdir=@CMAKE_INSTALL_FULL_LIBDIR@
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@

Name: Apache Arrow Flight SQL
Description: Apache Arrow Flight SQL extension
Version: @ARROW_VERSION@
Requires: arrow-flight
Libs: -L${libdir} -larrow_flight_sql
Loading