-
Notifications
You must be signed in to change notification settings - Fork 3.9k
GH-46096: [C++][FlightRPC] Environment and Connection Handle Allocation #47759
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
|
|
| SQLHENV env; | ||
|
|
||
| // Allocate an environment handle | ||
| SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &env); |
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 check the return code? (Should we free the result?)
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.
yup, added check and freed the result
| namespace arrow::flight::sql::odbc { | ||
|
|
||
| TEST(SQLAllocHandle, TestSQLAllocHandleEnv) { | ||
| // ODBC Environment |
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.
nit: I don't think these comments add much
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.
remove ODBC environment comment
|
|
||
| TEST(SQLAllocEnv, TestSQLAllocEnv) { | ||
| // ODBC Environment | ||
| SQLHENV env; |
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.
ditto, should we check/free the result?
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.
added calls to free the result
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.
We are working on the comments
Add comment from apache#47759 (comment)
Add comment from apache#47759 (comment)
85b1b11 to
21ba2a1
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.
Addressed all code review comments
| SQLHENV env; | ||
|
|
||
| // Allocate an environment handle | ||
| SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &env); |
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.
yup, added check and freed the result
| namespace arrow::flight::sql::odbc { | ||
|
|
||
| TEST(SQLAllocHandle, TestSQLAllocHandleEnv) { | ||
| // ODBC Environment |
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.
remove ODBC environment comment
|
|
||
| TEST(SQLAllocEnv, TestSQLAllocEnv) { | ||
| // ODBC Environment | ||
| SQLHENV env; |
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.
added calls to free the result
abc38d9 to
6d0570a
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.
Please rebase!
| template <typename T> | ||
| class ConnectionTest : public T { | ||
| public: | ||
| using List = std::list<T>; | ||
| }; |
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.
| template <typename T> | |
| class ConnectionTest : public T { | |
| public: | |
| using List = std::list<T>; | |
| }; | |
| template <typename T> | |
| class ConnectionTest : public T { | |
| }; |
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.
Rebased and removed using List
* Tests will be added in separate PRs Add tests for SQLAllocEnv and SQLAllocConnect * Other test structure code will be in a separate PR Add comment Add comment from apache#47759 (comment) Work on code review comments Add test fixture for file Co-Authored-By: justing-bq <[email protected]> Add comment for `ConnectionRemoteTest` Add comment for `ReleaseConnection`
address comment
6d0570a to
906f413
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.
Addressed comment. I ran the tests locally and they passed. Marking PR as ready for review. Changes in this PR will be tested in CI after #47689 is merged
| template <typename T> | ||
| class ConnectionTest : public T { | ||
| public: | ||
| using List = std::list<T>; | ||
| }; |
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.
Rebased and removed using List
|
After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 62afc09. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. It also includes information about 4 possible false positives for unstable benchmarks that are known to sometimes produce them. |
…location (apache#47759) ### Rationale for this change ODBC driver needs to handle environment handle and connection handle allocation and deallocation. ### What changes are included in this PR? - Implement SQLAllocHandle and SQLFreeHandle APIs for allocating and deallocating environment and connection handles. - Tests ### Are these changes tested? - Tested locally on Windows MSVC. - Will be tested in CI after apache#47689 is merged ### Are there any user-facing changes? No * GitHub Issue: apache#46096 * GitHub Issue: apache#46097 Authored-by: Alina (Xi) Li <[email protected]> Signed-off-by: David Li <[email protected]>
Rationale for this change
ODBC driver needs to handle environment handle and connection handle allocation and deallocation.
What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?
No