You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/11/07 08:21:41 UTC

[GitHub] [hudi] codope commented on a diff in pull request #7132: [HUDI-51577] Adding capability to remove all meta fields from source hudi table with Hudi incr source

codope commented on code in PR #7132:
URL: https://github.com/apache/hudi/pull/7132#discussion_r1015120046


##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/sources/HoodieIncrSource.java:
##########
@@ -172,10 +178,13 @@ public Pair<Option<Dataset<Row>>, String> fetchNextBatch(Option<String> lastCkpt
      *
      * log.info("Validated Source Schema :" + validated.schema());
      */
+    boolean dropAllMetaFields = props.getBoolean(Config.HOODIE_DROP_ALL_META_FIELDS_FROM_SOURCE,
+        Config.DEFAULT_HOODIE_DROP_ALL_META_FIELDS_FROM_SOURCE);
 
     // Remove Hoodie meta columns except partition path from input source
-    final Dataset<Row> src = source.drop(HoodieRecord.HOODIE_META_COLUMNS.stream()
-        .filter(x -> !x.equals(HoodieRecord.PARTITION_PATH_METADATA_FIELD)).toArray(String[]::new));
+    String[] colsToDrop = dropAllMetaFields ? HoodieRecord.HOODIE_META_COLUMNS.stream().toArray(String[]::new) :
+        HoodieRecord.HOODIE_META_COLUMNS.stream().filter(x -> !x.equals(HoodieRecord.PARTITION_PATH_METADATA_FIELD)).toArray(String[]::new);

Review Comment:
   Do we know what was the reason we strictly dropped partition path in the first place?



-- 
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: commits-unsubscribe@hudi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org