-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
GH-37726: [Swift][FlightSQL] Update behavior to be similar to existing impls #37764
Conversation
Thanks for opening a pull request! If this is not a minor PR. Could you open an issue for this pull request on GitHub? https://github.com/apache/arrow/issues/new/choose Opening GitHub issues ahead of time contributes to the Openness of the Apache Arrow project. Then could you also rename the pull request title in the following format?
or
In the case of PARQUET issues on JIRA the title also supports:
See also: |
|
c988ebb
to
24649c9
Compare
Hi @kou, I apologize for the large review. These changes are for a fix found in the attached issue. I plan to follow up this change with a PR that will fix formatting issues (planning to use swiftlint ) |
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.
How about using the following steps instead of "merging this PR without SwiftLint and applying SwiftLint with a separated PR"?
- PR1: Add a lint CI job
- We can do it in https://github.com/apache/arrow/blob/main/ci/scripts/swift_test.sh
- We can apply SwiftLint in PR1 to fix CI failure
- We don't change any behavior in PR1 (Auto-generated changed by SwiftLint are only included in PR1)
- PR2: Rebase this PR on main after PR1 is merged
- Formatted changes are easier to review
- PR3: Add Swift to our integration test targets:
- Add
tester_swift.py
to https://github.com/apache/arrow/tree/main/dev/archery/archery/integration - Enable the tester in https://github.com/apache/arrow/blob/main/dev/archery/archery/integration/runner.py#L534
- Setup Swift in https://github.com/apache/arrow/blob/main/ci/docker/conda-integration.dockerfile
- Add
BTW, could you add a list of changed behavior in the description of this PR? It seems that no response cases are changed.
@@ -200,4 +201,41 @@ public class ArrowReader { | |||
return .failure(.unknownError("Error loading file: \(error)")) | |||
} | |||
} | |||
|
|||
static public func MakeArrowReaderResult() -> ArrowReaderResult{ |
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.
static public func MakeArrowReaderResult() -> ArrowReaderResult{ | |
static public func MakeArrowReaderResult() -> ArrowReaderResult { |
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.
Will do
|
||
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.
Are this trailing spaces change and other similar changes intentional?
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.
I wasn't too concerned with these style changes as I was going to follow up with a swiftlint PR. Since we are planning on running swiftlint on the code as a prior PR to this one, then these will be resolved (should be) when swiftlint is run against the files.
for rc in recordBatchs { | ||
switch writer.toMessage(rc) { |
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.
rc
-> rb
("R"ecord "B"atch) or rc
-> recordBatch
may be better.
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.
Will do.
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.
@abandy Could you check this?
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.
Good catch, will update, thanks!
descriptor = FlightDescriptor(flightData.flightDescriptor) | ||
switch reader.fromMessage(dataHeader, dataBody: dataBody, result: result) { | ||
case .success(()): | ||
if(result.batches.count > 0 ) { |
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.
if(result.batches.count > 0 ) { | |
if result.batches.count > 0 { |
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.
Will do.
} | ||
|
||
func getFlightInfo(_ request: ArrowFlight.FlightDescriptor) async throws -> ArrowFlight.FlightInfo { | ||
return ArrowFlight.FlightInfo(Data()) | ||
let key = String(decoding: request.cmd, as: UTF8.self) | ||
if(flights[key] != nil) { |
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.
if(flights[key] != nil) { | |
if flights[key] != nil { |
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.
Will do.
XCTAssertEqual(actionResults.count, 1) | ||
XCTAssertEqual(String(bytes:actionResults[0].body, encoding: .utf8), "test_action result") | ||
XCTAssertEqual(actionResults.count, 0) |
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.
It seems that this removes a test case for a DoAction
that returns a result.
Is it intentional?
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.
This was intentional but I will put test case back.
Sounds good, I will give this a go. |
7ab44f0
to
94aa4b0
Compare
@kou please review when you get a chance, thank you! |
4736385
to
211fc12
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.
+1
Oh, it seems that we still want to keep working on this PR. |
@kou I had found that I had missed the requested change to revert the doActionTest and updated accordingly. The PR is now ready. I apologize for any confusion. |
OK. I'll merge this. |
thank you! |
After merging your PR, Conbench analyzed the 6 benchmarking runs that have been run so far on merge-commit f2995b0. There were no benchmark performance regressions. 🎉 The full Conbench report has more details. |
…xisting impls (apache#37764) Swift Flight implementation behavior didn't match existing flight implementations. The updates in this PR have been tested against python/examples/flight/server.py except for getSchemaTest and doExchangeTest which are not implemented in server.py. I will follow up this PR with a cleanup refactoring PR. This difference in behavior was found due to issue apache#37726. * Closes: apache#37726 Authored-by: Alva Bandy <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
…xisting impls (apache#37764) Swift Flight implementation behavior didn't match existing flight implementations. The updates in this PR have been tested against python/examples/flight/server.py except for getSchemaTest and doExchangeTest which are not implemented in server.py. I will follow up this PR with a cleanup refactoring PR. This difference in behavior was found due to issue apache#37726. * Closes: apache#37726 Authored-by: Alva Bandy <[email protected]> Signed-off-by: Sutou Kouhei <[email protected]>
Swift Flight implementation behavior didn't match existing flight implementations. The updates in this PR have been tested against python/examples/flight/server.py except for getSchemaTest and doExchangeTest which are not implemented in server.py. I will follow up this PR with a cleanup refactoring PR.
This difference in behavior was found due to issue #37726.