snuyanzin commented on code in PR #27:
URL: 
https://github.com/apache/flink-connector-hbase/pull/27#discussion_r1356563142


##########
flink-connector-hbase-2.2/src/test/java/org/apache/flink/connector/hbase2/HBaseConnectorITCase.java:
##########
@@ -469,11 +470,13 @@ private void verifyHBaseLookupJoin(boolean async) {
                         + TEST_TABLE_1
                         + " FOR SYSTEM_TIME AS OF src.proc as h ON src.a = 
h.rowkey";
         Iterator<Row> collected = tEnv.executeSql(dimJoinQuery).collect();
-        List<String> result =
-                Lists.newArrayList(collected).stream()
-                        .map(Row::toString)
-                        .sorted()
-                        .collect(Collectors.toList());
+        List<String> result = new ArrayList<>();
+        for (Iterator<Row> it = collected; it.hasNext(); ) {
+            Row row = it.next();
+            result.add(row.toString());
+        }
+        Collections.sort(result);
+        result = new ArrayList<>(result);

Review Comment:
   I think there is no need for a new arrayList, we can just reuse `result`
   
   And similar thoughts about `StreamSupport`
   
   ```suggestion
           List<String> result =
                   StreamSupport.stream(
                           Spliterators.spliteratorUnknownSize(collected, 
Spliterator.ORDERED),
                                   false)
                           .map(Row::toString)
                           .sorted()
                           .collect(Collectors.toList());
   ```
   



-- 
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