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: [email protected]

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

Reply via email to