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/04/12 00:32:55 UTC

[GitHub] [hudi] vingov opened a new pull request, #5294: [HUDI-3838] Implemented drop partition column feature for delta streamer code path

vingov opened a new pull request, #5294:
URL: https://github.com/apache/hudi/pull/5294

   ## What is the purpose of the pull request
   
   Add support for `hoodie.datasource.write.drop.partition.columns` config for DeltaStreamer code path.
   
   ## Brief change log
     - *Add support for `hoodie.datasource.write.drop.partition.columns` config for DeltaStreamer code path.*
   
   ## Verify this pull request
   
   *(Please pick either of the following options)*
   
   This change added tests and can be verified as follows:
     - *Added method to TestHoodieAvroUtils class to verify the change.*
     - *Manually verified the change by running a job locally.*
   
   ## Committer checklist
   
    - [x] Has a corresponding JIRA in PR title & commit
    
    - [x] Commit message is descriptive of the change
    
    - [x] CI is green
   
    - [ ] Necessary doc changes done or have another open PR
          
    - [ ] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.
   


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


[GitHub] [hudi] vingov commented on a diff in pull request #5294: [HUDI-3838] Implemented drop partition column feature for delta streamer code path

Posted by GitBox <gi...@apache.org>.
vingov commented on code in PR #5294:
URL: https://github.com/apache/hudi/pull/5294#discussion_r848113533


##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/deltastreamer/DeltaSync.java:
##########
@@ -727,6 +734,13 @@ public void setupWriteClient() throws IOException {
 
   private void reInitWriteClient(Schema sourceSchema, Schema targetSchema) throws IOException {
     LOG.info("Setting up new Hoodie Write Client");
+    final boolean isDropPartitionColumns = props.getBoolean(DROP_PARTITION_COLUMNS.key());
+    if (isDropPartitionColumns) {
+      String partitionColumns = HoodieSparkUtils.getPartitionColumns(keyGenerator, props);

Review Comment:
   updated it.



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


[GitHub] [hudi] hudi-bot commented on pull request #5294: [HUDI-3838] Implemented drop partition column feature for delta streamer code path

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #5294:
URL: https://github.com/apache/hudi/pull/5294#issuecomment-1096409920

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a6f16be43b9125cbf3155917096ad5b604822b42",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8010",
       "triggerID" : "a6f16be43b9125cbf3155917096ad5b604822b42",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a6f16be43b9125cbf3155917096ad5b604822b42",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8010",
       "triggerID" : "1096376778",
       "triggerType" : "MANUAL"
     } ]
   }-->
   ## CI report:
   
   * a6f16be43b9125cbf3155917096ad5b604822b42 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8010) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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


[GitHub] [hudi] codope commented on a diff in pull request #5294: [HUDI-3838] Implemented drop partition column feature for delta streamer code path

Posted by GitBox <gi...@apache.org>.
codope commented on code in PR #5294:
URL: https://github.com/apache/hudi/pull/5294#discussion_r848618110


##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/deltastreamer/DeltaSync.java:
##########
@@ -478,13 +481,14 @@ private Pair<SchemaProvider, Pair<String, JavaRDD<HoodieRecord>>> fetchFromSourc
 
     boolean shouldCombine = cfg.filterDupes || cfg.operation.equals(WriteOperationType.UPSERT);
     JavaRDD<GenericRecord> avroRDD = avroRDDOptional.get();
-    JavaRDD<HoodieRecord> records = avroRDD.map(gr -> {
+    JavaRDD<HoodieRecord> records = avroRDD.map(record -> {
+      GenericRecord gr = isDropPartitionColumns() ? HoodieAvroUtils.removeFields(record, getPartitionColumns(keyGenerator, props)) : record;

Review Comment:
   make sense.. please land #5302 if it looks good.



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


[GitHub] [hudi] hudi-bot commented on pull request #5294: [HUDI-3838] Implemented drop partition column feature for delta streamer code path

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #5294:
URL: https://github.com/apache/hudi/pull/5294#issuecomment-1096579737

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a6f16be43b9125cbf3155917096ad5b604822b42",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8010",
       "triggerID" : "a6f16be43b9125cbf3155917096ad5b604822b42",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a6f16be43b9125cbf3155917096ad5b604822b42",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8010",
       "triggerID" : "1096376778",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "e9164c1494191fb50af7814db9810b3afaf25ac4",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8011",
       "triggerID" : "e9164c1494191fb50af7814db9810b3afaf25ac4",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a6f16be43b9125cbf3155917096ad5b604822b42 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8010) 
   * e9164c1494191fb50af7814db9810b3afaf25ac4 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8011) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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


[GitHub] [hudi] hudi-bot commented on pull request #5294: [HUDI-3838] Implemented drop partition column feature for delta streamer code path

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #5294:
URL: https://github.com/apache/hudi/pull/5294#issuecomment-1096672790

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a6f16be43b9125cbf3155917096ad5b604822b42",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8010",
       "triggerID" : "a6f16be43b9125cbf3155917096ad5b604822b42",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a6f16be43b9125cbf3155917096ad5b604822b42",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8010",
       "triggerID" : "1096376778",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "e9164c1494191fb50af7814db9810b3afaf25ac4",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8011",
       "triggerID" : "e9164c1494191fb50af7814db9810b3afaf25ac4",
       "triggerType" : "PUSH"
     }, {
       "hash" : "afc2f676cd198fd6fbba9e66c27470aefad98262",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "afc2f676cd198fd6fbba9e66c27470aefad98262",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * e9164c1494191fb50af7814db9810b3afaf25ac4 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8011) 
   * afc2f676cd198fd6fbba9e66c27470aefad98262 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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


[GitHub] [hudi] vingov commented on a diff in pull request #5294: [HUDI-3838] Implemented drop partition column feature for delta streamer code path

Posted by GitBox <gi...@apache.org>.
vingov commented on code in PR #5294:
URL: https://github.com/apache/hudi/pull/5294#discussion_r848112012


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/config/HoodieWriteConfig.java:
##########
@@ -133,6 +133,11 @@ public class HoodieWriteConfig extends HoodieConfig {
       .withDocumentation("Easily configure one the built-in key generators, instead of specifying the key generator class."
           + "Currently supports SIMPLE, COMPLEX, TIMESTAMP, CUSTOM, NON_PARTITION, GLOBAL_DELETE");
 
+  public static final ConfigProperty<Boolean> DROP_PARTITION_COLUMNS = ConfigProperty

Review Comment:
   good catch updated it.



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


[GitHub] [hudi] hudi-bot commented on pull request #5294: [HUDI-3838] Implemented drop partition column feature for delta streamer code path

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #5294:
URL: https://github.com/apache/hudi/pull/5294#issuecomment-1096306614

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "75051413bfb5e6e01ed8e41c98505ce592e8d81c",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7992",
       "triggerID" : "75051413bfb5e6e01ed8e41c98505ce592e8d81c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "afc2f676cd198fd6fbba9e66c27470aefad98262",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "afc2f676cd198fd6fbba9e66c27470aefad98262",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 75051413bfb5e6e01ed8e41c98505ce592e8d81c Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7992) 
   * afc2f676cd198fd6fbba9e66c27470aefad98262 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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


[GitHub] [hudi] codope merged pull request #5294: [HUDI-3838] Implemented drop partition column feature for delta streamer code path

Posted by GitBox <gi...@apache.org>.
codope merged PR #5294:
URL: https://github.com/apache/hudi/pull/5294


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


[GitHub] [hudi] vingov commented on a diff in pull request #5294: [HUDI-3838] Implemented drop partition column feature for delta streamer code path

Posted by GitBox <gi...@apache.org>.
vingov commented on code in PR #5294:
URL: https://github.com/apache/hudi/pull/5294#discussion_r848111267


##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/deltastreamer/DeltaSync.java:
##########
@@ -477,14 +479,19 @@ private Pair<SchemaProvider, Pair<String, JavaRDD<HoodieRecord>>> fetchFromSourc
     }
 
     boolean shouldCombine = cfg.filterDupes || cfg.operation.equals(WriteOperationType.UPSERT);
+    boolean isDropPartitionColumns = props.getBoolean(DROP_PARTITION_COLUMNS.key());
+    String partitionColumns = HoodieSparkUtils.getPartitionColumns(keyGenerator, props);
+    List<String> listOfPartitionColumns = Arrays.asList(partitionColumns.split(","));
     JavaRDD<GenericRecord> avroRDD = avroRDDOptional.get();
+    HoodieKey key = keyGenerator.getKey(avroRDD.first());
     JavaRDD<HoodieRecord> records = avroRDD.map(gr -> {
+      gr = isDropPartitionColumns ? HoodieAvroUtils.removeFields(gr, listOfPartitionColumns) : gr;

Review Comment:
   There are no tests for the whole `readFromSource` or `fetchFromSource`, it will take more time to add UT for the entire method, can I take it up as a separate task, since this PR is a blocker for this release.



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


[GitHub] [hudi] codope commented on a diff in pull request #5294: [HUDI-3838] Implemented drop partition column feature for delta streamer code path

Posted by GitBox <gi...@apache.org>.
codope commented on code in PR #5294:
URL: https://github.com/apache/hudi/pull/5294#discussion_r848618110


##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/deltastreamer/DeltaSync.java:
##########
@@ -478,13 +481,14 @@ private Pair<SchemaProvider, Pair<String, JavaRDD<HoodieRecord>>> fetchFromSourc
 
     boolean shouldCombine = cfg.filterDupes || cfg.operation.equals(WriteOperationType.UPSERT);
     JavaRDD<GenericRecord> avroRDD = avroRDDOptional.get();
-    JavaRDD<HoodieRecord> records = avroRDD.map(gr -> {
+    JavaRDD<HoodieRecord> records = avroRDD.map(record -> {
+      GenericRecord gr = isDropPartitionColumns() ? HoodieAvroUtils.removeFields(record, getPartitionColumns(keyGenerator, props)) : record;

Review Comment:
   makes sense.. please land #5302 if it looks good.



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


[GitHub] [hudi] hudi-bot commented on pull request #5294: [HUDI-3838] Implemented drop partition column feature for delta streamer code path

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #5294:
URL: https://github.com/apache/hudi/pull/5294#issuecomment-1095739471

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "75051413bfb5e6e01ed8e41c98505ce592e8d81c",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7992",
       "triggerID" : "75051413bfb5e6e01ed8e41c98505ce592e8d81c",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 75051413bfb5e6e01ed8e41c98505ce592e8d81c Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7992) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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


[GitHub] [hudi] hudi-bot commented on pull request #5294: [HUDI-3838] Implemented drop partition column feature for delta streamer code path

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #5294:
URL: https://github.com/apache/hudi/pull/5294#issuecomment-1096655626

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a6f16be43b9125cbf3155917096ad5b604822b42",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8010",
       "triggerID" : "a6f16be43b9125cbf3155917096ad5b604822b42",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a6f16be43b9125cbf3155917096ad5b604822b42",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8010",
       "triggerID" : "1096376778",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "e9164c1494191fb50af7814db9810b3afaf25ac4",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8011",
       "triggerID" : "e9164c1494191fb50af7814db9810b3afaf25ac4",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * e9164c1494191fb50af7814db9810b3afaf25ac4 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8011) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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


[GitHub] [hudi] nsivabalan commented on a diff in pull request #5294: [HUDI-3838] Implemented drop partition column feature for delta streamer code path

Posted by GitBox <gi...@apache.org>.
nsivabalan commented on code in PR #5294:
URL: https://github.com/apache/hudi/pull/5294#discussion_r848568345


##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/deltastreamer/DeltaSync.java:
##########
@@ -478,13 +481,14 @@ private Pair<SchemaProvider, Pair<String, JavaRDD<HoodieRecord>>> fetchFromSourc
 
     boolean shouldCombine = cfg.filterDupes || cfg.operation.equals(WriteOperationType.UPSERT);
     JavaRDD<GenericRecord> avroRDD = avroRDDOptional.get();
-    JavaRDD<HoodieRecord> records = avroRDD.map(gr -> {
+    JavaRDD<HoodieRecord> records = avroRDD.map(record -> {
+      GenericRecord gr = isDropPartitionColumns() ? HoodieAvroUtils.removeFields(record, getPartitionColumns(keyGenerator, props)) : record;

Review Comment:
   getPartitionColumns(keyGenerator, props) could have been done once in the driver. 



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


[GitHub] [hudi] hudi-bot commented on pull request #5294: [HUDI-3838] Implemented drop partition column feature for delta streamer code path

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #5294:
URL: https://github.com/apache/hudi/pull/5294#issuecomment-1095737186

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "75051413bfb5e6e01ed8e41c98505ce592e8d81c",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "75051413bfb5e6e01ed8e41c98505ce592e8d81c",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 75051413bfb5e6e01ed8e41c98505ce592e8d81c UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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


[GitHub] [hudi] vingov commented on a diff in pull request #5294: [HUDI-3838] Implemented drop partition column feature for delta streamer code path

Posted by GitBox <gi...@apache.org>.
vingov commented on code in PR #5294:
URL: https://github.com/apache/hudi/pull/5294#discussion_r847848179


##########
hudi-common/src/main/java/org/apache/hudi/avro/HoodieAvroUtils.java:
##########
@@ -441,6 +441,17 @@ public static List<GenericRecord> rewriteRecords(List<GenericRecord> records, Sc
     return records.stream().map(r -> rewriteRecord(r, newSchema)).collect(Collectors.toList());
   }
 
+  /**
+   * Given an Avro record and list of columns to remove, this method removes the list of columns from
+   * the given avro record using rewriteRecord method.
+   * <p>
+   * To better understand how it removes please check {@link #rewriteRecord(GenericRecord, Schema)}
+   */
+  public static GenericRecord removeFields(GenericRecord record, List<String> columnsToRemove) {

Review Comment:
   The reason for not invoking `rewriteRecord` method directly from DeltaStreamer code is because I was getting serialization error `org.apache.spark.SparkException: Task not serializable` when passing the `targetSchema` to that method from the map lambda expression.
   



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


[GitHub] [hudi] nsivabalan commented on a diff in pull request #5294: [HUDI-3838] Implemented drop partition column feature for delta streamer code path

Posted by GitBox <gi...@apache.org>.
nsivabalan commented on code in PR #5294:
URL: https://github.com/apache/hudi/pull/5294#discussion_r847880037


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/config/HoodieWriteConfig.java:
##########
@@ -133,6 +133,11 @@ public class HoodieWriteConfig extends HoodieConfig {
       .withDocumentation("Easily configure one the built-in key generators, instead of specifying the key generator class."
           + "Currently supports SIMPLE, COMPLEX, TIMESTAMP, CUSTOM, NON_PARTITION, GLOBAL_DELETE");
 
+  public static final ConfigProperty<Boolean> DROP_PARTITION_COLUMNS = ConfigProperty

Review Comment:
   already we have a table config hoodie.datasource.write.drop.partition.columns. can't we re-use that ?



##########
hudi-common/src/test/java/org/apache/hudi/avro/TestHoodieAvroUtils.java:
##########
@@ -227,6 +228,20 @@ public void testAddingAndRemovingMetadataFields() {
     assertEquals(NUM_FIELDS_IN_EXAMPLE_SCHEMA, schemaWithoutMetaCols.getFields().size());
   }
 
+  @Test
+  public void testRemoveFields() {
+    GenericRecord rec = new GenericData.Record(new Schema.Parser().parse(EXAMPLE_SCHEMA));
+    rec.put("_row_key", "key1");
+    rec.put("non_pii_col", "val1");
+    rec.put("pii_col", "val2");
+    rec.put("timestamp", 3.5);
+    GenericRecord rec1 = HoodieAvroUtils.removeFields(rec, Arrays.asList("pii_col"));
+    assertEquals("key1", rec1.get("_row_key"));
+    assertEquals("val1", rec1.get("non_pii_col"));
+    assertEquals(3.5, rec1.get("timestamp"));
+    assertNull(rec1.get("pii_col"));

Review Comment:
   can we assert the schema of rec1 as well. essentially other fields should not have been moved around. I mean, fields having positions > the removed field will have -1 in their position. but otherwise. 



##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/deltastreamer/DeltaSync.java:
##########
@@ -727,6 +734,13 @@ public void setupWriteClient() throws IOException {
 
   private void reInitWriteClient(Schema sourceSchema, Schema targetSchema) throws IOException {
     LOG.info("Setting up new Hoodie Write Client");
+    final boolean isDropPartitionColumns = props.getBoolean(DROP_PARTITION_COLUMNS.key());
+    if (isDropPartitionColumns) {
+      String partitionColumns = HoodieSparkUtils.getPartitionColumns(keyGenerator, props);

Review Comment:
   we already get these once at L 480 ish. is it possible to re-use them. 



##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/deltastreamer/DeltaSync.java:
##########
@@ -477,14 +479,19 @@ private Pair<SchemaProvider, Pair<String, JavaRDD<HoodieRecord>>> fetchFromSourc
     }
 
     boolean shouldCombine = cfg.filterDupes || cfg.operation.equals(WriteOperationType.UPSERT);
+    boolean isDropPartitionColumns = props.getBoolean(DROP_PARTITION_COLUMNS.key());
+    String partitionColumns = HoodieSparkUtils.getPartitionColumns(keyGenerator, props);
+    List<String> listOfPartitionColumns = Arrays.asList(partitionColumns.split(","));
     JavaRDD<GenericRecord> avroRDD = avroRDDOptional.get();
+    HoodieKey key = keyGenerator.getKey(avroRDD.first());

Review Comment:
   not sure if this is right. we have to move this within map (). for each genRec, we have to first run through key generator and then modify the genRec if need be (drop partition cols). 
   Also, can we move lines 482 to 494 to separate method and keep this method cleaner/leaner.



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


[GitHub] [hudi] hudi-bot commented on pull request #5294: [HUDI-3838] Implemented drop partition column feature for delta streamer code path

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #5294:
URL: https://github.com/apache/hudi/pull/5294#issuecomment-1096387568

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a6f16be43b9125cbf3155917096ad5b604822b42",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "a6f16be43b9125cbf3155917096ad5b604822b42",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a6f16be43b9125cbf3155917096ad5b604822b42 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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


[GitHub] [hudi] vingov commented on a diff in pull request #5294: [HUDI-3838] Implemented drop partition column feature for delta streamer code path

Posted by GitBox <gi...@apache.org>.
vingov commented on code in PR #5294:
URL: https://github.com/apache/hudi/pull/5294#discussion_r848638110


##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/deltastreamer/DeltaSync.java:
##########
@@ -478,13 +481,14 @@ private Pair<SchemaProvider, Pair<String, JavaRDD<HoodieRecord>>> fetchFromSourc
 
     boolean shouldCombine = cfg.filterDupes || cfg.operation.equals(WriteOperationType.UPSERT);
     JavaRDD<GenericRecord> avroRDD = avroRDDOptional.get();
-    JavaRDD<HoodieRecord> records = avroRDD.map(gr -> {
+    JavaRDD<HoodieRecord> records = avroRDD.map(record -> {
+      GenericRecord gr = isDropPartitionColumns() ? HoodieAvroUtils.removeFields(record, getPartitionColumns(keyGenerator, props)) : record;

Review Comment:
   I have created the same PR #5303 as well.



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


[GitHub] [hudi] codope commented on a diff in pull request #5294: [HUDI-3838] Implemented drop partition column feature for delta streamer code path

Posted by GitBox <gi...@apache.org>.
codope commented on code in PR #5294:
URL: https://github.com/apache/hudi/pull/5294#discussion_r848269526


##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/deltastreamer/DeltaSync.java:
##########
@@ -477,14 +479,19 @@ private Pair<SchemaProvider, Pair<String, JavaRDD<HoodieRecord>>> fetchFromSourc
     }
 
     boolean shouldCombine = cfg.filterDupes || cfg.operation.equals(WriteOperationType.UPSERT);
+    boolean isDropPartitionColumns = props.getBoolean(DROP_PARTITION_COLUMNS.key());
+    String partitionColumns = HoodieSparkUtils.getPartitionColumns(keyGenerator, props);
+    List<String> listOfPartitionColumns = Arrays.asList(partitionColumns.split(","));
     JavaRDD<GenericRecord> avroRDD = avroRDDOptional.get();
+    HoodieKey key = keyGenerator.getKey(avroRDD.first());
     JavaRDD<HoodieRecord> records = avroRDD.map(gr -> {
+      gr = isDropPartitionColumns ? HoodieAvroUtils.removeFields(gr, listOfPartitionColumns) : gr;

Review Comment:
   Filed HUDI-3863 as followup. Feel free to pick it up.



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


[GitHub] [hudi] codope commented on a diff in pull request #5294: [HUDI-3838] Implemented drop partition column feature for delta streamer code path

Posted by GitBox <gi...@apache.org>.
codope commented on code in PR #5294:
URL: https://github.com/apache/hudi/pull/5294#discussion_r847876926


##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/deltastreamer/DeltaSync.java:
##########
@@ -477,14 +479,19 @@ private Pair<SchemaProvider, Pair<String, JavaRDD<HoodieRecord>>> fetchFromSourc
     }
 
     boolean shouldCombine = cfg.filterDupes || cfg.operation.equals(WriteOperationType.UPSERT);
+    boolean isDropPartitionColumns = props.getBoolean(DROP_PARTITION_COLUMNS.key());

Review Comment:
   let's also pass the default value: `props.getBoolean(DROP_PARTITION_COLUMNS.key(), DROP_PARTITION_COLUMNS.defaultValue())`
   I don't think TypedProperties applies default directly.



##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/deltastreamer/DeltaSync.java:
##########
@@ -727,6 +734,13 @@ public void setupWriteClient() throws IOException {
 
   private void reInitWriteClient(Schema sourceSchema, Schema targetSchema) throws IOException {
     LOG.info("Setting up new Hoodie Write Client");
+    final boolean isDropPartitionColumns = props.getBoolean(DROP_PARTITION_COLUMNS.key());

Review Comment:
   same here.. let's pass default value.



##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/deltastreamer/DeltaSync.java:
##########
@@ -477,14 +479,19 @@ private Pair<SchemaProvider, Pair<String, JavaRDD<HoodieRecord>>> fetchFromSourc
     }
 
     boolean shouldCombine = cfg.filterDupes || cfg.operation.equals(WriteOperationType.UPSERT);
+    boolean isDropPartitionColumns = props.getBoolean(DROP_PARTITION_COLUMNS.key());
+    String partitionColumns = HoodieSparkUtils.getPartitionColumns(keyGenerator, props);
+    List<String> listOfPartitionColumns = Arrays.asList(partitionColumns.split(","));
     JavaRDD<GenericRecord> avroRDD = avroRDDOptional.get();
+    HoodieKey key = keyGenerator.getKey(avroRDD.first());
     JavaRDD<HoodieRecord> records = avroRDD.map(gr -> {
+      gr = isDropPartitionColumns ? HoodieAvroUtils.removeFields(gr, listOfPartitionColumns) : gr;

Review Comment:
   Would be good if we can also also add a UT in `TestHoodieDeltaStreamer`.



##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/deltastreamer/DeltaSync.java:
##########
@@ -477,14 +479,19 @@ private Pair<SchemaProvider, Pair<String, JavaRDD<HoodieRecord>>> fetchFromSourc
     }
 
     boolean shouldCombine = cfg.filterDupes || cfg.operation.equals(WriteOperationType.UPSERT);
+    boolean isDropPartitionColumns = props.getBoolean(DROP_PARTITION_COLUMNS.key());
+    String partitionColumns = HoodieSparkUtils.getPartitionColumns(keyGenerator, props);
+    List<String> listOfPartitionColumns = Arrays.asList(partitionColumns.split(","));

Review Comment:
   For a non-partitioned table, will this be empty list or a list of single element that is empty string?



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


[GitHub] [hudi] hudi-bot commented on pull request #5294: [HUDI-3838] Implemented drop partition column feature for delta streamer code path

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #5294:
URL: https://github.com/apache/hudi/pull/5294#issuecomment-1095829912

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "75051413bfb5e6e01ed8e41c98505ce592e8d81c",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7992",
       "triggerID" : "75051413bfb5e6e01ed8e41c98505ce592e8d81c",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 75051413bfb5e6e01ed8e41c98505ce592e8d81c Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7992) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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


[GitHub] [hudi] vingov commented on a diff in pull request #5294: [HUDI-3838] Implemented drop partition column feature for delta streamer code path

Posted by GitBox <gi...@apache.org>.
vingov commented on code in PR #5294:
URL: https://github.com/apache/hudi/pull/5294#discussion_r848113146


##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/deltastreamer/DeltaSync.java:
##########
@@ -477,14 +479,19 @@ private Pair<SchemaProvider, Pair<String, JavaRDD<HoodieRecord>>> fetchFromSourc
     }
 
     boolean shouldCombine = cfg.filterDupes || cfg.operation.equals(WriteOperationType.UPSERT);
+    boolean isDropPartitionColumns = props.getBoolean(DROP_PARTITION_COLUMNS.key());
+    String partitionColumns = HoodieSparkUtils.getPartitionColumns(keyGenerator, props);
+    List<String> listOfPartitionColumns = Arrays.asList(partitionColumns.split(","));
     JavaRDD<GenericRecord> avroRDD = avroRDDOptional.get();
+    HoodieKey key = keyGenerator.getKey(avroRDD.first());

Review Comment:
   To make it cleaner I picked the first record for generating the key, I see your point, updated it.



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


[GitHub] [hudi] hudi-bot commented on pull request #5294: [HUDI-3838] Implemented drop partition column feature for delta streamer code path

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #5294:
URL: https://github.com/apache/hudi/pull/5294#issuecomment-1096323549

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "75051413bfb5e6e01ed8e41c98505ce592e8d81c",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7992",
       "triggerID" : "75051413bfb5e6e01ed8e41c98505ce592e8d81c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "afc2f676cd198fd6fbba9e66c27470aefad98262",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8006",
       "triggerID" : "afc2f676cd198fd6fbba9e66c27470aefad98262",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a6f16be43b9125cbf3155917096ad5b604822b42",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "a6f16be43b9125cbf3155917096ad5b604822b42",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 75051413bfb5e6e01ed8e41c98505ce592e8d81c Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7992) 
   * afc2f676cd198fd6fbba9e66c27470aefad98262 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8006) 
   * a6f16be43b9125cbf3155917096ad5b604822b42 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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


[GitHub] [hudi] hudi-bot commented on pull request #5294: [HUDI-3838] Implemented drop partition column feature for delta streamer code path

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #5294:
URL: https://github.com/apache/hudi/pull/5294#issuecomment-1096312398

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "75051413bfb5e6e01ed8e41c98505ce592e8d81c",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7992",
       "triggerID" : "75051413bfb5e6e01ed8e41c98505ce592e8d81c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "afc2f676cd198fd6fbba9e66c27470aefad98262",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8006",
       "triggerID" : "afc2f676cd198fd6fbba9e66c27470aefad98262",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 75051413bfb5e6e01ed8e41c98505ce592e8d81c Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7992) 
   * afc2f676cd198fd6fbba9e66c27470aefad98262 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8006) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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


[GitHub] [hudi] hudi-bot commented on pull request #5294: [HUDI-3838] Implemented drop partition column feature for delta streamer code path

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #5294:
URL: https://github.com/apache/hudi/pull/5294#issuecomment-1096333606

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "75051413bfb5e6e01ed8e41c98505ce592e8d81c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7992",
       "triggerID" : "75051413bfb5e6e01ed8e41c98505ce592e8d81c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "afc2f676cd198fd6fbba9e66c27470aefad98262",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8006",
       "triggerID" : "afc2f676cd198fd6fbba9e66c27470aefad98262",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a6f16be43b9125cbf3155917096ad5b604822b42",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "a6f16be43b9125cbf3155917096ad5b604822b42",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * afc2f676cd198fd6fbba9e66c27470aefad98262 Azure: [CANCELED](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8006) 
   * a6f16be43b9125cbf3155917096ad5b604822b42 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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


[GitHub] [hudi] hudi-bot commented on pull request #5294: [HUDI-3838] Implemented drop partition column feature for delta streamer code path

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #5294:
URL: https://github.com/apache/hudi/pull/5294#issuecomment-1096392035

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a6f16be43b9125cbf3155917096ad5b604822b42",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "a6f16be43b9125cbf3155917096ad5b604822b42",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a6f16be43b9125cbf3155917096ad5b604822b42",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "1096376778",
       "triggerType" : "MANUAL"
     } ]
   }-->
   ## CI report:
   
   * a6f16be43b9125cbf3155917096ad5b604822b42 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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


[GitHub] [hudi] hudi-bot commented on pull request #5294: [HUDI-3838] Implemented drop partition column feature for delta streamer code path

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #5294:
URL: https://github.com/apache/hudi/pull/5294#issuecomment-1096576675

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a6f16be43b9125cbf3155917096ad5b604822b42",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8010",
       "triggerID" : "a6f16be43b9125cbf3155917096ad5b604822b42",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a6f16be43b9125cbf3155917096ad5b604822b42",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8010",
       "triggerID" : "1096376778",
       "triggerType" : "MANUAL"
     }, {
       "hash" : "e9164c1494191fb50af7814db9810b3afaf25ac4",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "e9164c1494191fb50af7814db9810b3afaf25ac4",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a6f16be43b9125cbf3155917096ad5b604822b42 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8010) 
   * e9164c1494191fb50af7814db9810b3afaf25ac4 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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


[GitHub] [hudi] vingov commented on a diff in pull request #5294: [HUDI-3838] Implemented drop partition column feature for delta streamer code path

Posted by GitBox <gi...@apache.org>.
vingov commented on code in PR #5294:
URL: https://github.com/apache/hudi/pull/5294#discussion_r847963257


##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/deltastreamer/DeltaSync.java:
##########
@@ -477,14 +479,19 @@ private Pair<SchemaProvider, Pair<String, JavaRDD<HoodieRecord>>> fetchFromSourc
     }
 
     boolean shouldCombine = cfg.filterDupes || cfg.operation.equals(WriteOperationType.UPSERT);
+    boolean isDropPartitionColumns = props.getBoolean(DROP_PARTITION_COLUMNS.key());
+    String partitionColumns = HoodieSparkUtils.getPartitionColumns(keyGenerator, props);
+    List<String> listOfPartitionColumns = Arrays.asList(partitionColumns.split(","));

Review Comment:
   Good question, It would be an empty list, I've added a UT for a non-partitioned table.



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


[GitHub] [hudi] vingov commented on a diff in pull request #5294: [HUDI-3838] Implemented drop partition column feature for delta streamer code path

Posted by GitBox <gi...@apache.org>.
vingov commented on code in PR #5294:
URL: https://github.com/apache/hudi/pull/5294#discussion_r848111719


##########
hudi-common/src/test/java/org/apache/hudi/avro/TestHoodieAvroUtils.java:
##########
@@ -227,6 +228,20 @@ public void testAddingAndRemovingMetadataFields() {
     assertEquals(NUM_FIELDS_IN_EXAMPLE_SCHEMA, schemaWithoutMetaCols.getFields().size());
   }
 
+  @Test
+  public void testRemoveFields() {
+    GenericRecord rec = new GenericData.Record(new Schema.Parser().parse(EXAMPLE_SCHEMA));
+    rec.put("_row_key", "key1");
+    rec.put("non_pii_col", "val1");
+    rec.put("pii_col", "val2");
+    rec.put("timestamp", 3.5);
+    GenericRecord rec1 = HoodieAvroUtils.removeFields(rec, Arrays.asList("pii_col"));
+    assertEquals("key1", rec1.get("_row_key"));
+    assertEquals("val1", rec1.get("non_pii_col"));
+    assertEquals(3.5, rec1.get("timestamp"));
+    assertNull(rec1.get("pii_col"));

Review Comment:
   good catch added more tests.



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


[GitHub] [hudi] hudi-bot commented on pull request #5294: [HUDI-3838] Implemented drop partition column feature for delta streamer code path

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #5294:
URL: https://github.com/apache/hudi/pull/5294#issuecomment-1096567211

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "a6f16be43b9125cbf3155917096ad5b604822b42",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8010",
       "triggerID" : "a6f16be43b9125cbf3155917096ad5b604822b42",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a6f16be43b9125cbf3155917096ad5b604822b42",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8010",
       "triggerID" : "1096376778",
       "triggerType" : "MANUAL"
     } ]
   }-->
   ## CI report:
   
   * a6f16be43b9125cbf3155917096ad5b604822b42 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8010) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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


[GitHub] [hudi] hudi-bot commented on pull request #5294: [HUDI-3838] Implemented drop partition column feature for delta streamer code path

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on PR #5294:
URL: https://github.com/apache/hudi/pull/5294#issuecomment-1096377769

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "75051413bfb5e6e01ed8e41c98505ce592e8d81c",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7992",
       "triggerID" : "75051413bfb5e6e01ed8e41c98505ce592e8d81c",
       "triggerType" : "PUSH"
     }, {
       "hash" : "afc2f676cd198fd6fbba9e66c27470aefad98262",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8006",
       "triggerID" : "afc2f676cd198fd6fbba9e66c27470aefad98262",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a6f16be43b9125cbf3155917096ad5b604822b42",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "a6f16be43b9125cbf3155917096ad5b604822b42",
       "triggerType" : "PUSH"
     }, {
       "hash" : "afc2f676cd198fd6fbba9e66c27470aefad98262",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8009",
       "triggerID" : "1096376778",
       "triggerType" : "MANUAL"
     } ]
   }-->
   ## CI report:
   
   * afc2f676cd198fd6fbba9e66c27470aefad98262 Azure: [CANCELED](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8006) Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=8009) 
   * a6f16be43b9125cbf3155917096ad5b604822b42 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


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


[GitHub] [hudi] codope commented on pull request #5294: [HUDI-3838] Implemented drop partition column feature for delta streamer code path

Posted by GitBox <gi...@apache.org>.
codope commented on PR #5294:
URL: https://github.com/apache/hudi/pull/5294#issuecomment-1096376778

   @hudi-bot run azure


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