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

Introduce codec for the gRPC QueryResponse payload #7733

Merged
merged 4 commits into from
Oct 21, 2024

Conversation

zehiko
Copy link
Contributor

@zehiko zehiko commented Oct 15, 2024

What

gRPC layer QueryResponse contains raw bytes as the payload. We keep interpretation of the payload to our own encoder which this PR introduces. V0 codec is simple and stateless and doesn't deal with the fact every serialized record batch has schema included.

As for the encoding, we simply rely on arrow2 serialization and deserialization constructs for the record batch and we have our own header to differentiate between "no data" and a "record batch" in the QueryResponse.

Example usage:

let version = EncoderVersion::V0;
Ok(QueryResponse {
  encoder_version: version as i32,
  payload: encode(version, chunk)
    .map_err(|err| Status::internal(format!("Error encoding chunk: {err}")))?,
})

let tc = decode(EncoderVersion::V0, &raw.payload).unwrap().unwrap();
eprintln!("transport chunk: {tc}");

Depends on

#7674

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • [ x] I have tested the web demo (if applicable):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG
  • If applicable, add a new check to the release checklist!
  • If have noted any breaking changes to the log API in CHANGELOG.md and the migration guide

To run all checks from main, comment on the PR with @rerun-bot full-check.

@zehiko zehiko added the exclude from changelog PRs with this won't show up in CHANGELOG.md label Oct 15, 2024
@zehiko zehiko requested review from teh-cmc and jleibs October 15, 2024 10:09
@zehiko zehiko self-assigned this Oct 15, 2024
Base automatically changed from zehiko/remote-store-spec to main October 19, 2024 16:51
crates/store/re_remote_store_types/Cargo.toml Outdated Show resolved Hide resolved
crates/store/re_remote_store_types/src/codec.rs Outdated Show resolved Hide resolved
@zehiko zehiko merged commit 14a7dd4 into main Oct 21, 2024
34 checks passed
@zehiko zehiko deleted the zehiko/remote-store-codec branch October 21, 2024 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exclude from changelog PRs with this won't show up in CHANGELOG.md
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants