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

Added Zip operation and Sample operation #26

Merged
merged 14 commits into from
Dec 5, 2023
Merged

Added Zip operation and Sample operation #26

merged 14 commits into from
Dec 5, 2023

Conversation

Xintong-Zhan
Copy link
Collaborator

Files modified:

  • examples/filter_even.cpp: Added usage examples of Sample operation.
  • examples/simple.cpp: Added a usage eample of Zip operation.
  • include/filter_rdd.h: Included ramdom header for the support of Sample operation.

Files added:

  • include/sample_rdd.h: Sample operation. This operation is based on FilterView by passing random boolean function as a param to FilterView.
  • include/zipped_rdd.h: Zip operation. No pipeline is implemented for the Zip operation since both params are Rdd, and using pipeline with one Rdd to be function param is a little bit weird.
  • tests/sample_rdd_test.cpp: Google test for Sample.
  • tests/zipped_rdd_test.cpp: Goole test for Zip.

Copy link

codecov bot commented Dec 5, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (b15424d) 97.29% compared to head (2cf7f09) 97.36%.
Report is 2 commits behind head on main.

Files Patch % Lines
include/zipped_rdd.h 92.30% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #26      +/-   ##
==========================================
+ Coverage   97.29%   97.36%   +0.06%     
==========================================
  Files          22       26       +4     
  Lines         628      682      +54     
==========================================
+ Hits          611      664      +53     
- Misses         17       18       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Owner

@Alex-XJK Alex-XJK left a comment

Choose a reason for hiding this comment

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

I think the doxygen comment should be added. I have already provide some skeleton code for you, please double check it and add additional description if needed.

include/filter_rdd.h Outdated Show resolved Hide resolved
include/sample_rdd.h Show resolved Hide resolved
include/sample_rdd.h Show resolved Hide resolved
include/zipped_rdd.h Show resolved Hide resolved
include/zipped_rdd.h Show resolved Hide resolved
using V1 = utils::RddElementType<R1>;
using V2 = utils::RddElementType<R2>;

constexpr ZippedRdd(const R1& prev1, const R2& prev2) : Base{prev1, false} {
Copy link
Owner

Choose a reason for hiding this comment

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

Shall we unify the name convention? Currently, it looks like some Rdd's are named in the present tense (Sample, Merge), and some are named in the past tense (Zipped, Transformed).

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it is a relatively minor issue. But if any of you are available, it does not hurt to rename them to past tense.

@Alex-XJK
Copy link
Owner

Alex-XJK commented Dec 5, 2023

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (b15424d) 97.29% compared to head (908a0bf) 97.22%.
Report is 2 commits behind head on main.

Files Patch % Lines
include/zipped_rdd.h 92.30% 1 Missing ⚠️
tests/sample_rdd_test.cpp 95.00% 1 Missing ⚠️
Additional details and impacted files
☔ View full report in Codecov by Sentry. 📢 Have feedback on the report? Share it here.

It is strange that one of the lines in the TEST script didn't get covered, because they are the ones we used to test other headers.
If there are no other coding issues hidden behind, I think we can simply ignore this coverage issue because, obviously, getting it functionally correct is much more important than getting it 100% coverage, at least for now.
If other reviewers approved all other parts, but this Codecov is still blocking the merge, let me know, and I can force merge it 😊

Copy link
Collaborator

@chenlighten chenlighten left a comment

Choose a reason for hiding this comment

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

Thanks for finishing sampe_rdd and zipped_rdd. Commented some minor issues. You can take a look of them if you have time. If you are busy, feel free to take care of them in the future.

include/sample_rdd.h Show resolved Hide resolved
include/sample_rdd.h Show resolved Hide resolved
include/sample_rdd.h Show resolved Hide resolved
using V1 = utils::RddElementType<R1>;
using V2 = utils::RddElementType<R2>;

constexpr ZippedRdd(const R1& prev1, const R2& prev2) : Base{prev1, false} {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it is a relatively minor issue. But if any of you are available, it does not hurt to rename them to past tense.

include/zipped_rdd.h Show resolved Hide resolved
@Xintong-Zhan
Copy link
Collaborator Author

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (b15424d) 97.29% compared to head (908a0bf) 97.22%.
Report is 2 commits behind head on main.

Files Patch % Lines
include/zipped_rdd.h 92.30% 1 Missing ⚠️
tests/sample_rdd_test.cpp 95.00% 1 Missing ⚠️
Additional details and impacted files
☔ View full report in Codecov by Sentry. 📢 Have feedback on the report? Share it here.

For the Google Test script, the line that didn't get covered is for the SampleRdd operation with fraction = 0, which means the returned Rdd should contain nothing, thus the program won't get in the loop body for Rdd and I guess that's the reason for not being covered. And because of the random feature, the only deterministic case I could test in Google test script is fraction = 1 and fraction = 0. For other random sample cases, I present them in the ./examples directory.

tests/sample_rdd_test.cpp Outdated Show resolved Hide resolved
Copy link
Owner

@Alex-XJK Alex-XJK left a comment

Choose a reason for hiding this comment

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

Thank you for your effort!

@Xintong-Zhan Xintong-Zhan merged commit a1e82f2 into main Dec 5, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants