ruanwenjun commented on issue #1912:
URL: 
https://github.com/apache/incubator-seatunnel/issues/1912#issuecomment-1154656377

   > @ruanwenjun Here is my idea of FakeAssertSink design, please check it out 
and let me know if there is anything wrong. Thx! Refer to ConsoleSink, I think 
the FakeAssertSink plugin should follow the rules following:
   > 
   > 1. in  `seatunnel-connector-flink-fake` module and 
`org.apache.seatunnel.flink.fake.sink` package
   I think you can add a new plugin module `seatunnel-connector-flink-assert`.
   > 2. implements `FlinkBatchSink` and `FlinkStreamSink`,and no need to extend 
`RichOutputFormat` as there is nothing need to output.
   > 3. config should be like this
   > 
   > ```
   > FakeAssertSink {
   >     rules = [
   >         {
   >             field_name = 'name'
   >             field_type = 'string'
   >             field_value = [
   >                 {
   >                     rule_type = 'not-null'
   >                 },
   >                 {
   >                     rule_type = 'minLength'
   >                     rule_value = 5
   >                 },
   >                 {
   >                      rule_type = 'maxLength'
   >                      rule_value = 10
   >                 }
   >             ]
   >         },
   >         {
   >             field_name = 'age'
   >             field_type = 'int'
   >             field_value = [
   >                 {
   >                     rule_type = 'min'
   >                     rule_value = 18
   >                 },
   >                 {
   >                     rule_type = 'max'
   >                     rule_value = 100
   >                 }
   >             ]
   >         }
   >     ]
   >  }
   > ```
   Yes, you can define some rules.
   > 
   > 4. A rule parser and data validator are necessary to resolve the rules 
config and throw an exception including the wrong data  as long as a data can 
not pass the rules
   You mean validate the data in runtime, if validate failed, then throw 
exception? It's OK to me.
   
   


-- 
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