-
Notifications
You must be signed in to change notification settings - Fork 526
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
refactor(stream): human-friendly StreamChunk
literal for test
#2089
Conversation
I'd prefer to introduce a new trait Also, it's good to create a mod like |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
94df9d0
to
04313c2
Compare
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Signed-off-by: Runji Wang <wangrunji0408@163.com>
Codecov Report
@@ Coverage Diff @@
## main #2089 +/- ##
==========================================
- Coverage 71.03% 70.64% -0.40%
==========================================
Files 635 635
Lines 81661 80464 -1197
==========================================
- Hits 58010 56843 -1167
+ Misses 23651 23621 -30
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 Codecov can now indicate which changes are the most critical in Pull Requests. Learn more |
@@ -62,7 +62,7 @@ impl DataChunkBuilder { | |||
} | |||
|
|||
/// `DataChunk` is a collection of arrays with visibility mask. | |||
#[derive(Clone, Default)] | |||
#[derive(Clone, Default, PartialEq)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we consider comparing two data chunks regardless of the visibility? That is, even though the visibilities differ, they are the same since the data after compaction is the same.
Seems this is used for test only.
What's changed and what's your intention?
PLEASE DO NOT LEAVE THIS EMPTY !!!
Now it's painful to read unit tests of executors because the code to construct and verify
StreamChunk
is verbose.This PR introduces a literal format for
StreamChunk
. An example is as follows:Developers can use
StreamChunk::from_str
to build a chunk from literal.We also
impl PartialEq for StreamChunk
so that output chunks can be verified byassert_eq!
.Using these utilities, I rewrote a lot of code in the unit tests to make them more readable.
Checklist
Refer to a related PR or issue link (optional)