-
Notifications
You must be signed in to change notification settings - Fork 3.9k
GH-46004: [C++][FlightRPC] Enable ODBC Build In C++ Workflows #47689
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
base: main
Are you sure you want to change the base?
Conversation
#include <arrow/flight/types.h> | ||
#include <boost/variant.hpp> |
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.
boost::variant
is an existing dependency of flightsql-odbc
. Our plan is to replace it with std::variant
in future PRs
.github/workflows/ruby.yml
Outdated
@@ -219,6 +219,7 @@ jobs: | |||
ARROW_DATASET: ON | |||
ARROW_FLIGHT: ON | |||
ARROW_FLIGHT_SQL: ON | |||
ARROW_FLIGHT_SQL_ODBC: ON |
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.
ARROW_FLIGHT_SQL_ODBC: ON
is already on cpp.yml file
c1d79fa
to
bb49757
Compare
bb49757
to
7d0c9ad
Compare
Enable ODBC build in Windows MSVC workflow
f97a86d
to
078841c
Compare
078841c
to
83df835
Compare
ODBC driver registration is required for ODBC tests (enabled in a separate PR)
ec39f37
to
4d254df
Compare
switch (msg) { | ||
case WM_NCCREATE: { | ||
_ASSERT(lparam != NULL); | ||
assert(lparam != NULL); |
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_DCHECK*()
instead?
arrow/cpp/src/arrow/util/logging.h
Lines 90 to 125 in 5750e29
# ifdef NDEBUG | |
# define ARROW_DFATAL ::arrow::util::ArrowLogLevel::ARROW_WARNING | |
// CAUTION: DCHECK_OK() always evaluates its argument, but other DCHECK*() macros | |
// only do so in debug mode. | |
# define ARROW_DCHECK(condition) \ | |
while (false) ARROW_IGNORE_EXPR(condition); \ | |
while (false) ::arrow::util::detail::NullLog() | |
# define ARROW_DCHECK_OK(s) \ | |
ARROW_IGNORE_EXPR(s); \ | |
while (false) ::arrow::util::detail::NullLog() | |
# define ARROW_DCHECK_EQ(val1, val2) \ | |
while (false) ARROW_IGNORE_EXPR(val1); \ | |
while (false) ARROW_IGNORE_EXPR(val2); \ | |
while (false) ::arrow::util::detail::NullLog() | |
# define ARROW_DCHECK_NE(val1, val2) \ | |
while (false) ARROW_IGNORE_EXPR(val1); \ | |
while (false) ARROW_IGNORE_EXPR(val2); \ | |
while (false) ::arrow::util::detail::NullLog() | |
# define ARROW_DCHECK_LE(val1, val2) \ | |
while (false) ARROW_IGNORE_EXPR(val1); \ | |
while (false) ARROW_IGNORE_EXPR(val2); \ | |
while (false) ::arrow::util::detail::NullLog() | |
# define ARROW_DCHECK_LT(val1, val2) \ | |
while (false) ARROW_IGNORE_EXPR(val1); \ | |
while (false) ARROW_IGNORE_EXPR(val2); \ | |
while (false) ::arrow::util::detail::NullLog() | |
# define ARROW_DCHECK_GE(val1, val2) \ | |
while (false) ARROW_IGNORE_EXPR(val1); \ | |
while (false) ARROW_IGNORE_EXPR(val2); \ | |
while (false) ::arrow::util::detail::NullLog() | |
# define ARROW_DCHECK_GT(val1, val2) \ | |
while (false) ARROW_IGNORE_EXPR(val1); \ | |
while (false) ARROW_IGNORE_EXPR(val2); \ | |
while (false) ::arrow::util::detail::NullLog() |
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 have changed to use ARROW_DCHECK
here.
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\Apache Arrow Flight SQL ODBC Driver" /v Setup /t REG_SZ /d %ODBC_AMD64% /f | ||
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI\ODBC Drivers" /v "Apache Arrow Flight SQL ODBC Driver" /t REG_SZ /d "Installed" /f | ||
|
||
IF !ERRORLEVEL! NEQ 0 ( |
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.
IF !ERRORLEVEL! NEQ 0 ( | |
if !ERRORLEVEL! NEQ 0 ( |
BTW, is !ERRORLEVEL!
still non 0 when the first reg add
succeeded and the last reg add
failed?
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.
!ERRORLEVEL!
should be reflecting on the last command executed, so yes !ERRORLEVEL!
should be non zero if last reg add
failed.
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 _amd64
in file name?
It seems that this doesn't have any amd64 specific part.
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.
Yea that's fair, I have renamed to install_odbc
|
||
#pragma once | ||
|
||
#if defined _WIN32 || defined _WIN64 |
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 || defined _WIN64
here?
https://learn.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=msvc-170
_WIN32
Defined as 1 when the compilation target is 32-bit ARM, 64-bit ARM, x86, x64, or ARM64EC. Otherwise, undefined.
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.
I think it can be removed. Fixed
# Compile entry_points.cc before odbc_api.cc due to conflict from sql.h and flight/types.h | ||
set(ARROW_FLIGHT_SQL_ODBC_SRCS odbc_api.cc entry_points.cc) |
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 share build log URL without this?
We may just need to disable unity build like https://github.com/apache/arrow/pull/47627/files#diff-2a4796eff3f25e1b0fd6a0db28bdea1efbc3ec69457705b1069cf70ad5355624R192-R204 does.
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.
Our team discovered the build failure a while ago so I don't have the error log. I have reverted this change. If the build fails because of it then I can send the log here
.github/workflows/cpp.yml
Outdated
- 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 |
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.
cpp\src\arrow\flight\sql\odbc\script\
not ...\install\
may be better.
We will add uninstall scripts later, right?
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 have renamed to script
folder.
I am not sure if uninstall scripts are needed in this scenario and I am open to discussion. This script is for testing only. ODBC users will be able to install and uninstall the ODBC driver using a msi
executable, so they won't need to use the script to install or uninstall the driver. Developers can also manually delete the driver registry if needed. This script can also be run a second time to change the registry to point to a different ODBC dll location, so the driver registry usually doesn't need to be deleted
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.
OK. Then how about using test\
directory?
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.
Or ci\scripts\
?
#include "arrow/flight/sql/odbc/odbc_impl/platform.h" | ||
|
||
#include <sys/types.h> | ||
#include <cstdint> |
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.
was this missing previously?
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, I think so. I recall it was causing build issues on workflows. The build works with or without this header on my local machine (Windows MSVC), but the CI builds can have problems without the header
Rationale for this change
Enable ODBC Build In C++ Workflows to make sure ODBC can build in CI.
What changes are included in this PR?
ARROW_FLIGHT_SQL_ODBC:ON
recognized in C++ build.Are these changes tested?
Tested in CI
Are there any user-facing changes?
No
Extracted from PR #46099