Github user xuchuanyin commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1593#discussion_r155154423
  
    --- Diff: 
processing/src/main/java/org/apache/carbondata/processing/loading/row/CarbonRowBatch.java
 ---
    @@ -61,4 +61,19 @@ public CarbonRow next() throws NoSuchElementException {
       @Override public void remove() {
     
       }
    +
    +  /**
    +   * set current row, this can be used to set value for the RowBatch while 
iterating it
    +   * @param row
    +   */
    +  public void setCurrentRow(CarbonRow row) {
    +    rowBatch[index - 1] = row;
    --- End diff --
    
    When we interator the RowBatch, the internal `index` will increase by 1.
    
    Here, we firstly get the value by iterating and then reset the value, so 
the correct index should be `index-1`
    
    emm, it will be better to rename the method to `setPreviosRow`


---

Reply via email to