This is an automated email from the ASF dual-hosted git repository.

bowenliang pushed a commit to branch branch-1.9
in repository https://gitbox.apache.org/repos/asf/kyuubi.git


The following commit(s) were added to refs/heads/branch-1.9 by this push:
     new 9225af5ee [KYUUBI #6661] Improve perf for column-based TRowSet 
generation
9225af5ee is described below

commit 9225af5ee3db85dd744b10c958ff2666bb895454
Author: hang.huang <[email protected]>
AuthorDate: Wed Sep 4 22:47:12 2024 +0800

    [KYUUBI #6661] Improve perf for column-based TRowSet generation
    
    # :mag: Description
    ## Issue References ๐Ÿ”—
    
    This pull request fixes #6661
    
    ## Describe Your Solution ๐Ÿ”ง
    
    TColumnGenerator.getColumnToList should not access to non-IndexedSeq with 
Seq.apply(i), which will cause performance reduce, convert it to foreach loop 
will be good. see https://issues.apache.org/jira/browse/SPARK-47085 for more 
details.
    
    ## Types of changes :bookmark:
    
    - [x] Bugfix (non-breaking change which fixes an issue)
    - [ ] New feature (non-breaking change which adds functionality)
    - [ ] Breaking change (fix or feature that would cause existing 
functionality to change)
    
    ## Test Plan ๐Ÿงช
    
    #### Behavior Without This Pull Request :coffin:
    
    #### Behavior With This Pull Request :tada:
    
    #### Related Unit Tests
    
    ---
    
    # Checklist ๐Ÿ“
    
    - [ ] This patch was not authored or co-authored using [Generative 
Tooling](https://www.apache.org/legal/generative-tooling.html)
    
    **Be nice. Be informative.**
    
    Closes #6662 from hh-cn/KYUUBI-6661.
    
    Closes #6661
    
    4597e88c1 [hang.huang] improve column-based TRowSet generation
    
    Authored-by: hang.huang <[email protected]>
    Signed-off-by: Bowen Liang <[email protected]>
    (cherry picked from commit 14e07ea24b38d8e38d4870b55fdbd669919f7fa7)
    Signed-off-by: Bowen Liang <[email protected]>
---
 .../main/scala/org/apache/kyuubi/engine/result/TColumnGenerator.scala  | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git 
a/kyuubi-common/src/main/scala/org/apache/kyuubi/engine/result/TColumnGenerator.scala
 
b/kyuubi-common/src/main/scala/org/apache/kyuubi/engine/result/TColumnGenerator.scala
index e2c8f1ea6..74b473c0d 100644
--- 
a/kyuubi-common/src/main/scala/org/apache/kyuubi/engine/result/TColumnGenerator.scala
+++ 
b/kyuubi-common/src/main/scala/org/apache/kyuubi/engine/result/TColumnGenerator.scala
@@ -34,8 +34,7 @@ trait TColumnGenerator[RowT] extends 
TRowSetColumnGetter[RowT] {
     val ret = new JArrayList[T](rowSize)
     val nulls = new JBitSet()
     var idx = 0
-    while (idx < rowSize) {
-      val row = rows(idx)
+    rows.foreach { row =>
       val isNull = isColumnNullAt(row, ordinal)
       if (isNull) {
         nulls.set(idx, true)

Reply via email to