You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2023/01/08 23:14:35 UTC

[GitHub] [hive] cnauroth commented on a diff in pull request #3735: HIVE-26710: Test `testThriftSetObjectInspector` is a flaky test

cnauroth commented on code in PR #3735:
URL: https://github.com/apache/hive/pull/3735#discussion_r1064216233


##########
serde/src/test/org/apache/hadoop/hive/serde2/objectinspector/TestThriftObjectInspectors.java:
##########
@@ -150,6 +152,11 @@ public void testThriftSetObjectInspector() throws Throwable {
       assertEquals(Category.STRUCT, oi1.getCategory());
       StructObjectInspector soi = (StructObjectInspector) oi1;
       List<? extends StructField> fields = soi.getAllStructFieldRefs();
+      Collections.sort(fields, new Comparator<StructField>() {

Review Comment:
   The `Comparator` anonymous inner class could be shortened to `Comparator.comparing(StructField::getFieldName)`.



##########
serde/src/test/org/apache/hadoop/hive/serde2/objectinspector/TestThriftObjectInspectors.java:
##########
@@ -176,6 +183,11 @@ public void testThriftSetObjectInspector() throws Throwable {
       assertEquals("setString", soi.getStructFieldData(s, fields.get(1)));
 
       // sub fields
+      Collections.sort(fields, new Comparator<StructField>() {

Review Comment:
   Similarly, this could be shortened to `Comparator.comparing(StructField::getFieldObjectInspector`.
   
   However, I'm also not clear why it would need to be resorted by a different key for the next assertions.



-- 
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: gitbox-unsubscribe@hive.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org