drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben-Zvi <...@git.apache.org>
Subject [GitHub] drill pull request #1057: DRILL-5993 Append Row Method For VectorContainer (...
Date Wed, 29 Nov 2017 22:33:30 GMT
Github user Ben-Zvi commented on a diff in the pull request:

    https://github.com/apache/drill/pull/1057#discussion_r153934729
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/record/VectorContainer.java
---
    @@ -353,6 +353,23 @@ public int getRecordCount() {
     
       public boolean hasRecordCount() { return recordCount != -1; }
     
    +  /**
    +   * This works with non-hyper {@link VectorContainer}s which have no selection vectors.
    +   * Appends a row taken from a source {@link VectorContainer} to this {@link VectorContainer}.
    +   * @param srcContainer The {@link VectorContainer} to copy a row from.
    +   * @param srcIndex The index of the row to copy from the source {@link VectorContainer}.
    +   */
    +  public void appendRow(VectorContainer srcContainer, int srcIndex) {
    +    for (int vectorIndex = 0; vectorIndex < wrappers.size(); vectorIndex++) {
    +      ValueVector destVector = wrappers.get(vectorIndex).getValueVector();
    +      ValueVector srcVector = srcContainer.wrappers.get(vectorIndex).getValueVector();
    +
    +      destVector.copyEntry(recordCount, srcVector, srcIndex);
    +    }
    +
    +    recordCount++;
    --- End diff --
    
     The immediate need for appendRow() is to distribute rows from a single incoming batch
into multiple other batches (for the Hash Join internal partitioning), based on the hash value
of the key columns at each row. This would not work well with the second suggestion (vectorizing
- column 1, column 2, etc.)  


---

Mime
View raw message