amitvijapur opened a new pull request, #11180: URL: https://github.com/apache/arrow-rs/pull/11180
# Which issue does this PR close? Closes #6487. # Rationale for this change The Flight SQL CLI iterates the endpoints of a `FlightInfo` and calls `DoGet` with each ticket on the client it already has, ignoring `FlightEndpoint::location`. The protocol says a ticket with locations is redeemed at one of them, so a server whose `GetFlightInfo` and `DoGet` live on different addresses gets no data from the CLI. # What changes are included in this PR? Only the CLI (`flight_sql_client.rs`) changes. `setup_client` now delegates to `setup_client_for_uri`, which builds a client for any URI with the same headers, token, handshake and compression settings; TLS follows the URI scheme rather than `--tls`, since a location may differ from the main connection. `execute_flight` uses the existing client when an endpoint lists no location, or only the reserved `arrow-flight-reuse-connection://?` or empty-string form that the Flight spec defines as "reuse this connection", and otherwise connects to the first listed location, caching one client per distinct location for the command. A location that cannot be connected to is an error naming the URI rather than a silent fallback, because the ticket may not be redeemable on the original server. The library `FlightClient` / `FlightSqlServiceClient` APIs are unchanged; the issue's point about those being easy to misuse is left open. # Are these changes tested? Two integration tests in `flight_sql_client_cli.rs`: one runs two test servers, where the first answers `GetFlightInfo` with endpoints located at the second and refuses `DoGet` itself, and asserts the CLI prints the same table as `test_simple`; the other advertises the reserved URI, then the empty string, and serves `DoGet` itself. The first fails on `main` with `DoGet is served by another server`. The second passes on `main`, which ignores locations entirely; it guards the new path and fails with `invalid URI` if either reserved form is dialled. The shared CLI invocation moved into a helper. `cargo test -p arrow-flight --features cli,flight-sql,tls-ring` passes. # Are there any user-facing changes? The CLI now follows endpoint locations. Servers that return endpoints without locations behave as before. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
