You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "codope (via GitHub)" <gi...@apache.org> on 2023/02/16 16:16:57 UTC
[GitHub] [hudi] codope commented on a diff in pull request #7958: [HUDI-5799] Fix Spark partition validation in TestBulkInsertInternalPartitionerForRows
codope commented on code in PR #7958:
URL: https://github.com/apache/hudi/pull/7958#discussion_r1108713465
##########
hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/execution/bulkinsert/TestBulkInsertInternalPartitionerForRows.java:
##########
@@ -172,9 +173,14 @@ private void testBulkInsertInternalPartitioner(BulkInsertPartitioner partitioner
return;
}
Dataset<Row> actualRecords = (Dataset<Row>) partitioner.repartitionRecords(rows, numPartitions);
- assertEquals(
- enforceNumOutputPartitions ? numPartitions : rows.rdd().getNumPartitions(),
- actualRecords.rdd().getNumPartitions());
+ if (isGloballySorted) {
+ // For GLOBAL_SORT, `df.sort` may generate smaller number of partitions than the specified parallelism
+ assertTrue(actualRecords.rdd().getNumPartitions() <= numPartitions);
Review Comment:
would like to understand why this is the behavior. what's affecting the number of partitions? is it the size of data?
--
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