rdblue commented on a change in pull request #117: Sorts bin packing by weights 
in descending order
URL: https://github.com/apache/incubator-iceberg/pull/117#discussion_r266533959
 
 

 ##########
 File path: core/src/test/java/com/netflix/iceberg/util/TestBinPacking.java
 ##########
 @@ -162,14 +162,30 @@ public void testBinPackingLookBack() {
     // 6. [5, 1]
     Assert.assertEquals("1 bin look-back: should merge ones with fives",
         l(l(5, 1), l(5, 1), l(5, 1)), pack(l(5, 1, 5, 1, 5, 1), 8, 1));
+
+    Assert.assertEquals("2 bin look-back: should merge all ones with five when 
expensiveTaskFirst is enabled",
+        l(l(5, 1, 1, 1), l(5, 5)), pack(l(5, 1, 5, 1, 5, 1), 10, 2, true));
+
+    Assert.assertEquals("2 bin look-back: should merge until targetWeight when 
expensiveTaskFirst is enabled",
+        l(l(36, 36, 36), l(128), l(36, 65), l(65)),
+        pack(l(36, 36, 36, 36, 65, 65, 128), 128, 2, true));
+
+    Assert.assertEquals(
+        "1 bin look-back: should order by weight descending and not order by 
number of items (at same weight)",
 
 Review comment:
   I don't think this description makes sense. The only reason why there is an 
order is that the values appear in that order. You could reverse this and get 
the reverse order. I think that this should mix the order to be a better test: 
`l(64, 64, 128, 32, 32, 32, 32)`

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to