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


##########
flink-connector-hbase-2.2/src/test/java/org/apache/flink/connector/hbase2/HBaseConnectorITCase.java:
##########
@@ -384,11 +383,13 @@ public void testTableSourceSinkWithDDL() throws Exception 
{
 
         TableResult tableResult3 = batchEnv.executeSql(query);
 
-        List<String> result =
-                Lists.newArrayList(tableResult3.collect()).stream()
-                        .map(Row::toString)
-                        .sorted()
-                        .collect(Collectors.toList());
+        List<String> result = new ArrayList<>();
+        for (CloseableIterator<Row> it = tableResult3.collect(); it.hasNext(); 
) {
+            Row row = it.next();
+            result.add(row.toString());
+        }
+        Collections.sort(result);
+        result = new ArrayList<>(result);

Review Comment:
   @ferenc-csaky sorry, may be i was not clear enough
   my idea was  that since current code (before this PR) is
   ```java
           List<String> result =
                   Lists.newArrayList(collected).stream()
                           .map(Row::toString)
                           .sorted()
                           .collect(Collectors.toList());
   ```
   then we can just replace this part `Lists.newArrayList(collected)` with 
`StreamSupport.stream(
                           Spliterators.spliteratorUnknownSize(collected, 
Spliterator.ORDERED),
                                   false)`
   and leave the rest untouched instead of introducing a number of loops. This 
will allow to minimize amount of changes



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