simplify and improve VNG format#4984
Merged
Merged
Conversation
nwt
reviewed
Jan 15, 2024
nwt
reviewed
Jan 15, 2024
nwt
reviewed
Jan 15, 2024
Comment on lines
46
to
49
nwt
reviewed
Jan 15, 2024
This commit simplifies the VNG format with a new VNG metadata object called Variant, which represents a sequence of typed values (without putting the types into a union), in line with the Zed data model. This replaces the ad hoc data structures that were encoded in the VNG trailer. We also changed vectors so they are all represented in a single segment in the data section, which simplifies vector stats and reading. To support streaming, we replaced the trailer with a header and added framing so that VNG objects can simply be concatenated in a stream or file. We added the command "zed dev vng" to displace the fixed VNG framing header (with magic) and the metadata as Zed data. Nulls are now handled completely by the Nulls metadata structure and vector metadata now includes length information, which will be used by the vcache in a subsequent commit to faciliate easier flattening of leaf vectors so that all leaf values within a type all have the same length (except perhaps for vectors below unions, TBD). The VNG write path now stores each object entirely in memory. Once all writes have completed, the vectors are encoded in parallel (e.g., applying compression). Then a DFS traversal computes the data layout and produces a single Zed value representing the vector metadata with data locations. The header, metadatasection, and data vectors are then written out sequentially from a single thread such that the buffers end up being written in the same locations that were computed in the metadata pass.
nwt
reviewed
Jan 15, 2024
| return err | ||
| meta, dataSize, err := w.variant.Encode() | ||
| if err != nil { | ||
| //XXX can encode return an error? |
Member
There was a problem hiding this comment.
Seems like the answer here, at least for now, is yes.
nwt
approved these changes
Jan 15, 2024
nwt
added a commit
that referenced
this pull request
Feb 14, 2024
As of #4984, VNG no longer includes a zngio.Trailer. Remove it and the "zed dev dig section" and "zed dev dig trailer" commands, which depend on it.
nwt
added a commit
that referenced
this pull request
Feb 16, 2024
As of #4984, VNG no longer includes a zngio.Trailer. Remove it and the "zed dev dig section" and "zed dev dig trailer" commands, which depend on it.
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.
This commit simplifies the VNG format with a new VNG metadata object called Variant, which represents a sequence of typed values (without putting the types into a union), in line with the Zed data model. This replaces the ad hoc data structures that were encoded in the VNG trailer. We also changed vectors so they are all represented in a single segment in the data section, which simplifies vector stats and reading. To support streaming, we replaced the trailer with a header and added framing so that VNG objects can simply be concatenated in a stream or file. We added the command "zed dev vng" to displace the fixed VNG framing header (with magic) and the metadata as Zed data.
Nulls are now handled completely by the Nulls metadata structure and vector metadata now includes length information, which will be used by the vcache in a subsequent commit to faciliate easier flattening of leaf vectors so that all leaf values within a type all have the same length (except perhaps for vectors below unions, TBD).
The VNG write path now stores each object entirely in memory. Once all writes have completed, the vectors are encoded in parallel (e.g., applying compression). Then a DFS traversal computes the data layout and produces a single Zed value representing the vector metadata with data locations. The header, metadatasection, and data vectors are then written out sequentially from a single thread such that the buffers end up being written in the same locations that were computed in the metadata pass.
Closes #4312