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/12/08 14:55:21 UTC

[GitHub] [hudi] codope opened a new pull request, #7411: [HUDI-5351] Handle populateMetaFields when repartitioning in sort partitioner

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

   ### Change Logs
   
   Handle populateMetaFields when repartitioning in bulk insert sort partitioners. Follow-up to #7402 
   
   Passes a boolean field to `BulkInsertPartitioner#repartitionRecords` and if meta field is not enabled then simply coalesces to the given output partitions.
   
   ### Impact
   
   Affects bulk insert sort modes.
   
   ### Risk level (write none, low medium or high below)
   
   medium
   
   ### Documentation Update
   
   _Describe any necessary documentation update if there is any new feature, config, or user-facing change_
   
   - _The config description must be updated if new configs are added or the default value of the configs are changed_
   - _Any new feature or user-facing change requires updating the Hudi website. Please create a Jira ticket, attach the
     ticket number here and follow the [instruction](https://hudi.apache.org/contribute/developer-setup#website) to make
     changes to the website._
   
   ### Contributor's checklist
   
   - [ ] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [ ] Change Logs and Impact were stated clearly
   - [ ] Adequate tests were added if applicable
   - [ ] CI passed
   


-- 
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 #7411: [HUDI-5351] Handle populateMetaFields when repartitioning in sort partitioner

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "3fad94fd7ce0dad24055a10180bd8d1e5e764089",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13557",
       "triggerID" : "3fad94fd7ce0dad24055a10180bd8d1e5e764089",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 3fad94fd7ce0dad24055a10180bd8d1e5e764089 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13557) 
   
   <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] alexeykudinkin commented on a diff in pull request #7411: [HUDI-5351] Handle populateMetaFields when repartitioning in sort partitioner

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


##########
hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/execution/bulkinsert/TestBulkInsertInternalPartitioner.java:
##########
@@ -126,35 +134,40 @@ private void testBulkInsertInternalPartitioner(BulkInsertPartitioner partitioner
                                                  boolean isGloballySorted,
                                                  boolean isLocallySorted,
                                                  Map<String, Long> expectedPartitionNumRecords,
-                                                 Option<Comparator<HoodieRecord<? extends HoodieRecordPayload>>> comparator) {
+                                                 Option<Comparator<HoodieRecord<? extends HoodieRecordPayload>>> comparator,
+                                                 boolean populateMetaFields) {
     int numPartitions = 2;
-    JavaRDD<HoodieRecord<? extends HoodieRecordPayload>> actualRecords =
-        (JavaRDD<HoodieRecord<? extends HoodieRecordPayload>>) partitioner.repartitionRecords(records, numPartitions);
-    assertEquals(
-        enforceNumOutputPartitions ? numPartitions : records.getNumPartitions(),
-        actualRecords.getNumPartitions());
-    List<HoodieRecord<? extends HoodieRecordPayload>> collectedActualRecords = actualRecords.collect();
-    if (isGloballySorted) {
-      // Verify global order
-      verifyRecordAscendingOrder(collectedActualRecords, comparator);
-    } else if (isLocallySorted) {
-      // Verify local order
-      actualRecords.mapPartitions(partition -> {
-        List<HoodieRecord<? extends HoodieRecordPayload>> partitionRecords = new ArrayList<>();
-        partition.forEachRemaining(partitionRecords::add);
-        verifyRecordAscendingOrder(partitionRecords, comparator);
-        return Collections.emptyList().iterator();
-      }).collect();
-    }
+    if (!populateMetaFields) {
+      assertThrows(IllegalStateException.class, () -> partitioner.repartitionRecords(records, numPartitions));

Review Comment:
   We can just return in here, there there would be no need to shift the block below



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/execution/bulkinsert/GlobalSortPartitionerWithRows.java:
##########
@@ -25,13 +25,22 @@
 import org.apache.spark.sql.Row;
 import org.apache.spark.sql.functions;
 
+import static org.apache.hudi.common.util.ValidationUtils.checkState;
+
 /**
  * A built-in partitioner that does global sorting for the input Rows across partitions after repartition for bulk insert operation, corresponding to the {@code BulkInsertSortMode.GLOBAL_SORT} mode.
  */
 public class GlobalSortPartitionerWithRows implements BulkInsertPartitioner<Dataset<Row>> {
 
+  private final boolean populateMetaFields;
+
+  public GlobalSortPartitionerWithRows(boolean populateMetaFields) {
+    this.populateMetaFields = populateMetaFields;
+  }
+
   @Override
   public Dataset<Row> repartitionRecords(Dataset<Row> rows, int outputSparkPartitions) {
+    checkState(populateMetaFields, "Meta fields are disabled!");

Review Comment:
   This exception is aimed at the user and should convey the full message for user to understand the misconfiguration. Let's refine it to be a little more hinting, like for ex: "Global Sort mode requires meta-fields to be enabled" (and also throw HoodieException)



##########
hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/execution/bulkinsert/TestBulkInsertInternalPartitionerForRows.java:
##########
@@ -146,37 +155,42 @@ private void testBulkInsertInternalPartitioner(BulkInsertPartitioner partitioner
                                                  boolean isGloballySorted,
                                                  boolean isLocallySorted,
                                                  Map<String, Long> expectedPartitionNumRecords,
-                                                 Option<Comparator<Row>> comparator) {
+                                                 Option<Comparator<Row>> comparator,
+                                                 boolean populateMetaFields) {
     int numPartitions = 2;
-    Dataset<Row> actualRecords = (Dataset<Row>) partitioner.repartitionRecords(rows, numPartitions);
-    assertEquals(
-        enforceNumOutputPartitions ? numPartitions : rows.rdd().getNumPartitions(),
-        actualRecords.rdd().getNumPartitions());
-
-    List<Row> collectedActualRecords = actualRecords.collectAsList();
-    if (isGloballySorted) {
-      // Verify global order
-      verifyRowsAscendingOrder(collectedActualRecords, comparator);
-    } else if (isLocallySorted) {
-      // Verify local order
-      actualRecords.mapPartitions((MapPartitionsFunction<Row, Object>) input -> {
-        List<Row> partitionRows = new ArrayList<>();
-        while (input.hasNext()) {
-          partitionRows.add(input.next());
-        }
-        verifyRowsAscendingOrder(partitionRows, comparator);
-        return Collections.emptyList().iterator();
-      }, SparkDatasetTestUtils.ENCODER);
-    }
+    if (!populateMetaFields) {
+      assertThrows(IllegalStateException.class, () -> partitioner.repartitionRecords(rows, numPartitions));

Review Comment:
   Same as above



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/execution/bulkinsert/GlobalSortPartitionerWithRows.java:
##########
@@ -25,13 +25,22 @@
 import org.apache.spark.sql.Row;
 import org.apache.spark.sql.functions;
 
+import static org.apache.hudi.common.util.ValidationUtils.checkState;
+
 /**
  * A built-in partitioner that does global sorting for the input Rows across partitions after repartition for bulk insert operation, corresponding to the {@code BulkInsertSortMode.GLOBAL_SORT} mode.
  */
 public class GlobalSortPartitionerWithRows implements BulkInsertPartitioner<Dataset<Row>> {
 
+  private final boolean populateMetaFields;
+
+  public GlobalSortPartitionerWithRows(boolean populateMetaFields) {
+    this.populateMetaFields = populateMetaFields;

Review Comment:
   nit: `shouldPopulateMetaFields`, otherwise this looks as a directive not a state 



-- 
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] alexeykudinkin commented on a diff in pull request #7411: [HUDI-5351] Handle populateMetaFields when repartitioning in sort partitioner

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


##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/execution/bulkinsert/GlobalSortPartitionerWithRows.java:
##########
@@ -31,11 +31,14 @@
 public class GlobalSortPartitionerWithRows implements BulkInsertPartitioner<Dataset<Row>> {
 
   @Override
-  public Dataset<Row> repartitionRecords(Dataset<Row> rows, int outputSparkPartitions) {
+  public Dataset<Row> repartitionRecords(Dataset<Row> rows, int outputSparkPartitions, boolean populateMetaFields) {
     // Now, sort the records and line them up nicely for loading.
     // Let's use "partitionPath + key" as the sort key.
-    return rows.sort(functions.col(HoodieRecord.PARTITION_PATH_METADATA_FIELD), functions.col(HoodieRecord.RECORD_KEY_METADATA_FIELD))
-        .coalesce(outputSparkPartitions);
+    if (populateMetaFields) {
+      return rows.sort(functions.col(HoodieRecord.PARTITION_PATH_METADATA_FIELD), functions.col(HoodieRecord.RECORD_KEY_METADATA_FIELD))
+          .coalesce(outputSparkPartitions);
+    }
+    return rows.coalesce(outputSparkPartitions);

Review Comment:
   @nsivabalan there's no conceptual reason for us not to support virtual-keys for any key-gen, right?
   I think we should actually do that if we claim to support virtual-keys (not immediately, but eventually)



-- 
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 #7411: [HUDI-5351] Handle populateMetaFields when repartitioning in sort partitioner

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "3fad94fd7ce0dad24055a10180bd8d1e5e764089",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13557",
       "triggerID" : "3fad94fd7ce0dad24055a10180bd8d1e5e764089",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c23281a1bd8194859546482b6853e66e9ec8eabf",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "c23281a1bd8194859546482b6853e66e9ec8eabf",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 3fad94fd7ce0dad24055a10180bd8d1e5e764089 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13557) 
   * c23281a1bd8194859546482b6853e66e9ec8eabf 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 #7411: [HUDI-5351] Handle populateMetaFields when repartitioning in sort partitioner

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "3fad94fd7ce0dad24055a10180bd8d1e5e764089",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13557",
       "triggerID" : "3fad94fd7ce0dad24055a10180bd8d1e5e764089",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c23281a1bd8194859546482b6853e66e9ec8eabf",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13636",
       "triggerID" : "c23281a1bd8194859546482b6853e66e9ec8eabf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f8700ed9b102695f5f6e428a248c7eae0071e4b9",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "f8700ed9b102695f5f6e428a248c7eae0071e4b9",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c23281a1bd8194859546482b6853e66e9ec8eabf Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13636) 
   * f8700ed9b102695f5f6e428a248c7eae0071e4b9 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 #7411: [HUDI-5351] Handle populateMetaFields when repartitioning in sort partitioner

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

   
   <img width="682" alt="Screenshot 2022-12-13 at 10 21 11 AM" src="https://user-images.githubusercontent.com/16440354/207229581-83e9c594-b690-44a9-8894-2df6791ae683.png">
   
   CI succeeded for the latest commit.


-- 
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 #7411: [HUDI-5351] Handle populateMetaFields when repartitioning in sort partitioner

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


##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/execution/bulkinsert/GlobalSortPartitionerWithRows.java:
##########
@@ -31,11 +31,14 @@
 public class GlobalSortPartitionerWithRows implements BulkInsertPartitioner<Dataset<Row>> {
 
   @Override
-  public Dataset<Row> repartitionRecords(Dataset<Row> rows, int outputSparkPartitions) {
+  public Dataset<Row> repartitionRecords(Dataset<Row> rows, int outputSparkPartitions, boolean populateMetaFields) {
     // Now, sort the records and line them up nicely for loading.
     // Let's use "partitionPath + key" as the sort key.
-    return rows.sort(functions.col(HoodieRecord.PARTITION_PATH_METADATA_FIELD), functions.col(HoodieRecord.RECORD_KEY_METADATA_FIELD))
-        .coalesce(outputSparkPartitions);
+    if (populateMetaFields) {

Review Comment:
   I kept consistent with the current master behavior. Makes sense to fail when sort mode is **not** NONE and meta fields are disabled.



-- 
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 #7411: [HUDI-5351] Handle populateMetaFields when repartitioning in sort partitioner

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "3fad94fd7ce0dad24055a10180bd8d1e5e764089",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "3fad94fd7ce0dad24055a10180bd8d1e5e764089",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 3fad94fd7ce0dad24055a10180bd8d1e5e764089 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 #7411: [HUDI-5351] Handle populateMetaFields when repartitioning in sort partitioner

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

   <img width="1387" alt="Screenshot 2022-12-12 at 8 16 51 PM" src="https://user-images.githubusercontent.com/16440354/207075292-31f356b6-4061-4278-9995-43a9b5ea9963.png">
   
   CI is green. The test that failed in the previous run is `testReleaseResource` which seems to be flaky. But, locally it did not fail even after running 50 times.


-- 
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 #7411: [HUDI-5351] Handle populateMetaFields when repartitioning in sort partitioner

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "3fad94fd7ce0dad24055a10180bd8d1e5e764089",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13557",
       "triggerID" : "3fad94fd7ce0dad24055a10180bd8d1e5e764089",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c23281a1bd8194859546482b6853e66e9ec8eabf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13636",
       "triggerID" : "c23281a1bd8194859546482b6853e66e9ec8eabf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f8700ed9b102695f5f6e428a248c7eae0071e4b9",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13653",
       "triggerID" : "f8700ed9b102695f5f6e428a248c7eae0071e4b9",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a2739c7a7cc5f6ebd38a4b1c4be46a7a652f1d38",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13656",
       "triggerID" : "a2739c7a7cc5f6ebd38a4b1c4be46a7a652f1d38",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * a2739c7a7cc5f6ebd38a4b1c4be46a7a652f1d38 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13656) 
   
   <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 #7411: [HUDI-5351] Handle populateMetaFields when repartitioning in sort partitioner

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "3fad94fd7ce0dad24055a10180bd8d1e5e764089",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13557",
       "triggerID" : "3fad94fd7ce0dad24055a10180bd8d1e5e764089",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 3fad94fd7ce0dad24055a10180bd8d1e5e764089 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13557) 
   
   <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 #7411: [HUDI-5351] Handle populateMetaFields when repartitioning in sort partitioner

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "3fad94fd7ce0dad24055a10180bd8d1e5e764089",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13557",
       "triggerID" : "3fad94fd7ce0dad24055a10180bd8d1e5e764089",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c23281a1bd8194859546482b6853e66e9ec8eabf",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13636",
       "triggerID" : "c23281a1bd8194859546482b6853e66e9ec8eabf",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c23281a1bd8194859546482b6853e66e9ec8eabf Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13636) 
   
   <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 #7411: [HUDI-5351] Handle populateMetaFields when repartitioning in sort partitioner

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "3fad94fd7ce0dad24055a10180bd8d1e5e764089",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13557",
       "triggerID" : "3fad94fd7ce0dad24055a10180bd8d1e5e764089",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c23281a1bd8194859546482b6853e66e9ec8eabf",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13636",
       "triggerID" : "c23281a1bd8194859546482b6853e66e9ec8eabf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f8700ed9b102695f5f6e428a248c7eae0071e4b9",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13653",
       "triggerID" : "f8700ed9b102695f5f6e428a248c7eae0071e4b9",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a2739c7a7cc5f6ebd38a4b1c4be46a7a652f1d38",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "a2739c7a7cc5f6ebd38a4b1c4be46a7a652f1d38",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c23281a1bd8194859546482b6853e66e9ec8eabf Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13636) 
   * f8700ed9b102695f5f6e428a248c7eae0071e4b9 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13653) 
   * a2739c7a7cc5f6ebd38a4b1c4be46a7a652f1d38 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 #7411: [HUDI-5351] Handle populateMetaFields when repartitioning in sort partitioner

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


-- 
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 #7411: [HUDI-5351] Handle populateMetaFields when repartitioning in sort partitioner

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


##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/execution/bulkinsert/GlobalSortPartitionerWithRows.java:
##########
@@ -31,11 +31,14 @@
 public class GlobalSortPartitionerWithRows implements BulkInsertPartitioner<Dataset<Row>> {
 
   @Override
-  public Dataset<Row> repartitionRecords(Dataset<Row> rows, int outputSparkPartitions) {
+  public Dataset<Row> repartitionRecords(Dataset<Row> rows, int outputSparkPartitions, boolean populateMetaFields) {
     // Now, sort the records and line them up nicely for loading.
     // Let's use "partitionPath + key" as the sort key.
-    return rows.sort(functions.col(HoodieRecord.PARTITION_PATH_METADATA_FIELD), functions.col(HoodieRecord.RECORD_KEY_METADATA_FIELD))
-        .coalesce(outputSparkPartitions);
+    if (populateMetaFields) {
+      return rows.sort(functions.col(HoodieRecord.PARTITION_PATH_METADATA_FIELD), functions.col(HoodieRecord.RECORD_KEY_METADATA_FIELD))
+          .coalesce(outputSparkPartitions);
+    }
+    return rows.coalesce(outputSparkPartitions);

Review Comment:
   virtual keys are supported only for 2 key gens. Simple and NonPartitioned Key gen. 
   So, we should be able to support sorting based on original columns instead of meta fields even when meta fields are disabled. 



-- 
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] alexeykudinkin commented on a diff in pull request #7411: [HUDI-5351] Handle populateMetaFields when repartitioning in sort partitioner

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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/BulkInsertPartitioner.java:
##########
@@ -38,7 +38,7 @@
    * @param outputPartitions Expected number of output partitions
    * @return
    */
-  I repartitionRecords(I records, int outputPartitions);
+  I repartitionRecords(I records, int outputPartitions, boolean populateMetaFields);

Review Comment:
   @codope we should pass this in ctor (we actually should be passing the HoodieWriteConfig to access whole config), rather than t/h the API



##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/execution/bulkinsert/GlobalSortPartitionerWithRows.java:
##########
@@ -31,11 +31,14 @@
 public class GlobalSortPartitionerWithRows implements BulkInsertPartitioner<Dataset<Row>> {
 
   @Override
-  public Dataset<Row> repartitionRecords(Dataset<Row> rows, int outputSparkPartitions) {
+  public Dataset<Row> repartitionRecords(Dataset<Row> rows, int outputSparkPartitions, boolean populateMetaFields) {
     // Now, sort the records and line them up nicely for loading.
     // Let's use "partitionPath + key" as the sort key.
-    return rows.sort(functions.col(HoodieRecord.PARTITION_PATH_METADATA_FIELD), functions.col(HoodieRecord.RECORD_KEY_METADATA_FIELD))
-        .coalesce(outputSparkPartitions);
+    if (populateMetaFields) {

Review Comment:
   
   A few notes:
   
    - We should actually properly support virtual-keys in here by instantiating the key-gen and applying it here
    - Current approach is actually obscuring the failure currently -- instead of failing, we'll let it go t/h but we'll breach the contract of the Partitioner by not sorting the rows actually. Instead, we should just fail outright in case meta-fields are disabled (as a stop-gap solution until we fully support virtual-keys).
   



-- 
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 #7411: [HUDI-5351] Handle populateMetaFields when repartitioning in sort partitioner

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "3fad94fd7ce0dad24055a10180bd8d1e5e764089",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13557",
       "triggerID" : "3fad94fd7ce0dad24055a10180bd8d1e5e764089",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c23281a1bd8194859546482b6853e66e9ec8eabf",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13636",
       "triggerID" : "c23281a1bd8194859546482b6853e66e9ec8eabf",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 3fad94fd7ce0dad24055a10180bd8d1e5e764089 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13557) 
   * c23281a1bd8194859546482b6853e66e9ec8eabf Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13636) 
   
   <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 #7411: [HUDI-5351] Handle populateMetaFields when repartitioning in sort partitioner

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "3fad94fd7ce0dad24055a10180bd8d1e5e764089",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13557",
       "triggerID" : "3fad94fd7ce0dad24055a10180bd8d1e5e764089",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c23281a1bd8194859546482b6853e66e9ec8eabf",
       "status" : "FAILURE",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13636",
       "triggerID" : "c23281a1bd8194859546482b6853e66e9ec8eabf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f8700ed9b102695f5f6e428a248c7eae0071e4b9",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13653",
       "triggerID" : "f8700ed9b102695f5f6e428a248c7eae0071e4b9",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * c23281a1bd8194859546482b6853e66e9ec8eabf Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13636) 
   * f8700ed9b102695f5f6e428a248c7eae0071e4b9 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13653) 
   
   <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 #7411: [HUDI-5351] Handle populateMetaFields when repartitioning in sort partitioner

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "3fad94fd7ce0dad24055a10180bd8d1e5e764089",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13557",
       "triggerID" : "3fad94fd7ce0dad24055a10180bd8d1e5e764089",
       "triggerType" : "PUSH"
     }, {
       "hash" : "c23281a1bd8194859546482b6853e66e9ec8eabf",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13636",
       "triggerID" : "c23281a1bd8194859546482b6853e66e9ec8eabf",
       "triggerType" : "PUSH"
     }, {
       "hash" : "f8700ed9b102695f5f6e428a248c7eae0071e4b9",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13653",
       "triggerID" : "f8700ed9b102695f5f6e428a248c7eae0071e4b9",
       "triggerType" : "PUSH"
     }, {
       "hash" : "a2739c7a7cc5f6ebd38a4b1c4be46a7a652f1d38",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13656",
       "triggerID" : "a2739c7a7cc5f6ebd38a4b1c4be46a7a652f1d38",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * f8700ed9b102695f5f6e428a248c7eae0071e4b9 Azure: [CANCELED](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13653) 
   * a2739c7a7cc5f6ebd38a4b1c4be46a7a652f1d38 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=13656) 
   
   <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