lowka commented on code in PR #2443:
URL: https://github.com/apache/ignite-3/pull/2443#discussion_r1298582244


##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/rel/AbstractSetOpNode.java:
##########
@@ -305,40 +314,29 @@ protected List<RowT> getOnMapper(int cnt) {
             return res;
         }
 
-        protected List<RowT> getOnSingleOrReducer(int cnt) {
+        private List<RowT> getResultRows(int cnt) {
             Iterator<Map.Entry<GroupKey, int[]>> it = 
groups.entrySet().iterator();
-
             List<RowT> res = new ArrayList<>(cnt);
 
             while (it.hasNext() && cnt > 0) {
                 Map.Entry<GroupKey, int[]> entry = it.next();
-
-                GroupKey key = entry.getKey();
-
-                Object[] fields = new Object[key.fieldsCount()];
-
-                for (int i = 0; i < fields.length; i++) {
-                    fields[i] = key.field(i);
-                }
-
-                RowT row = rowFactory.create(fields);
-
-                int[] cntrs = entry.getValue();
-
+                RowT row = createOutputRow(entry);
                 int availableRows = availableRows(entry.getValue());
 
+                updateAvailableRows(entry.getValue(), availableRows);
+
                 if (availableRows <= cnt) {
                     it.remove();
 
-                    if (availableRows == 0) {
-                        continue;
-                    }
-
                     cnt -= availableRows;
                 } else {
                     availableRows = cnt;
 
-                    decrementAvailableRows(cntrs, availableRows);
+                    assert availableRows > 0;
+                    assert all : "This branch should only be accessible for 
non distinct variant of a set operator";
+
+                    int[] cntrs = entry.getValue();
+                    cntrs[0] -= availableRows;

Review Comment:
   Fixed.



##########
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/rel/set/IgniteColocatedIntersect.java:
##########
@@ -30,6 +30,14 @@
  * Physical node for INTERSECT operator which inputs are colocated.
  */
 public class IgniteColocatedIntersect extends IgniteIntersect implements 
IgniteColocatedSetOp {
+    /**
+     * Constructor.
+     *
+     * @param cluster   Cluster that this relational expression belongs to.
+     * @param traitSet    The traits of this rel.

Review Comment:
   Fixed.



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