-
Notifications
You must be signed in to change notification settings - Fork 3.9k
GH-46584: [C++][FlightRPC] Iterate over endpoints in ODBC driver #47991
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
|
|
64e84f5 to
488ff8e
Compare
|
|
||
| namespace arrow::flight::sql::odbc { | ||
|
|
||
| using arrow::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.
Can we avoid putting using in headers?
| void VerifyArraysContainIntsOnly(std::shared_ptr<Array> intArray) { | ||
| for (int64_t i = 0; i < intArray->length(); ++i) { | ||
| // null values are accepted | ||
| if (!intArray->IsNull(i)) { | ||
| auto scalar_data = intArray->GetScalar(i).ValueOrDie(); | ||
| std::string scalar_str = ConvertToJson(*scalar_data); | ||
| ASSERT_TRUE(std::all_of(scalar_str.begin(), scalar_str.end(), ::isdigit)); | ||
| } | ||
| } | ||
| } |
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't you just check the array type?
| std::unique_ptr<FlightClient> temp_flight_client; | ||
| util::ThrowIfNotOK(FlightClient::Connect(endpoint_locations[0], client_options) | ||
| .Value(&temp_flight_client)); | ||
| temp_flight_sql_client.reset(new FlightSqlClient(std::move(temp_flight_client))); |
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.
make_shared?
| return boost::make_optional( | ||
| is_not_ok || is_not_empty, | ||
| std::make_pair(std::move(result), temp_flight_sql_client)); |
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 get rid of boost?
Rationale for this change
GH-46584
What changes are included in this PR?
Iterate over endpoints to get data
Are these changes tested?
Tested in CI and locally on Windows MSVC. Test
flight_sql_stream_chunk_buffer_test.ccis addedAre there any user-facing changes?
N/A