You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by "zstan (via GitHub)" <gi...@apache.org> on 2023/05/25 18:59:03 UTC

[GitHub] [ignite-3] zstan commented on a diff in pull request #2101: IGNITE-19488 Sql. Rework statistics, reject hash index usage with enabled search bounds

zstan commented on code in PR #2101:
URL: https://github.com/apache/ignite-3/pull/2101#discussion_r1205901915


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/schema/IgniteTableImpl.java:
##########
@@ -617,21 +645,27 @@ private static <RowT> CompletableFuture<List<RowT>> handleInsertResults(
             RowHandler<RowT> handler,
             CompletableFuture<List<RowT>>[] futs
     ) {
+        updateStat.set(true);
+
         return CompletableFuture.allOf(futs)
                 .thenApply(response -> {
-                    List<String> conflictRows = new ArrayList<>();
+                    List<String> conflictRows = null;
 
                     for (CompletableFuture<List<RowT>> future : futs) {
                         List<RowT> values = future.join();
 
+                        if (conflictRows == null && values != null && !values.isEmpty()) {
+                            conflictRows = new ArrayList<>(values.size());
+                        }
+
                         if (values != null) {
                             for (RowT row : values) {
                                 conflictRows.add(handler.toString(row));
                             }
                         }
                     }
 
-                    if (!conflictRows.isEmpty()) {
+                    if (conflictRows != null && !conflictRows.isEmpty()) {

Review Comment:
   got it



-- 
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: notifications-unsubscribe@ignite.apache.org

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