ruanwenjun commented on code in PR #2036:
URL: 
https://github.com/apache/incubator-seatunnel/pull/2036#discussion_r910887980


##########
seatunnel-connectors/seatunnel-connectors-flink/seatunnel-connector-flink-assert/src/main/java/org/apache/seatunnel/flink/assertion/sink/AssertSink.java:
##########
@@ -59,7 +61,7 @@ public void outputBatch(FlinkEnvironment env, DataSet<Row> 
inDataSet) {
                     throw new IllegalStateException("row :" + row + " fail 
rule: " + failRule);
                 });
             return null;
-        });
+        }).print();

Review Comment:
   It's better to use collect here, if you don't want to print each row.
   ```
   try {
               inDataSet.collect().forEach(row -> {
                   ASSERT_EXECUTOR
                       .fail(row, assertFieldRules)
                       .ifPresent(failRule -> {
                           throw new IllegalStateException("row :" + row + " 
fail rule: " + failRule);
                       });
               });
           } catch (IllegalArgumentException illegalArgumentException) {
               throw illegalArgumentException;
           } catch (Exception ex) {
               throw new RuntimeException("AssertSink execute failed", ex);
           }
   ```



##########
seatunnel-connectors/seatunnel-connectors-flink/seatunnel-connector-flink-assert/src/main/java/org/apache/seatunnel/flink/assertion/sink/AssertSink.java:
##########
@@ -71,7 +73,7 @@ public void outputStream(FlinkEnvironment env, 
DataStream<Row> dataStream) {
                     throw new IllegalStateException("row :" + row + "field 
name of the fail rule: " + failRule.getFieldName());
                 });
             return null;
-        });
+        }).print();

Review Comment:
   You don't need to add print() in stream mode.
   ```suggestion
           });
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to