Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ jobs:
ARROW_FLIGHT: ON
ARROW_FLIGHT_SQL: ON
ARROW_FLIGHT_SQL_ODBC: ON
ARROW_FLIGHT_SQL_ODBC_INSTALLER: ON
ARROW_GANDIVA: ON
ARROW_GCS: ON
ARROW_HDFS: OFF
Expand Down Expand Up @@ -476,6 +477,10 @@ jobs:
PIPX_BASE_PYTHON: ${{ steps.python-install.outputs.python-path }}
run: |
ci/scripts/install_gcs_testbench.sh default
- name: Register Flight SQL ODBC Driver
shell: cmd
run: |
call "cpp\src\arrow\flight\sql\odbc\install\install_amd64.cmd" ${{github.workspace}}\build\cpp\%ARROW_BUILD_TYPE%\libarrow_flight_sql_odbc.dll
- name: Test
shell: msys2 {0}
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ jobs:
ARROW_DATASET: ON
ARROW_FLIGHT: ON
ARROW_FLIGHT_SQL: ON
ARROW_FLIGHT_SQL_ODBC: ON
ARROW_GANDIVA: ON
ARROW_GCS: ON
ARROW_HDFS: OFF
Expand Down Expand Up @@ -331,6 +332,7 @@ jobs:
ARROW_DEPENDENCY_USE_SHARED: OFF
ARROW_FLIGHT: ON
ARROW_FLIGHT_SQL: ON
ARROW_FLIGHT_SQL_ODBC: ON
ARROW_GANDIVA: OFF
ARROW_GLIB_VAPI: "false"
ARROW_HDFS: OFF
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ dependency-reduced-pom.xml
MANIFEST
compile_commands.json
build.ninja
build*/

# Generated Visual Studio files
*.vcxproj
Expand Down Expand Up @@ -107,3 +108,6 @@ java/.mvn/.develocity/
# rat
filtered_rat.txt
rat.txt

# rc
*.rc
3 changes: 3 additions & 0 deletions ci/scripts/cpp_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ if [ "${ARROW_ENABLE_THREADING:-ON}" = "OFF" ]; then
ARROW_AZURE=OFF
ARROW_FLIGHT=OFF
ARROW_FLIGHT_SQL=OFF
ARROW_FLIGHT_SQL_ODBC=OFF
ARROW_GCS=OFF
ARROW_JEMALLOC=OFF
ARROW_MIMALLOC=OFF
Expand Down Expand Up @@ -207,6 +208,8 @@ else
-DARROW_FILESYSTEM=${ARROW_FILESYSTEM:-ON} \
-DARROW_FLIGHT=${ARROW_FLIGHT:-OFF} \
-DARROW_FLIGHT_SQL=${ARROW_FLIGHT_SQL:-OFF} \
-DARROW_FLIGHT_SQL_ODBC=${ARROW_FLIGHT_SQL_ODBC:-OFF} \
-DARROW_FLIGHT_SQL_ODBC_INSTALLER=${ARROW_FLIGHT_SQL_ODBC_INSTALLER:-OFF} \
-DARROW_FUZZING=${ARROW_FUZZING:-OFF} \
-DARROW_GANDIVA_PC_CXX_FLAGS=${ARROW_GANDIVA_PC_CXX_FLAGS:-} \
-DARROW_GANDIVA=${ARROW_GANDIVA:-OFF} \
Expand Down
8 changes: 6 additions & 2 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -720,9 +720,13 @@ endif()

install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/../LICENSE.txt
${CMAKE_CURRENT_SOURCE_DIR}/../NOTICE.txt
${CMAKE_CURRENT_SOURCE_DIR}/README.md DESTINATION "${ARROW_DOC_DIR}")
${CMAKE_CURRENT_SOURCE_DIR}/README.md
DESTINATION "${ARROW_DOC_DIR}"
COMPONENT arrow_doc)

install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/gdb_arrow.py DESTINATION "${ARROW_GDB_DIR}")
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/gdb_arrow.py
DESTINATION "${ARROW_GDB_DIR}"
COMPONENT arrow_gdb)

#
# Validate and print out Arrow configuration options
Expand Down
1 change: 1 addition & 0 deletions cpp/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@
"ARROW_BUILD_EXAMPLES": "ON",
"ARROW_BUILD_UTILITIES": "ON",
"ARROW_FLIGHT_SQL_ODBC": "ON",
"ARROW_FLIGHT_SQL_ODBC_INSTALLER": "ON",
"ARROW_TENSORFLOW": "ON",
"PARQUET_BUILD_EXAMPLES": "ON",
"PARQUET_BUILD_EXECUTABLES": "ON"
Expand Down
17 changes: 14 additions & 3 deletions cpp/cmake_modules/BuildUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,12 @@ function(arrow_install_cmake_package PACKAGE_NAME EXPORT_NAME)
write_basic_package_version_file("${BUILT_CONFIG_VERSION_CMAKE}"
COMPATIBILITY SameMajorVersion)
install(FILES "${BUILT_CONFIG_CMAKE}" "${BUILT_CONFIG_VERSION_CMAKE}"
DESTINATION "${ARROW_CMAKE_DIR}/${PACKAGE_NAME}")
DESTINATION "${ARROW_CMAKE_DIR}/${PACKAGE_NAME}"
COMPONENT config_cmake_file)
set(TARGETS_CMAKE "${PACKAGE_NAME}Targets.cmake")
install(EXPORT ${EXPORT_NAME}
DESTINATION "${ARROW_CMAKE_DIR}/${PACKAGE_NAME}"
COMPONENT config_cmake_export
NAMESPACE "${PACKAGE_NAME}::"
FILE "${TARGETS_CMAKE}")
endfunction()
Expand Down Expand Up @@ -403,8 +405,11 @@ function(ADD_ARROW_LIB LIB_NAME)
install(TARGETS ${LIB_NAME}_shared ${INSTALL_IS_OPTIONAL}
EXPORT ${LIB_NAME}_targets
ARCHIVE DESTINATION ${INSTALL_ARCHIVE_DIR}
COMPONENT ${LIB_NAME}_shared_archive
LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
COMPONENT ${LIB_NAME}_shared_library
RUNTIME DESTINATION ${INSTALL_RUNTIME_DIR}
COMPONENT ${LIB_NAME}_shared_runtime
INCLUDES
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
endif()
Expand Down Expand Up @@ -471,8 +476,11 @@ function(ADD_ARROW_LIB LIB_NAME)
install(TARGETS ${LIB_NAME}_static ${INSTALL_IS_OPTIONAL}
EXPORT ${LIB_NAME}_targets
ARCHIVE DESTINATION ${INSTALL_ARCHIVE_DIR}
COMPONENT ${LIB_NAME}_static_library
LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
COMPONENT ${LIB_NAME}_static_library
RUNTIME DESTINATION ${INSTALL_RUNTIME_DIR}
COMPONENT ${LIB_NAME}_static_library
INCLUDES
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
endif()
Expand Down Expand Up @@ -934,7 +942,9 @@ function(ARROW_INSTALL_ALL_HEADERS PATH)
endif()
list(APPEND PUBLIC_HEADERS ${HEADER})
endforeach()
install(FILES ${PUBLIC_HEADERS} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${PATH}")
install(FILES ${PUBLIC_HEADERS}
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${PATH}"
COMPONENT ${HEADER}_header)
endfunction()

function(ARROW_ADD_PKG_CONFIG MODULE)
Expand All @@ -944,7 +954,8 @@ function(ARROW_ADD_PKG_CONFIG MODULE)
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/${MODULE}.pc"
INPUT "${CMAKE_CURRENT_BINARY_DIR}/${MODULE}.pc.generate.in")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/${MODULE}.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig/")
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig/"
COMPONENT ${MODULE}_pkg_config)
endfunction()

# Implementations of lisp "car" and "cdr" functions
Expand Down
4 changes: 2 additions & 2 deletions cpp/cmake_modules/DefineOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ macro(tsort_bool_option_dependencies)
endmacro()

macro(resolve_option_dependencies)
# Arrow Flight SQL ODBC is available only for Windows for now.
if(NOT MSVC_TOOLCHAIN)
# Arrow Flight SQL ODBC is available only for Windows and macOS for now.
if(NOT WIN32 AND NOT APPLE)
set(ARROW_FLIGHT_SQL_ODBC OFF)
endif()
if(MSVC_TOOLCHAIN)
Expand Down
15 changes: 9 additions & 6 deletions cpp/cmake_modules/ThirdpartyToolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ function(provide_cmake_module MODULE_NAME ARROW_CMAKE_PACKAGE_NAME)
message(STATUS "Providing CMake module for ${MODULE_NAME} as part of ${ARROW_CMAKE_PACKAGE_NAME} CMake package"
)
install(FILES "${module}"
DESTINATION "${ARROW_CMAKE_DIR}/${ARROW_CMAKE_PACKAGE_NAME}")
DESTINATION "${ARROW_CMAKE_DIR}/${ARROW_CMAKE_PACKAGE_NAME}"
COMPONENT ${MODULE_NAME}_module)
endif()
endfunction()

Expand Down Expand Up @@ -1269,7 +1270,7 @@ if(ARROW_USE_BOOST)
endif()
if(ARROW_BOOST_REQUIRE_LIBRARY)
set(ARROW_BOOST_COMPONENTS filesystem system)
if(ARROW_FLIGHT_SQL_ODBC AND MSVC)
if(ARROW_FLIGHT_SQL_ODBC)
list(APPEND ARROW_BOOST_COMPONENTS locale)
endif()
if(ARROW_ENABLE_THREADING)
Expand Down Expand Up @@ -2377,20 +2378,22 @@ function(build_gtest)
endforeach()
install(DIRECTORY "${googletest_SOURCE_DIR}/googlemock/include/"
"${googletest_SOURCE_DIR}/googletest/include/"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
COMPONENT gtest_dir)
add_library(arrow::GTest::gtest_headers INTERFACE IMPORTED)
target_include_directories(arrow::GTest::gtest_headers
INTERFACE "${googletest_SOURCE_DIR}/googlemock/include/"
"${googletest_SOURCE_DIR}/googletest/include/")
install(TARGETS gmock gmock_main gtest gtest_main
EXPORT arrow_testing_targets
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT gtest_runtime
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT gtest_archive
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT gtest_library)
if(MSVC)
install(FILES $<TARGET_PDB_FILE:gmock> $<TARGET_PDB_FILE:gmock_main>
$<TARGET_PDB_FILE:gtest> $<TARGET_PDB_FILE:gtest_main>
DESTINATION "${CMAKE_INSTALL_BINDIR}"
COMPONENT gtest_pdb
OPTIONAL)
endif()
add_library(arrow::GTest::gmock ALIAS gmock)
Expand Down
13 changes: 9 additions & 4 deletions cpp/src/arrow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,8 @@ endmacro()
configure_file("util/config.h.cmake" "util/config.h" ESCAPE_QUOTES)
configure_file("util/config_internal.h.cmake" "util/config_internal.h" ESCAPE_QUOTES)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/util/config.h"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/arrow/util")
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/arrow/util"
COMPONENT arrow_config)

set(ARROW_SRCS
builder.cc
Expand Down Expand Up @@ -1039,7 +1040,8 @@ if(ARROW_BUILD_BUNDLED_DEPENDENCIES)
get_target_property(arrow_bundled_dependencies_path arrow_bundled_dependencies
IMPORTED_LOCATION)
install(FILES ${arrow_bundled_dependencies_path} ${INSTALL_IS_OPTIONAL}
DESTINATION ${CMAKE_INSTALL_LIBDIR})
DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT arrow_bundled_dependencies)
string(PREPEND ARROW_PC_LIBS_PRIVATE " -larrow_bundled_dependencies")
list(INSERT ARROW_STATIC_INSTALL_INTERFACE_LIBS 0 "Arrow::arrow_bundled_dependencies")
endif()
Expand Down Expand Up @@ -1156,6 +1158,7 @@ if(ARROW_BUILD_SHARED AND NOT WIN32)
if(ARROW_GDB_AUTO_LOAD_LIBARROW_GDB_INSTALL)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libarrow_gdb.py"
DESTINATION "${ARROW_GDB_AUTO_LOAD_LIBARROW_GDB_DIR}"
COMPONENT arrow_gdb
RENAME "$<TARGET_FILE_NAME:arrow_shared>-gdb.py")
endif()
endif()
Expand Down Expand Up @@ -1219,11 +1222,13 @@ arrow_install_all_headers("arrow")

config_summary_cmake_setters("${CMAKE_CURRENT_BINARY_DIR}/ArrowOptions.cmake")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ArrowOptions.cmake
DESTINATION "${ARROW_CMAKE_DIR}/Arrow")
DESTINATION "${ARROW_CMAKE_DIR}/Arrow"
COMPONENT arrow_options_cmake)

# For backward compatibility for find_package(arrow)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/arrow-config.cmake
DESTINATION "${ARROW_CMAKE_DIR}/Arrow")
DESTINATION "${ARROW_CMAKE_DIR}/Arrow"
COMPONENT arrow_config_cmake)

#
# Unit tests
Expand Down
4 changes: 3 additions & 1 deletion cpp/src/arrow/flight/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,9 @@ if(ARROW_TESTING)
STATIC_INSTALL_INTERFACE_LIBS
${ARROW_FLIGHT_TESTING_STATIC_INSTALL_INTERFACE_LIBS}
PRIVATE_INCLUDES
"${Protobuf_INCLUDE_DIRS}")
"${Protobuf_INCLUDE_DIRS}"
SHARED_PRIVATE_LINK_LIBS
GTest::gmock)

foreach(LIB_TARGET ${ARROW_FLIGHT_TESTING_LIBRARIES})
target_compile_definitions(${LIB_TARGET} PRIVATE ARROW_FLIGHT_EXPORTING)
Expand Down
11 changes: 9 additions & 2 deletions cpp/src/arrow/flight/sql/column_metadata.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,15 @@ const char* ColumnMetadata::kIsSearchable = "ARROW:FLIGHT:SQL:IS_SEARCHABLE";
const char* ColumnMetadata::kRemarks = "ARROW:FLIGHT:SQL:REMARKS";

ColumnMetadata::ColumnMetadata(
std::shared_ptr<const arrow::KeyValueMetadata> metadata_map)
: metadata_map_(std::move(metadata_map)) {}
std::shared_ptr<const arrow::KeyValueMetadata> metadata_map) {
if (metadata_map) {
metadata_map_ = std::move(metadata_map);
} else {
std::shared_ptr<const arrow::KeyValueMetadata> empty_metadata_map(
new arrow::KeyValueMetadata);
metadata_map_ = std::move(empty_metadata_map);
}
}

arrow::Result<std::string> ColumnMetadata::GetCatalogName() const {
return metadata_map_->Get(kCatalogName);
Expand Down
38 changes: 38 additions & 0 deletions cpp/src/arrow/flight/sql/odbc/ArrowFlightSqlOdbcConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 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::
#
# ArrowFlightSqlOdbc_FOUND - true if Arrow Flight SQL ODBC found on the system
#
# This config sets the following targets in your project::
#
# ArrowFlightSqlOdbc::arrow_flight_sql_odbc_shared - for linked as shared library if shared library is built
# ArrowFlightSqlOdbc::arrow_flight_sql_odbc_static - for linked as static library if static library is built

@PACKAGE_INIT@

include(CMakeFindDependencyMacro)
find_dependency(ArrowFlightSql)

include("${CMAKE_CURRENT_LIST_DIR}/ArrowFlightSqlOdbcTargets.cmake")

arrow_keep_backward_compatibility(ArrowFlightSqlOdbc arrow_flight_sql_odbc)

check_required_components(ArrowFlightSqlOdbc)

arrow_show_details(ArrowFlightSqlOdbc ARROW_FLIGHT_SQL_ODBC)
Loading
Loading