stevenzwu commented on code in PR #10823:
URL: https://github.com/apache/iceberg/pull/10823#discussion_r1698759921
##########
flink/v1.19/flink/src/test/java/org/apache/iceberg/flink/sink/shuffle/TestSketchUtil.java:
##########
@@ -130,4 +133,111 @@ public void testRangeBoundsSkipDuplicates() {
// skipped duplicate c's
.containsExactly(CHAR_KEYS.get("c"), CHAR_KEYS.get("g"),
CHAR_KEYS.get("j"));
}
+
+ @ParameterizedTest
+ @ValueSource(ints = {4, 6})
+ public void testPartitioningAndScaleUp(int numPartitions) {
+ // calculated based on 4 partitions
+ SortKey[] rangeBounds =
+ new SortKey[] {CHAR_KEYS.get("c"), CHAR_KEYS.get("j"),
CHAR_KEYS.get("m")};
+
+ // <= c
+ assertThat(
Review Comment:
there are some duplications. but I think those two tests are different:
scale up and scale down. I want to explicitly test each range.
The scale down case has this differently.
```
// > m
// reassigns out-of-range partitions via mod (% 3 in this case)
assertThat(
SketchUtil.partition(
CHAR_KEYS.get("n"), numPartitions, rangeBounds,
SORT_ORDER_COMPARTOR))
.isEqualTo(0);
assertThat(
SketchUtil.partition(
CHAR_KEYS.get("z"), numPartitions, rangeBounds,
SORT_ORDER_COMPARTOR))
.isEqualTo(0);
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]