[ 
https://issues.apache.org/jira/browse/HUDI-1363?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17401426#comment-17401426
 ] 

ASF GitHub Bot commented on HUDI-1363:
--------------------------------------

danny0405 commented on a change in pull request #3465:
URL: https://github.com/apache/hudi/pull/3465#discussion_r691721654



##########
File path: hudi-common/src/main/java/org/apache/hudi/avro/HoodieAvroUtils.java
##########
@@ -223,9 +223,13 @@ public static Schema addMetadataFields(Schema schema, 
boolean withOperationField
   }
 
   public static Schema removeMetadataFields(Schema schema) {
+    return removeFields(schema, HoodieRecord.HOODIE_META_COLUMNS);
+  }
+
+  public static Schema removeFields(Schema schema, List<String> 
fieldsToRemove) {
     List<Schema.Field> filteredFields = schema.getFields()
                                               .stream()
-                                              .filter(field -> 
!HoodieRecord.HOODIE_META_COLUMNS_WITH_OPERATION.contains(field.name()))
+                                              .filter(field -> 
!fieldsToRemove.contains(field.name()))
                                               .map(field -> new 
Schema.Field(field.name(), field.schema(), field.doc(), field.defaultVal()))

Review comment:
       Hey, is this right ? the logic is not equivalent: 
`HoodieRecord.HOODIE_META_COLUMNS_WITH_OPERATION` -> 
`HoodieRecord.HOODIE_META_COLUMNS`, i added the 
`HoodieRecord.HOODIE_META_COLUMNS_WITH_OPERATION` because when flink turns on 
the 'changelog mode', there is another metadata field named '_hoodie_operation'




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


> Provide Option to drop columns after they are used to generate partition or 
> record keys
> ---------------------------------------------------------------------------------------
>
>                 Key: HUDI-1363
>                 URL: https://issues.apache.org/jira/browse/HUDI-1363
>             Project: Apache Hudi
>          Issue Type: New Feature
>          Components: Writer Core
>            Reporter: Balaji Varadarajan
>            Assignee: Sagar Sumit
>            Priority: Blocker
>              Labels: pull-request-available, release-blocker
>             Fix For: 0.9.0
>
>
> Context: https://github.com/apache/hudi/issues/2213



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to