-
Notifications
You must be signed in to change notification settings - Fork 327
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
[BitSail][Connector] Support Assert sink connector #282
Conversation
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.
thanks for your contribution @liuxiaocs7 , left some comments
@@ -0,0 +1,9 @@ | |||
{ | |||
"name": "bitsail-connector-unified-assert", |
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 remove unified
here?
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.
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.
ok I see
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class AssertRuleExecutor { |
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 add UT for this class?
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.
sure, i'll add it
|
||
@Override | ||
public void close() throws IOException { | ||
if (rowRules != null) { |
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.
didn't get this. Why do we do this at closing
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.
rowRules
is used to limit the number of processed data by engine, we need to ensure that the number of processed data is within the range of [min_row, max_row]
. In write
method, we add counter the after handler a row and compare it in close
method finally.
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.
so the row rule must be a single parallelism right, looks like this counter only count the number of rows in this writer.
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.
thanks for pointing this out, i think so, if we want to limit row number, the parallelism must be one, can we set it writer_parallelism_num
by this conf, or any suggestions, thx
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.
if the assert sink only support single parallelism, we should make sure the single parallelism was hard coded to ensure the correct result. The related class is ParallelismComputable
.
If we wanna support multi parallelism, I believe we should some how aggregate the count in the coordinator. We could make the multi parallelism support as a follow up task for future work.
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.
Thanks so much, got it, i'll look ParallelismComputable
first.
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class AssertRuleParser implements Serializable { |
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.
IMO UT is necessary for this class. can we add it please
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.
sure, by the way, what's the meaning of IMO? :)
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.
it stands for in my opinion :)
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.
get it, thx
@garyli1019 The ci failed, and error message shows failing to download maven dependency, which may be caused by network problems.
|
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~ Thanks for your contribution @liuxiaocs7 , would you please make a follow up PR to add the documentation about this assert sink?
sure, I'd love to do |
Signed-off-by:
Pre-Checklist
Note: Please complete ALL items in the following checklist.
Purpose
Some description about what this PR wants to do.
Approaches
Currently we support print sink and we use print in some tests, but print is not sufficient enough to verify the test result.
So we implement an AssertSink to verify the test result more accurately.
Related Issues
Close #153
New Behavior (screenshots if needed)
N/A