feat: Add plan compression and CLI decode support - #586
Open
Rich-T-kid wants to merge 2 commits into
Open
Conversation
gabotechs
reviewed
Aug 4, 2026
Comment on lines
+139
to
+144
| /// Decodes a base64-encoded plan string produced by [`explain_analyze`](crate::explain_analyze). | ||
| pub fn extract_encoded_plan(&self, encoded_plan: &str) -> String { | ||
| Engine::decode(&STANDARD, encoded_plan) | ||
| .map(|bytes| String::from_utf8_lossy(&bytes).into_owned()) | ||
| .unwrap_or_else(|_| encoded_plan.to_string()) | ||
| } |
Collaborator
There was a problem hiding this comment.
Based on the original issue:
This project is capable of representing DataFusion metrics in a protobuf format, and at the same time, all DataFusion plans can be serialized as well, so it should be possible for this project to provide a loggable compressed EXPLAIN ANALYZE-like representation that is suitable for a logging system + the tools for properly decoding and visualizing that.
We do not want to just compress the EXPLAIN ANALYZE string in base64, what we want is to create a representation of the metrics as protobuf-compatible structs, and serialize/deserialize those instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #523
DistributedExec::extract_encoded_plandecodes a base64 plan string back to readable ASCII; passes through plain-text plans unchanged