Skip to content

GH-31521: [C++][Flight] Migrate Flight SQL client to Result - #36559

Merged
lidavidm merged 3 commits into
apache:mainfrom
danepitkin:danepitkin/flight-sql-gfi
Jul 8, 2023
Merged

lidavidm merged 3 commits into
apache:mainfrom
danepitkin:danepitkin/flight-sql-gfi

Conversation

@danepitkin

@danepitkin danepitkin commented Jul 7, 2023 •

Copy link
Copy Markdown
Member

Rationale for this change

Arrow introduced a Result return object that can be used in place of passing output parameters. Most of Flight has already been migrated.

Are these changes tested?

C++ tests pass, which involve the sqlite and acero example servers. Any other testing we would like to see?

100% tests passed, 0 tests failed out of 84

Label Time Summary:
arrow-tests         = 168.18 sec*proc (35 tests)
arrow_acero         = 106.32 sec*proc (12 tests)
arrow_compute       =  76.46 sec*proc (13 tests)
arrow_dataset       =  78.09 sec*proc (12 tests)
arrow_flight        = 123.81 sec*proc (2 tests)
arrow_flight_sql    =  19.29 sec*proc (1 test)
filesystem          =  10.39 sec*proc (2 tests)
parquet-tests       =  55.24 sec*proc (9 tests)
unittest            = 627.40 sec*proc (84 tests)

Total Test time (real) = 120.83 sec

Are there any user-facing changes?

Yes. The protected methods DoPut, DoGet, and DoAction for the SQL client have been updated. DoGet already exposed a public API and that has been updated to be virtual.

@danepitkin
danepitkin requested a review from lidavidm as a code owner July 7, 2023 16:03
@github-actions

github-actions Bot commented Jul 7, 2023

Copy link
Copy Markdown

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

@danepitkin
danepitkin force-pushed the danepitkin/flight-sql-gfi branch from eb57e88 to 5d62d76 Compare July 7, 2023 16:13
@danepitkin

Copy link
Copy Markdown
Member Author

I picked this up because the parent task was labeled as a good first issue!

@danepitkin

Copy link
Copy Markdown
Member Author

Ah I still need to test (and update) language bindings. I think Python definitely needs updating at the very least.

@danepitkin

Copy link
Copy Markdown
Member Author

@github-actions autotune

@lidavidm

lidavidm commented Jul 7, 2023

Copy link
Copy Markdown
Member

There are no Python Flight SQL bindings, fwiw

@danepitkin

Copy link
Copy Markdown
Member Author

There are no Python Flight SQL bindings, fwiw

Oh, that's easy! I just built and ran the pyarrow flight tests w/o any issue.

@lidavidm

lidavidm commented Jul 7, 2023

Copy link
Copy Markdown
Member

The code needs to be clang-formatted

(FWIW, I don't think autotune actually works. Maybe for R only.)

@danepitkin

Copy link
Copy Markdown
Member Author

Will update now! Looking at the github history, you're right that autotune doesn't seem to kick off a CI job.

Dane Pitkin added 2 commits July 7, 2023 15:20

@Rhonda85 Rhonda85 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Go for it

@lidavidm
lidavidm merged commit 33ddff3 into apache:main Jul 8, 2023
@conbench-apache-arrow

Copy link
Copy Markdown

Conbench analyzed the 6 benchmark runs on commit 33ddff37.

There were 10 benchmark results indicating a performance regression:

The full Conbench report has more details.

@@ -364,25 +364,15 @@ class ARROW_FLIGHT_SQL_EXPORT FlightSqlClient {
Status Close();

protected:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@lidavidm would it be a problem to make these method public? It would solve a problem I'm having and it would enable people to also be able to extend`` the FlightSqlClient by composition and not just inheritance.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These are here basically only for testing, so that GMock can mock them out for something else. What is the problem?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I want to create a wrapper/helper that can't live in the header (as private method) but it needs to call DoPut and DoGet.

Additionally: given that these are just for testing and FlightClient is injectable I think a level of indirection can be removed by mocking the FlightClient instead of the FlightSqlClient.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In C++ that requires declaring everything as virtual, though, and FlightClient wasn't really meant as an interface. (Perhaps that could be changed.)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

and FlightClient wasn't really meant as an interface

Oh, right. I will figure something. At the moment it's very confusing that some of the wrapper methods are virtual while others aren't.

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.

[C++][FlightRPC] Migrate SQL Client API to Result<>

4 participants