Skip to content
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-44363: [C#] Handle Flight data with zero batches #45315

Merged
merged 4 commits into from
Jan 21, 2025

Conversation

adamreeve
Copy link
Contributor

@adamreeve adamreeve commented Jan 21, 2025

Rationale for this change

See #44363. This improves compatibility with other Flight implementations and means user code works with empty data without needing to treat it as a special case to work around this limitation.

What changes are included in this PR?

  • Adds new async overloads of FlightClient.StartPut that immediately send the schema, before any data batches are sent.
  • Updates the test server to send the schema on DoGet even when there are no data batches.
  • Enables the primitive_no_batches test case for C# Flight.

Are these changes tested?

Yes, using a new unit test and with the integration tests.

Are there any user-facing changes?

Yes. New overloads of the FlightClient.StartPut method have been added that are async and accept a Schema parameter, and ensure the schema is sent when no data batches are sent.

@@ -98,11 +98,25 @@ public AsyncUnaryCall<FlightInfo> GetInfo(FlightDescriptor flightDescriptor, Met
flightInfoResult.Dispose);
}

[System.Obsolete("Use an async overload that takes a Schema")]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure about whether these overloads should be obsolete, there might be valid use cases where the schema isn't immediately known? But that isn't supported by the Python or C++ implementations.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a specific reason to discourage its use?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only to better handle when zero batches are sent. I'm on the fence about this so am happy to remove the Obsolete if you think it's too disruptive.

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess I don't have a strong feeling either way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After thinking about this some more I've removed the Obsolete attributes and just added a remark to the new methods about the difference in behaviour, as I'm not sure this is a good enough reason to deprecate the existing methods.

@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Jan 21, 2025
@@ -98,11 +98,25 @@ public AsyncUnaryCall<FlightInfo> GetInfo(FlightDescriptor flightDescriptor, Met
flightInfoResult.Dispose);
}

[System.Obsolete("Use an async overload that takes a Schema")]
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a specific reason to discourage its use?

@CurtHagenlocher CurtHagenlocher merged commit ead8d6f into apache:main Jan 21, 2025
13 checks passed
@CurtHagenlocher CurtHagenlocher removed the awaiting committer review Awaiting committer review label Jan 21, 2025
@github-actions github-actions bot added the awaiting committer review Awaiting committer review label Jan 21, 2025
@adamreeve adamreeve deleted the dotnet-flight-zero-batches branch January 21, 2025 20:22
Copy link

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

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 2 possible false positives for unstable benchmarks that are known to sometimes produce them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants