Skip to content

Conversation

@alinaliBQ
Copy link
Contributor

@alinaliBQ alinaliBQ commented Nov 3, 2025

Rationale for this change

Enable query execution in ODBC.

What changes are included in this PR?

  • Extract SQLExecDirect, SQLExecute, SQLPrepare implementation & tests

Are these changes tested?

  • Tested on local MSVC

Are there any user-facing changes?

N/A

@github-actions
Copy link

github-actions bot commented Nov 3, 2025

⚠️ GitHub issue #47711 has been automatically assigned in GitHub to PR creator.

Comment on lines +813 to +1016
statement->Prepare(query);
statement->ExecutePrepared();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we implemented SQLExecDirect to use prepare/execute to use prepared statements to align with the behavior with JDBC

@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Nov 3, 2025
@alinaliBQ alinaliBQ force-pushed the gh-47711-query-execution branch from 72e8db0 to 97c94b0 Compare November 3, 2025 20:42
ASSERT_EQ(SQL_SUCCESS,
SQLExecDirect(this->stmt, &sql0[0], static_cast<SQLINTEGER>(sql0.size())));

// GH-47713 TODO: Uncomment call to SQLFetch SQLGetData after implementation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we weren't expecting these tests to pass yet? Are there build issues with this not commented out?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When this PR is just created as draft, we aren't expecting them to pass. But once the pre-requisite ODBC API PRs get merged in main, I am expecting this PR to pass the CI tests after a rebase. And some calls to unimplemented API (SQLFetch and SQLGetData) are commented out because they will be enabled in a different PR

@alinaliBQ alinaliBQ changed the title GH-47711: [C++][FlightRPC] WIP: Enable ODBC query execution GH-47711: [C++][FlightRPC] Enable ODBC query execution Nov 10, 2025
return boost::make_optional(it != attribute_.end(), it->second);
}

boost::optional<std::shared_ptr<ResultSetMetadata>> FlightSqlStatement::Prepare(
Copy link
Contributor Author

@alinaliBQ alinaliBQ Nov 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working on removing boost as part of #48067

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub issue for removing boost::optional: #48084

@alinaliBQ
Copy link
Contributor Author

@lidavidm this draft PR is ready for review! Please have a look

@alinaliBQ alinaliBQ force-pushed the gh-47711-query-execution branch from 97c94b0 to 8625cfa Compare November 15, 2025 00:06
@alinaliBQ alinaliBQ force-pushed the gh-47711-query-execution branch from 8625cfa to 96c85a3 Compare November 29, 2025 00:24
@alinaliBQ
Copy link
Contributor Author

PR is rebased and ready for review

@alinaliBQ alinaliBQ marked this pull request as ready for review November 29, 2025 00:25
@alinaliBQ alinaliBQ requested a review from lidavidm as a code owner November 29, 2025 00:25
@lidavidm
Copy link
Member

It appears it needs to be rebased again

@alinaliBQ alinaliBQ force-pushed the gh-47711-query-execution branch from 96c85a3 to 74544d8 Compare December 1, 2025 19:27
@alinaliBQ
Copy link
Contributor Author

@lidavidm Yup, that might be a trend for these ODBC API PRs 😂 . I have rebased the PR and tested locally on MSVC

@alinaliBQ alinaliBQ force-pushed the gh-47711-query-execution branch from 74544d8 to 22d48eb Compare December 3, 2025 19:17
@lidavidm lidavidm merged commit b2e8f25 into apache:main Dec 4, 2025
45 checks passed
@lidavidm lidavidm removed the awaiting committer review Awaiting committer review label Dec 4, 2025
@github-actions github-actions bot added the awaiting merge Awaiting merge label Dec 4, 2025
@conbench-apache-arrow
Copy link

After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit b2e8f25.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants