alinaliBQ commented on code in PR #40939:
URL: https://github.com/apache/arrow/pull/40939#discussion_r2085110126


##########
cpp/vcpkg.json:
##########
@@ -49,6 +54,7 @@
     "rapidjson",
     "re2",
     "snappy",
+    "spdlog",
     "sqlite3",

Review Comment:
   please review the `cpp/vcpkg.json` changes 



##########
cpp/vcpkg.json:
##########
@@ -16,11 +16,16 @@
     },
     "benchmark",
     "boost-cmake",
+    "boost-beast",
     "boost-crc",
     "boost-filesystem",
+    "boost-locale",
     "boost-multiprecision",
+    "boost-optional",
     "boost-process",
     "boost-system",
+    "boost-variant",
+    "boost-xpressive",
     "brotli",

Review Comment:
   please review the `cpp/vcpkg.json` changes



##########
dev/release/rat_exclude_files.txt:
##########
@@ -18,6 +18,8 @@ cpp/src/arrow/util/random.h
 cpp/src/arrow/status.cc
 cpp/src/arrow/status.h
 cpp/src/arrow/vendored/*
+cpp/src/arrow/flight/sql/odbc/odbcabstraction/whereami.cc
+cpp/src/arrow/flight/sql/odbc/odbcabstraction/whereami.h
 cpp/build-support/asan_symbolize.py

Review Comment:
   Question for community:
   1. Is it ok for `whereami.h` and `whereami.cc` to be added to rat exclusion? 
The `whereami` library itself is MIT-licensed.  
   2. Do file `whereami.h` and `whereami.cc` need to be moved to 
`cpp/src/arrow/vendored/*`?



##########
cpp/submodules/parquet-testing:
##########


Review Comment:
   let me fix this



##########
cpp/src/arrow/flight/sql/odbc/flight_sql/flight_sql_connection.cc:
##########
@@ -0,0 +1,464 @@
+// 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.
+
+#include "arrow/flight/sql/odbc/flight_sql/flight_sql_connection.h"
+
+#include 
"arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/platform.h"
+#include 
"arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/utils.h"
+
+#include "arrow/flight/client_cookie_middleware.h"
+#include "arrow/flight/sql/odbc/flight_sql/address_info.h"
+#include "arrow/flight/sql/odbc/flight_sql/flight_sql_auth_method.h"
+#include "arrow/flight/sql/odbc/flight_sql/flight_sql_ssl_config.h"
+#include "arrow/flight/sql/odbc/flight_sql/flight_sql_statement.h"
+#include "arrow/flight/sql/odbc/flight_sql/utils.h"
+#include "arrow/flight/types.h"
+
+#include <boost/algorithm/string.hpp>
+#include <boost/algorithm/string/join.hpp>
+#include <boost/asio/ip/address.hpp>
+#include <boost/lexical_cast.hpp>
+#include <boost/optional.hpp>
+#include 
"arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/exceptions.h"
+
+#include <sql.h>
+#include <sqlext.h>
+
+#include "arrow/flight/sql/odbc/flight_sql/system_trust_store.h"
+
+#ifndef NI_MAXHOST
+#  define NI_MAXHOST 1025
+#endif
+
+namespace driver {
+namespace flight_sql {
+
+using arrow::Result;
+using arrow::Status;
+using arrow::flight::FlightCallOptions;
+using arrow::flight::FlightClient;
+using arrow::flight::FlightClientOptions;
+using arrow::flight::Location;
+using arrow::flight::TimeoutDuration;
+using arrow::flight::sql::FlightSqlClient;
+using driver::odbcabstraction::AsBool;
+using driver::odbcabstraction::CommunicationException;
+using driver::odbcabstraction::Connection;
+using driver::odbcabstraction::DriverException;
+using driver::odbcabstraction::OdbcVersion;
+using driver::odbcabstraction::Statement;
+
+// clang-format off
+const std::string FlightSqlConnection::DSN = "dsn";            // 
NOLINT(runtime/string)
+const std::string FlightSqlConnection::DRIVER = "driver";      // 
NOLINT(runtime/string)
+const std::string FlightSqlConnection::HOST = "host";          // 
NOLINT(runtime/string)
+const std::string FlightSqlConnection::PORT = "port";          // 
NOLINT(runtime/string)
+const std::string FlightSqlConnection::USER = "user";          // 
NOLINT(runtime/string)
+const std::string FlightSqlConnection::USER_ID = "user id";    // 
NOLINT(runtime/string)
+const std::string FlightSqlConnection::UID = "uid";            // 
NOLINT(runtime/string)
+const std::string FlightSqlConnection::PASSWORD = "password";  // 
NOLINT(runtime/string)
+const std::string FlightSqlConnection::PWD = "pwd";            // 
NOLINT(runtime/string)
+const std::string FlightSqlConnection::TOKEN = "token";        // 
NOLINT(runtime/string)
+const std::string FlightSqlConnection::USE_ENCRYPTION =        // 
NOLINT(runtime/string)
+    "useEncryption";
+const std::string FlightSqlConnection::DISABLE_CERTIFICATE_VERIFICATION = // 
NOLINT
+    "disableCertificateVerification";
+const std::string FlightSqlConnection::TRUSTED_CERTS =         // 
NOLINT(runtime/string)
+    "trustedCerts";
+const std::string FlightSqlConnection::USE_SYSTEM_TRUST_STORE = // 
NOLINT(runtime/string)
+    "useSystemTrustStore";
+const std::string FlightSqlConnection::STRING_COLUMN_LENGTH =  // 
NOLINT(runtime/string)
+    "StringColumnLength";
+const std::string FlightSqlConnection::USE_WIDE_CHAR =         // 
NOLINT(runtime/string)
+    "UseWideChar";
+const std::string FlightSqlConnection::CHUNK_BUFFER_CAPACITY = // 
NOLINT(runtime/string)
+    "ChunkBufferCapacity";
+// clang-format on
+

Review Comment:
   Question to community:
   Using `std::string` is more suitable in the code base. Is our usage of 
`NOLINT` ok here? 



##########
cpp/src/arrow/flight/sql/odbc/CMakeLists.txt:
##########
@@ -0,0 +1,32 @@
+# 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.
+
+cmake_minimum_required(VERSION 3.16)
+set(CMAKE_CXX_STANDARD 17)
+
+add_custom_target(arrow_flight_sql_odbc)
+
+if(CMAKE_BUILD_TYPE STREQUAL "Release")
+  add_compile_definitions(NDEBUG)
+endif()
+
+# Add Boost dependencies. Should be pre-installed (Brew on Mac).
+find_package(Boost REQUIRED)

Review Comment:
   Good question, the `flightsql-odbc` uses Boost algorithm and Boost copy as 
well, so would keep the Boost dependency 



##########
cpp/CMakePresets.json:
##########
@@ -122,6 +122,14 @@
         "ARROW_FLIGHT_SQL": "ON"
       }
     },
+    {
+      "name": "features-flight-sql-odbc",
+      "inherits": "features-flight-sql",
+      "hidden": true,
+      "cacheVariables": {
+        "ARROW_FLIGHT_SQL_ODBC": "ON"
+      }
+    },

Review Comment:
   Hi Kou, I'll look into your comments, thanks



##########
cpp/src/arrow/flight/sql/odbc/flight_sql/CMakeLists.txt:
##########
@@ -0,0 +1,176 @@
+# 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.
+
+cmake_minimum_required(VERSION 3.16)
+set(CMAKE_CXX_STANDARD 17)
+
+set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+
+include_directories(include include/flight_sql
+                    ${CMAKE_SOURCE_DIR}/odbcabstraction/include)
+
+if(DEFINED CMAKE_TOOLCHAIN_FILE)
+  include(${CMAKE_TOOLCHAIN_FILE})
+endif()
+
+find_package(RapidJSON CONFIG REQUIRED)
+
+if(MSVC)
+  # the following definitions stop arrow from using __declspec when statically
+  # linking and will break on Windows without them
+  add_compile_definitions(ARROW_STATIC ARROW_FLIGHT_STATIC)
+endif()
+
+enable_testing()
+
+add_library(arrow_odbc_spi_impl

Review Comment:
   We have an upcoming 
[PR#46099](https://github.com/apache/arrow/pull/46099/files#diff-ae8971934312f51437b00f3c4aa376bbf54aa0ce25a14abe1f74f3be7cd84486)
 that uses `add_arrow_lib(arrow_flight_sql_odbc)` to add an arrow library at 
the `odbc` directory. The `flight_sql` and `odbcabstraction` directories are 
subfolders to `arrow_flight_sql_odbc`, so I suggest we keep `add_library` for 
these 2 subfolders. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to