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 09209f0ff503 [SPARK-49775][SQL][FOLLOW-UP] Use SortedSet instead of 
Array with sorting
09209f0ff503 is described below

commit 09209f0ff503b29f9da92ba7db8aa820c03b3c0f
Author: Hyukjin Kwon <[email protected]>
AuthorDate: Wed Sep 25 07:57:08 2024 -0700

    [SPARK-49775][SQL][FOLLOW-UP] Use SortedSet instead of Array with sorting
    
    ### What changes were proposed in this pull request?
    
    This PR is a followup of https://github.com/apache/spark/pull/48235 that 
addresses https://github.com/apache/spark/pull/48235#discussion_r1775020195 
comment.
    
    ### Why are the changes needed?
    
    For better performance (in theory)
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    Existing tests should verify them
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    No.
    
    Closes #48245 from HyukjinKwon/SPARK-49775-followup.
    
    Authored-by: Hyukjin Kwon <[email protected]>
    Signed-off-by: Dongjoon Hyun <[email protected]>
---
 .../scala/org/apache/spark/sql/catalyst/util/CharsetProvider.scala    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/CharsetProvider.scala
 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/CharsetProvider.scala
index d85673f2ce81..f805d2ed87b5 100644
--- 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/CharsetProvider.scala
+++ 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/CharsetProvider.scala
@@ -18,13 +18,15 @@
  import java.nio.charset.{Charset, CharsetDecoder, CharsetEncoder, 
CodingErrorAction, IllegalCharsetNameException, UnsupportedCharsetException}
  import java.util.Locale
 
+ import scala.collection.SortedSet
+
  import org.apache.spark.sql.errors.QueryExecutionErrors
  import org.apache.spark.sql.internal.SQLConf
 
 private[sql] object CharsetProvider {
 
   final lazy val VALID_CHARSETS =
-    Array("us-ascii", "iso-8859-1", "utf-8", "utf-16be", "utf-16le", "utf-16", 
"utf-32").sorted
+    SortedSet("us-ascii", "iso-8859-1", "utf-8", "utf-16be", "utf-16le", 
"utf-16", "utf-32")
 
   def forName(
       charset: String,


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

Reply via email to