pengzhiwei2018 commented on a change in pull request #2645:
URL: https://github.com/apache/hudi/pull/2645#discussion_r601145258



##########
File path: 
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieMergeHandle.java
##########
@@ -394,4 +405,36 @@ public IOType getIOType() {
   public HoodieBaseFile baseFileForMerge() {
     return baseFileToMerge;
   }
+
+  /**
+   * A special record returned by {@link HoodieRecordPayload}, which means
+   * {@link HoodieMergeHandle} should just skip this record.
+   */
+  private static class IgnoreRecord implements GenericRecord {

Review comment:
       For  the  `MergeInto` Statement, If there are not records match the 
conditions, we should filter the record by the `ExpressionPayload`. e.g.
   
   Merge Into d0
   using ( select 1 as id, 'a1' as name ) s0
   on d0.id = s0.id
   when matched and s0.id %2 = 0 then update set *
   
   The input `(1, 'a1')` will be filtered by the match condition `id %2 = 0`. 
In our implementation,we push all the condition and update expression to the   
`ExpressionPayload`, So the `Payload` must have the ability to filter the 
record. Currently the return of `Option.empty` means "DELTE" for record. I add 
a special record `IgnoredRecord` to
   represents the filter record.
   




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

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


Reply via email to