-
Notifications
You must be signed in to change notification settings - Fork 3.9k
GH-47516: [C++][FlightRPC] Initial ODBC driver framework #47517
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
Conversation
|
|
| add_custom_target(arrow_flight_sql_odbc) | ||
|
|
||
| # Ensure fmt is loaded as header only | ||
| add_compile_definitions(FMT_HEADER_ONLY) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you use target_compile_definitions() because add_compile_definitions()'s scope is directory? We should not use directory scope commands such as add_compile_definitions() and include_directories() for newly written code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I changed to use target_compile_definitions
| include(FetchContent) | ||
| fetchcontent_declare(spdlog | ||
| URL https://github.com/gabime/spdlog/archive/refs/tags/v1.15.3.zip | ||
| CONFIGURE_COMMAND | ||
| "" | ||
| BUILD_COMMAND | ||
| "") | ||
| fetchcontent_makeavailable(spdlog) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use arrow/util/logging.h instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Let me look into this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| SQLRETURN SQL_API SQLAllocHandle(SQLSMALLINT type, SQLHANDLE parent, SQLHANDLE* result) { | ||
| return SQL_INVALID_HANDLE; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need both of the top-level SQLAllocHandle() and arrow::SQLAllocHandle()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. In upcoming PRs, we plan to change it to look like:
SQLRETURN SQL_API SQLAllocHandle(SQLSMALLINT type, SQLHANDLE parent, SQLHANDLE* result) {
return arrow::flight::sql::odbc::SQLAllocHandle(...);
}
I have separate the actual implementation of SQLAllocHandle to make this PR smaller
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked all comments. Let me look into replacing spdlogs with arrow/util/logging.h
| add_custom_target(arrow_flight_sql_odbc) | ||
|
|
||
| # Ensure fmt is loaded as header only | ||
| add_compile_definitions(FMT_HEADER_ONLY) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I changed to use target_compile_definitions
| include(FetchContent) | ||
| fetchcontent_declare(spdlog | ||
| URL https://github.com/gabime/spdlog/archive/refs/tags/v1.15.3.zip | ||
| CONFIGURE_COMMAND | ||
| "" | ||
| BUILD_COMMAND | ||
| "") | ||
| fetchcontent_makeavailable(spdlog) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Let me look into this
| SQLRETURN SQL_API SQLAllocHandle(SQLSMALLINT type, SQLHANDLE parent, SQLHANDLE* result) { | ||
| return SQL_INVALID_HANDLE; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. In upcoming PRs, we plan to change it to look like:
SQLRETURN SQL_API SQLAllocHandle(SQLSMALLINT type, SQLHANDLE parent, SQLHANDLE* result) {
return arrow::flight::sql::odbc::SQLAllocHandle(...);
}
I have separate the actual implementation of SQLAllocHandle to make this PR smaller
f3f3c59 to
587050a
Compare
587050a to
677d1f1
Compare
Create odbc.def Remove SQLAllocHandle definitions In-progress - fix build errors In progress fix Remove unneeded code Fix build issues Continue build fixes Fix build issues Address review comments Follow-up changes Fix Lint issues
677d1f1 to
478dc97
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
| #ifdef _WIN32 | ||
| # include <windows.h> | ||
| #endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use #include "arrow/flight/sql/odbc/odbcabstraction/include/odbcabstraction/platform.h" instead? It seems that platform.h defines some macros before including windows.h.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, that's reasonable to use. I fixed it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed comments from @kou
| #ifdef _WIN32 | ||
| # include <windows.h> | ||
| #endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, that's reasonable to use. I fixed it
|
After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 16ceade. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. |
…e#47517) ### Rationale for this change Add initial framework for building an ODBC driver dll ### What changes are included in this PR? - initial Flight SQL ODBC framework ### Are these changes tested? - Yes, on local Windows environment ### Are there any user-facing changes? - None * PR is extracted from PR apache#46099 * GitHub Issue: apache#47516 Authored-by: Alina (Xi) Li <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
Rationale for this change
Add initial framework for building an ODBC driver dll
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?