Skip to content

Conversation

@lidavidm
Copy link
Member

Fixes compatibility with standard Protobuf implementations, which may omit serialization of an empty field. In the case of an empty record batch, this would cause the Java client to fail a precondition check since there would be no body buffer instead of a single empty body buffer.

@github-actions
Copy link

@alamb
Copy link
Contributor

alamb commented Dec 31, 2020

Requesting review from @praveenbingo and @liyafan82 as they seem to have merged the last few Java PRs into the arrow repo.

The background here is that we are working on flight integration tests in Rust (e.g. #9049) and we found an edge case in the flight protobuf integration.

@liyafan82
Copy link
Contributor

Sorry for my late response. Will take a look late today.

Copy link
Contributor

Choose a reason for hiding this comment

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

10939 -> 10962?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch, fixed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Compat -> Compact?

Copy link
Member Author

Choose a reason for hiding this comment

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

Expanded to 'compatibility'

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: do you think we also need a test case for which a schema has an empty body?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup, I added a test for this as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we need to assign the schema to an object and verify that its body is null?

Copy link
Member Author

Choose a reason for hiding this comment

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

The schema itself has no body. I've added a test to check the parsed message.

Copy link
Contributor

Choose a reason for hiding this comment

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

We can extract a common method for the logic of writing the message to a ByteArrayOutputStream?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to check the message body here?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've added assertions here.

Copy link
Contributor

@liyafan82 liyafan82 left a comment

Choose a reason for hiding this comment

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

LGTM. Will merge soon if there are no more comments.

@alamb
Copy link
Contributor

alamb commented Jan 7, 2021

#9049 is still blocked on getting this PR merged. Any chance you can do so @liyafan82 ?

@liyafan82
Copy link
Contributor

Merging. Thanks for your effort. @lidavidm @alamb

@liyafan82 liyafan82 closed this in 6b85f6e Jan 8, 2021
@alamb
Copy link
Contributor

alamb commented Jan 8, 2021

🎉 thanks @liyafan82 -- I didn't do anything, it was all @lidavidm . Thanks @lidavidm for the efforts!

nevi-me pushed a commit that referenced this pull request Jan 9, 2021
This PR has a few refactorings and then the main commit contains a new Flight integration test client and server 🎉

The middleware scenario tests are currently skipped because they will fail until `tonic` can be updated to a version containing [a fix having to do with trailers](hyperium/tonic#510); this is tracked in [ARROW-10961](https://issues.apache.org/jira/browse/ARROW-10961).

Some Rust <-> Java integration tests will fail until [this PR is merged](#8963); I'm happy to rebase once that goes in, but I wanted to get code review started on this. Thank you!!

Closes #9049 from carols10cents/rust-flight-integration

Lead-authored-by: Carol (Nichols || Goulding) <[email protected]>
Co-authored-by: Jake Goulding <[email protected]>
Signed-off-by: Neville Dipale <[email protected]>
alamb pushed a commit to apache/arrow-rs that referenced this pull request Apr 20, 2021
This PR has a few refactorings and then the main commit contains a new Flight integration test client and server 🎉

The middleware scenario tests are currently skipped because they will fail until `tonic` can be updated to a version containing [a fix having to do with trailers](hyperium/tonic#510); this is tracked in [ARROW-10961](https://issues.apache.org/jira/browse/ARROW-10961).

Some Rust <-> Java integration tests will fail until [this PR is merged](apache/arrow#8963); I'm happy to rebase once that goes in, but I wanted to get code review started on this. Thank you!!

Closes #9049 from carols10cents/rust-flight-integration

Lead-authored-by: Carol (Nichols || Goulding) <[email protected]>
Co-authored-by: Jake Goulding <[email protected]>
Signed-off-by: Neville Dipale <[email protected]>
pribor pushed a commit to GlobalWebIndex/arrow that referenced this pull request Oct 24, 2025
Fixes compatibility with standard Protobuf implementations, which may omit serialization of an empty field. In the case of an empty record batch, this would cause the Java client to fail a precondition check since there would be no body buffer instead of a single empty body buffer.

Closes apache#8963 from lidavidm/arrow-10962

Authored-by: David Li <[email protected]>
Signed-off-by: liyafan82 <[email protected]>
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.

3 participants