Github user nongli commented on the pull request:

    https://github.com/apache/spark/pull/11248#issuecomment-187445997
  
    Does it make sense to do something like this and remove the copies?
    
    ```
    /* 056 */   private void agg_doAggregateWithoutKey() throws 
java.io.IOException {
    /* 057 */     // initialize aggregation buffer
    /* 058 */
    /* 059 */     agg_bufIsNull = false;
    /* 060 */     agg_bufValue = 0L;
    /* 061 */
    
                  smj_left = leftIter.next();
                  smj_right = leftIter.next();
                  while (true) {
                    int comp = compare(smj_left, smj_right);
                    if (comp > 0) {
                      if (!leftIter.hasNext()) break;
                      smj_left = leftIter.next();
                    } else if (comp < 0) {
                      if (!rightIter.hasNext()) break;
                      rightIter = rightIter.next();
                    }
    
                    // Match
    /* 071 */         long smj_value5 = smj_isNull3 ? -1L : 
(smj_rightRow1.getLong(0));
    /* 072 */
    /* 073 */         if (false || !true) continue;
    /* 074 */         smj_metricValue.add(1);
    /* 075 */
    /* 076 */         // do aggregate
    /* 077 */         /* (input[0, bigint] + 1) */
    /* 078 */         long agg_value1 = -1L;
    /* 079 */         agg_value1 = agg_bufValue + 1L;
    /* 080 */         // update aggregation buffer
    /* 081 */         agg_bufIsNull = false;
    /* 082 */         agg_bufValue = agg_value1;
    /* 083 */
    
                    // Advance 1
                    if (!leftIter.hasNext()) break;
                    smj_left = leftIter.next();
                  }
    /* 088 */   }
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to