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

[Feature][Connector-v2] improve assert sink connector #2844

Merged
merged 26 commits into from
Oct 8, 2022

Conversation

liugddx
Copy link
Member

@liugddx liugddx commented Sep 22, 2022

Close #2796

Purpose of this pull request

improve assert sink connector

Check list

@liugddx liugddx marked this pull request as draft September 22, 2022 08:45

import java.io.Serializable;

public class AssertRowRule implements Serializable {
Copy link
Contributor

Choose a reason for hiding this comment

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

This class is useless. Maybe we should remove it first.

@@ -49,7 +54,18 @@ public void write(SeaTunnelRow element) {

@Override
public void close() throws IOException {
// nothing
assertRowRules.stream().filter(assertRule -> {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think It is easier to understand if we use anyMatch instead of filter and findFirst here.

@@ -28,24 +28,24 @@ env {

source {
# This is a example source plugin **only for test and demonstrate the feature source plugin**
FakeSource {
Copy link
Contributor

Choose a reason for hiding this comment

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

this config file is no need to change in this PR.

@lhyundeadsoul
Copy link
Contributor

lhyundeadsoul commented Sep 23, 2022

Thx for your contribution. Could you help to update the manual doc docs/en/connector-v2/sink/Assert.md?

@liugddx
Copy link
Member Author

liugddx commented Sep 26, 2022

Thx for your contribution. Could you help to update the manual doc docs/en/connector-v2/sink/Assert.md?

Done,thank you for your code review.

# Conflicts:
#	seatunnel-examples/seatunnel-flink-connector-v2-example/src/main/resources/examples/fake_to_console.conf
@hailin0
Copy link
Member

hailin0 commented Sep 28, 2022

image

please fix ci-check

@liugddx liugddx marked this pull request as ready for review September 28, 2022 09:10
# Conflicts:
#	seatunnel-e2e/seatunnel-flink-connector-v2-e2e/connector-redis-flink-e2e/src/test/java/org/apache/seatunnel/e2e/flink/v2/redis/RedisIT.java
#	seatunnel-e2e/seatunnel-flink-connector-v2-e2e/connector-redis-flink-e2e/src/test/resources/redis/redis_source_and_sink.conf
#	seatunnel-e2e/seatunnel-spark-connector-v2-e2e/connector-redis-spark-e2e/src/test/java/org/apache/seatunnel/e2e/spark/v2/redis/RedisIT.java
#	seatunnel-e2e/seatunnel-spark-connector-v2-e2e/connector-redis-spark-e2e/src/test/resources/redis/redis_source_and_sink.conf
{
row_rules = [
{
rule_type = MAX_ROW
Copy link
Member

Choose a reason for hiding this comment

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

If I want to test test final row number equals a expected value, how can I do.

Copy link
Member Author

Choose a reason for hiding this comment

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

If I want to test test final row number equals a expected value, how can I do.

add EQUAL_ROW rule_type? any good suggestions?

Copy link
Contributor

Choose a reason for hiding this comment

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

how about making max = min to express equal?

Copy link
Member Author

Choose a reason for hiding this comment

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

how about making max = min to express equal?

That's a good idea.

Copy link
Member

Choose a reason for hiding this comment

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

how about making max = min to express equal?

I agree with you. And we must judge max=min after all data processing is completed.

Copy link
Member Author

Choose a reason for hiding this comment

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

how about making max = min to express equal?

I agree with you. And we must judge max=min after all data processing is completed.

how about remove maxand min and add expected_num

Copy link
Member

Choose a reason for hiding this comment

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

how about making max = min to express equal?

I agree with you. And we must judge max=min after all data processing is completed.

how about remove maxand min and add expected_num

Some Source Connector support AT_LEAST_ONCE, so max and min is needed.

@liugddx
Copy link
Member Author

liugddx commented Oct 6, 2022

please help to code review @EricJoy2048 @hailin0

@liugddx
Copy link
Member Author

liugddx commented Oct 8, 2022

Can this pr continue to flow?
@EricJoy2048 @lhyundeadsoul

Copy link
Member

@EricJoy2048 EricJoy2048 left a comment

Choose a reason for hiding this comment

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

+1

@Hisoka-X Hisoka-X merged commit 967fec0 into apache:dev Oct 8, 2022
@liugddx liugddx deleted the enhance-assert branch November 5, 2022 07:57
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.

[Feature][Connector-v2] Enhance Assert sink connector
5 participants