You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "justing-bq (via GitHub)" <gi...@apache.org> on 2025/10/06 18:07:48 UTC
[PR] Refactor ODBC namespaces and file structure [arrow]
justing-bq opened a new pull request, #47703:
URL: https://github.com/apache/arrow/pull/47703
### Rationale for this change
Addresses https://github.com/apache/arrow/issues/46465.
### What changes are included in this PR?
Multiple `utils` files have been merged into a single `util.cc/h`.
The project/subdirectory `flight_sql` has been renamed to `odbc_impl`.
The project/subdirectory `odbcabstraction` is removed and its files have been moved to `odbc_impl`.
Header files inside `include` directories have been relocated to the same directory as their implementation files.
### Are these changes tested?
N/A
### Are there any user-facing changes?
No
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-46465: [C++][FlightRPC] Refactor ODBC namespaces and file structure [arrow]
Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on code in PR #47703:
URL: https://github.com/apache/arrow/pull/47703#discussion_r2409191555
##########
cpp/src/arrow/flight/sql/odbc/odbc_impl/accessors/main.h:
##########
Review Comment:
What is this file actually used for? I don't see it included anywhere
##########
cpp/src/arrow/flight/sql/odbc/odbc_impl/ui/dsn_configuration_window.cc:
##########
@@ -15,26 +15,28 @@
// specific language governing permissions and limitations
// under the License.
-#include "arrow/flight/sql/odbc/flight_sql/include/flight_sql/ui/dsn_configuration_window.h"
-#include "arrow/flight/sql/odbc/flight_sql/flight_sql_connection.h"
+#include "arrow/flight/sql/odbc/odbc_impl/ui/dsn_configuration_window.h"
+
+#include "arrow/flight/sql/odbc/odbc_impl/flight_sql_connection.h"
+#include "arrow/flight/sql/odbc/odbc_impl/util.h"
#include <Shlwapi.h>
#include <Windowsx.h>
-#include <arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/utils.h>
#include <commctrl.h>
#include <commdlg.h>
#include <sql.h>
#include <sstream>
-#include "arrow/flight/sql/odbc/flight_sql/include/flight_sql/ui/add_property_window.h"
+#include "arrow/flight/sql/odbc/odbc_impl/ui/add_property_window.h"
#define COMMON_TAB 0
#define ADVANCED_TAB 1
namespace {
-std::string TestConnection(const driver::flight_sql::config::Configuration& config) {
- std::unique_ptr<driver::flight_sql::FlightSqlConnection> flight_sql_conn(
- new driver::flight_sql::FlightSqlConnection(driver::odbcabstraction::V_3));
+std::string TestConnection(
+ const arrow::flight::sql::odbc::config::Configuration& config) {
+ std::unique_ptr<arrow::flight::sql::odbc::FlightSqlConnection> flight_sql_conn(
+ new arrow::flight::sql::odbc::FlightSqlConnection(arrow::flight::sql::odbc::V_3));
Review Comment:
Same here; just nest the anonymous namespace under the arrow one and then you can avoid these long names
##########
cpp/src/arrow/flight/sql/odbc/odbc_impl/accessors/date_array_accessor.cc:
##########
@@ -33,25 +35,19 @@ int64_t convertDate(typename T::value_type value) {
/// \return the converted value in seconds.
template <>
int64_t convertDate<Date64Array>(int64_t value) {
- return value / driver::odbcabstraction::MILLI_TO_SECONDS_DIVISOR;
+ return value / arrow::flight::sql::odbc::MILLI_TO_SECONDS_DIVISOR;
Review Comment:
You could nest the anonymous namespace under the `arrow::flight::sql::odbc` one and avoid the namespacing here. (Also, it should be `ConvertDate`.)
##########
cpp/src/arrow/flight/sql/odbc/odbc_impl/accessors/binary_array_accessor_test.cc:
##########
@@ -15,35 +15,32 @@
// specific language governing permissions and limitations
// under the License.
-#include "arrow/flight/sql/odbc/flight_sql/accessors/binary_array_accessor.h"
+#include "arrow/flight/sql/odbc/odbc_impl/accessors/binary_array_accessor.h"
#include "arrow/testing/builder.h"
#include "arrow/testing/gtest_util.h"
#include "gtest/gtest.h"
-namespace driver {
-namespace flight_sql {
-
-using arrow::BinaryType;
-using odbcabstraction::OdbcVersion;
+namespace arrow::flight::sql::odbc {
using arrow::ArrayFromVector;
+using arrow::BinaryType;
Review Comment:
These `using` statements should be unnecessary now that you're under an `arrow::` namespace.
##########
cpp/src/arrow/flight/sql/odbc/odbc_impl/accessors/binary_array_accessor_test.cc:
##########
@@ -15,35 +15,32 @@
// specific language governing permissions and limitations
// under the License.
-#include "arrow/flight/sql/odbc/flight_sql/accessors/binary_array_accessor.h"
+#include "arrow/flight/sql/odbc/odbc_impl/accessors/binary_array_accessor.h"
#include "arrow/testing/builder.h"
#include "arrow/testing/gtest_util.h"
#include "gtest/gtest.h"
-namespace driver {
-namespace flight_sql {
-
-using arrow::BinaryType;
-using odbcabstraction::OdbcVersion;
+namespace arrow::flight::sql::odbc {
using arrow::ArrayFromVector;
+using arrow::BinaryType;
Review Comment:
(This appears to apply to many of the files in this PR so I won't point it out every time.)
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-46465: [C++][FlightRPC] Refactor ODBC namespaces and file structure [arrow]
Posted by "conbench-apache-arrow[bot] (via GitHub)" <gi...@apache.org>.
conbench-apache-arrow[bot] commented on PR #47703:
URL: https://github.com/apache/arrow/pull/47703#issuecomment-3384108656
After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit ac9d7216b7e2f321ba779a074e44ed9057961519.
There were no benchmark performance regressions. 🎉
The [full Conbench report](https://github.com/apache/arrow/runs/52318514958) has more details.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-46465: [C++][FlightRPC] Refactor ODBC namespaces and file structure [arrow]
Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm merged PR #47703:
URL: https://github.com/apache/arrow/pull/47703
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-46465: [C++][FlightRPC] Refactor ODBC namespaces and file structure [arrow]
Posted by "justing-bq (via GitHub)" <gi...@apache.org>.
justing-bq commented on code in PR #47703:
URL: https://github.com/apache/arrow/pull/47703#discussion_r2412046301
##########
cpp/src/arrow/flight/sql/odbc/odbc_impl/accessors/binary_array_accessor_test.cc:
##########
@@ -15,35 +15,32 @@
// specific language governing permissions and limitations
// under the License.
-#include "arrow/flight/sql/odbc/flight_sql/accessors/binary_array_accessor.h"
+#include "arrow/flight/sql/odbc/odbc_impl/accessors/binary_array_accessor.h"
#include "arrow/testing/builder.h"
#include "arrow/testing/gtest_util.h"
#include "gtest/gtest.h"
-namespace driver {
-namespace flight_sql {
-
-using arrow::BinaryType;
-using odbcabstraction::OdbcVersion;
+namespace arrow::flight::sql::odbc {
using arrow::ArrayFromVector;
+using arrow::BinaryType;
Review Comment:
Addressed.
##########
cpp/src/arrow/flight/sql/odbc/odbc_impl/accessors/date_array_accessor.cc:
##########
@@ -33,25 +35,19 @@ int64_t convertDate(typename T::value_type value) {
/// \return the converted value in seconds.
template <>
int64_t convertDate<Date64Array>(int64_t value) {
- return value / driver::odbcabstraction::MILLI_TO_SECONDS_DIVISOR;
+ return value / arrow::flight::sql::odbc::MILLI_TO_SECONDS_DIVISOR;
Review Comment:
Done.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-46465: [C++][FlightRPC] Refactor ODBC namespaces and file structure [arrow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #47703:
URL: https://github.com/apache/arrow/pull/47703#issuecomment-3383502041
:warning: GitHub issue #46465 **has been automatically assigned in GitHub** to PR creator.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-46465: [C++][FlightRPC] Refactor ODBC namespaces and file structure [arrow]
Posted by "justing-bq (via GitHub)" <gi...@apache.org>.
justing-bq commented on code in PR #47703:
URL: https://github.com/apache/arrow/pull/47703#discussion_r2407857401
##########
cpp/src/arrow/flight/sql/odbc/odbcabstraction/odbc_impl/odbc_descriptor.cc:
##########
@@ -479,8 +479,6 @@ void ODBCDescriptor::PopulateFromResultSetMetadata(ResultSetMetadata* rsmd) {
for (size_t i = 0; i < records_.size(); ++i) {
size_t one_based_index = i + 1;
- int16_t concise_type = rsmd->GetConciseType(one_based_index);
Review Comment:
Here we are undoing a mistake from a previous PR. This logic for handling concise type should be handled by a future PR.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-46465: [C++][FlightRPC] Refactor ODBC namespaces and file structure [arrow]
Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on PR #47703:
URL: https://github.com/apache/arrow/pull/47703#issuecomment-3380117955
@justing-bq can you rebase again?
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-46465: [C++][FlightRPC] Refactor ODBC namespaces and file structure [arrow]
Posted by "justing-bq (via GitHub)" <gi...@apache.org>.
justing-bq commented on code in PR #47703:
URL: https://github.com/apache/arrow/pull/47703#discussion_r2415215072
##########
cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_statement_get_columns.cc:
##########
@@ -15,18 +15,19 @@
// specific language governing permissions and limitations
// under the License.
-#include "arrow/flight/sql/odbc/flight_sql/flight_sql_statement_get_columns.h"
+#include "arrow/flight/sql/odbc/odbc_impl/flight_sql_statement_get_columns.h"
+
#include "arrow/flight/sql/column_metadata.h"
-#include "arrow/flight/sql/odbc/flight_sql/flight_sql_connection.h"
-#include "arrow/flight/sql/odbc/flight_sql/flight_sql_get_tables_reader.h"
-#include "arrow/flight/sql/odbc/flight_sql/utils.h"
-#include "arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/platform.h"
+#include "arrow/flight/sql/odbc/odbc_impl/flight_sql_connection.h"
+#include "arrow/flight/sql/odbc/odbc_impl/flight_sql_get_tables_reader.h"
+#include "arrow/flight/sql/odbc/odbc_impl/platform.h"
+#include "arrow/flight/sql/odbc/odbc_impl/util.h"
+
+namespace arrow::flight::sql::odbc {
-namespace driver {
-namespace flight_sql {
+using arrow::Result;
+using util::AppendToBuilder;
-using arrow::Schema;
-using arrow::flight::sql::ColumnMetadata;
using std::make_optional;
Review Comment:
https://github.com/apache/arrow/issues/47761
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-46465: [C++][FlightRPC] Refactor ODBC namespaces and file structure [arrow]
Posted by "justing-bq (via GitHub)" <gi...@apache.org>.
justing-bq commented on code in PR #47703:
URL: https://github.com/apache/arrow/pull/47703#discussion_r2412046932
##########
cpp/src/arrow/flight/sql/odbc/odbc_impl/accessors/main.h:
##########
Review Comment:
Removed this file.
##########
cpp/src/arrow/flight/sql/odbc/odbc_impl/ui/dsn_configuration_window.cc:
##########
@@ -15,26 +15,28 @@
// specific language governing permissions and limitations
// under the License.
-#include "arrow/flight/sql/odbc/flight_sql/include/flight_sql/ui/dsn_configuration_window.h"
-#include "arrow/flight/sql/odbc/flight_sql/flight_sql_connection.h"
+#include "arrow/flight/sql/odbc/odbc_impl/ui/dsn_configuration_window.h"
+
+#include "arrow/flight/sql/odbc/odbc_impl/flight_sql_connection.h"
+#include "arrow/flight/sql/odbc/odbc_impl/util.h"
#include <Shlwapi.h>
#include <Windowsx.h>
-#include <arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/utils.h>
#include <commctrl.h>
#include <commdlg.h>
#include <sql.h>
#include <sstream>
-#include "arrow/flight/sql/odbc/flight_sql/include/flight_sql/ui/add_property_window.h"
+#include "arrow/flight/sql/odbc/odbc_impl/ui/add_property_window.h"
#define COMMON_TAB 0
#define ADVANCED_TAB 1
namespace {
-std::string TestConnection(const driver::flight_sql::config::Configuration& config) {
- std::unique_ptr<driver::flight_sql::FlightSqlConnection> flight_sql_conn(
- new driver::flight_sql::FlightSqlConnection(driver::odbcabstraction::V_3));
+std::string TestConnection(
+ const arrow::flight::sql::odbc::config::Configuration& config) {
+ std::unique_ptr<arrow::flight::sql::odbc::FlightSqlConnection> flight_sql_conn(
+ new arrow::flight::sql::odbc::FlightSqlConnection(arrow::flight::sql::odbc::V_3));
Review Comment:
Done.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Refactor ODBC namespaces and file structure [arrow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #47703:
URL: https://github.com/apache/arrow/pull/47703#issuecomment-3373164111
<!--
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.
-->
Thanks for opening a pull request!
If this is not a [minor PR](https://github.com/apache/arrow/blob/main/CONTRIBUTING.md#Minor-Fixes). Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose
Opening GitHub issues ahead of time contributes to the [Openness](http://theapacheway.com/open/#:~:text=Openness%20allows%20new%20users%20the,must%20happen%20in%20the%20open.) of the Apache Arrow project.
Then could you also rename the pull request title in the following format?
GH-${GITHUB_ISSUE_ID}: [${COMPONENT}] ${SUMMARY}
or
MINOR: [${COMPONENT}] ${SUMMARY}
See also:
* [Other pull requests](https://github.com/apache/arrow/pulls/)
* [Contribution Guidelines - Contributing Overview](https://arrow.apache.org/docs/developers/overview.html)
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-46465: [C++][FlightRPC] Refactor ODBC namespaces and file structure [arrow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #47703:
URL: https://github.com/apache/arrow/pull/47703#issuecomment-3373177055
:warning: GitHub issue #46465 **has been automatically assigned in GitHub** to PR creator.
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] GH-46465: [C++][FlightRPC] Refactor ODBC namespaces and file structure [arrow]
Posted by "lidavidm (via GitHub)" <gi...@apache.org>.
lidavidm commented on code in PR #47703:
URL: https://github.com/apache/arrow/pull/47703#discussion_r2415196813
##########
cpp/src/arrow/flight/sql/odbc/odbc_impl/flight_sql_statement_get_columns.cc:
##########
@@ -15,18 +15,19 @@
// specific language governing permissions and limitations
// under the License.
-#include "arrow/flight/sql/odbc/flight_sql/flight_sql_statement_get_columns.h"
+#include "arrow/flight/sql/odbc/odbc_impl/flight_sql_statement_get_columns.h"
+
#include "arrow/flight/sql/column_metadata.h"
-#include "arrow/flight/sql/odbc/flight_sql/flight_sql_connection.h"
-#include "arrow/flight/sql/odbc/flight_sql/flight_sql_get_tables_reader.h"
-#include "arrow/flight/sql/odbc/flight_sql/utils.h"
-#include "arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/platform.h"
+#include "arrow/flight/sql/odbc/odbc_impl/flight_sql_connection.h"
+#include "arrow/flight/sql/odbc/odbc_impl/flight_sql_get_tables_reader.h"
+#include "arrow/flight/sql/odbc/odbc_impl/platform.h"
+#include "arrow/flight/sql/odbc/odbc_impl/util.h"
+
+namespace arrow::flight::sql::odbc {
-namespace driver {
-namespace flight_sql {
+using arrow::Result;
+using util::AppendToBuilder;
-using arrow::Schema;
-using arrow::flight::sql::ColumnMetadata;
using std::make_optional;
Review Comment:
Do you mind filing an issue to get rid of `using std::` (unless there's a good justification)?
--
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: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org