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
[HUDI-707]Add unit test for StatsCommand #1645
Conversation
b27c8b0
to
56f3de2
Compare
Yes, of course. |
Codecov Report
@@ Coverage Diff @@
## master #1645 +/- ##
=========================================
Coverage 18.33% 18.33%
Complexity 855 855
=========================================
Files 344 344
Lines 15167 15167
Branches 1512 1512
=========================================
Hits 2781 2781
Misses 12033 12033
Partials 353 353 Continue to review full report at Codecov.
|
138f2f8
to
a33b560
Compare
@yanghua : it's ready now. |
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.
@hddong Left some comments.
@@ -64,8 +64,9 @@ public void init() throws IOException { | |||
tablePath = basePath + File.separator + tableName; | |||
|
|||
// Create table and connect | |||
System.out.println(tablePath); |
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.
Can we remove stdout print?
@Test | ||
public void testWriteAmplificationStats() { | ||
// generate data and metadata | ||
Map<String, Integer[]> data = new LinkedHashMap(); |
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.
-> Map<String, Integer[]> data = new LinkedHashMap<>();
public void testFileSizeStats() throws IOException { | ||
String commit1 = "100"; | ||
String commit2 = "101"; | ||
Map<String, Integer[]> data = new LinkedHashMap(); |
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.
ditto
return HoodiePrintHelper.print(header, getFieldNameToConverterMap(), sortByField, descending, limit, headerOnly, rows); | ||
} | ||
|
||
public Map getFieldNameToConverterMap() { |
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.
Can we return a generic type Map<String, Function<Object, String>>
?
@yanghua Thanks for your review, had address them. |
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.
LGTM. @hddong thanks for your contribution.
Tips
What is the purpose of the pull request
Add unit test for StatsCommand
Brief change log
Verify this pull request
This pull request is a trivial rework / code cleanup without any test coverage.
Committer checklist
Has a corresponding JIRA in PR title & commit
Commit message is descriptive of the change
CI is green
Necessary doc changes done or have another open PR
For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.