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

dongjoon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new f66274e92d1c [SPARK-47486][CONNECT] Remove unused private 
`ArrowDeserializers.getString` method
f66274e92d1c is described below

commit f66274e92d1ce6e65fecd45711da59eb08a9d296
Author: yangjie01 <yangji...@baidu.com>
AuthorDate: Wed Mar 20 15:10:49 2024 -0700

    [SPARK-47486][CONNECT] Remove unused private `ArrowDeserializers.getString` 
method
    
    ### What changes were proposed in this pull request?
    The private method `getString` in `ArrowDeserializers` is no longer used 
after SPARK-44449 | https://github.com/apache/spark/pull/42076, this pr removes 
it.
    
    ### Why are the changes needed?
    Code clean up.
    
    ### Does this PR introduce _any_ user-facing change?
    No
    
    ### How was this patch tested?
    Pass GitHub Actions
    
    ### Was this patch authored or co-authored using generative AI tooling?
    No
    
    Closes #45610 from LuciferYang/SPARK-47486.
    
    Authored-by: yangjie01 <yangji...@baidu.com>
    Signed-off-by: Dongjoon Hyun <dh...@apple.com>
---
 .../spark/sql/connect/client/arrow/ArrowDeserializer.scala  | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git 
a/connector/connect/common/src/main/scala/org/apache/spark/sql/connect/client/arrow/ArrowDeserializer.scala
 
b/connector/connect/common/src/main/scala/org/apache/spark/sql/connect/client/arrow/ArrowDeserializer.scala
index ac9619487f02..eaf2927863ec 100644
--- 
a/connector/connect/common/src/main/scala/org/apache/spark/sql/connect/client/arrow/ArrowDeserializer.scala
+++ 
b/connector/connect/common/src/main/scala/org/apache/spark/sql/connect/client/arrow/ArrowDeserializer.scala
@@ -29,10 +29,9 @@ import scala.collection.mutable
 import scala.reflect.ClassTag
 
 import org.apache.arrow.memory.BufferAllocator
-import org.apache.arrow.vector.{FieldVector, VarCharVector, VectorSchemaRoot}
+import org.apache.arrow.vector.{FieldVector, VectorSchemaRoot}
 import org.apache.arrow.vector.complex.{ListVector, MapVector, StructVector}
 import org.apache.arrow.vector.ipc.ArrowReader
-import org.apache.arrow.vector.util.Text
 
 import org.apache.spark.sql.catalyst.ScalaReflection
 import org.apache.spark.sql.catalyst.encoders.AgnosticEncoder
@@ -468,16 +467,6 @@ object ArrowDeserializers {
 
   private def isTuple(cls: Class[_]): Boolean = 
cls.getName.startsWith("scala.Tuple")
 
-  private def getString(v: VarCharVector, i: Int): String = {
-    // This is currently a bit heavy on allocations:
-    // - byte array created in VarCharVector.get
-    // - CharBuffer created CharSetEncoder
-    // - char array in String
-    // By using direct buffers and reusing the char buffer
-    // we could get rid of the first two allocations.
-    Text.decode(v.get(i))
-  }
-
   private def loadListIntoBuilder(
       v: ListVector,
       i: Int,


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to