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

gurwls223 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 44a84dd507ac [SPARK-47410][SQL][FOLLOWUP] Limit part of StringType API 
to private[sql]
44a84dd507ac is described below

commit 44a84dd507aca6d2acbb4418e2bb578ef6070221
Author: Uros Bojanic <[email protected]>
AuthorDate: Fri Aug 9 10:22:50 2024 +0900

    [SPARK-47410][SQL][FOLLOWUP] Limit part of StringType API to private[sql]
    
    ### What changes were proposed in this pull request?
    Limit `supportsBinaryEquality`, `supportsLowercaseEquality`, etc. to 
`private[sql]`.
    
    ### Why are the changes needed?
    Methods such as `supportsBinaryEquality`, `supportsLowercaseEquality`, etc. 
should only be used internally.
    
    ### Does this PR introduce _any_ user-facing change?
    Yes, users should no longer be able to access certain StringType fields.
    
    ### How was this patch tested?
    N/A
    
    ### Was this patch authored or co-authored using generative AI tooling?
    No.
    
    Closes #47671 from uros-db/private-sql.
    
    Authored-by: Uros Bojanic <[email protected]>
    Signed-off-by: Hyukjin Kwon <[email protected]>
---
 .../src/main/scala/org/apache/spark/sql/types/StringType.scala | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/sql/api/src/main/scala/org/apache/spark/sql/types/StringType.scala 
b/sql/api/src/main/scala/org/apache/spark/sql/types/StringType.scala
index 383c58210d8b..df77f091f41f 100644
--- a/sql/api/src/main/scala/org/apache/spark/sql/types/StringType.scala
+++ b/sql/api/src/main/scala/org/apache/spark/sql/types/StringType.scala
@@ -36,16 +36,16 @@ class StringType private(val collationId: Int) extends 
AtomicType with Serializa
    * non-binary. If this field is true, byte level operations can be used 
against this datatype
    * (e.g. for equality and hashing).
    */
-  def supportsBinaryEquality: Boolean =
+  private[sql] def supportsBinaryEquality: Boolean =
     CollationFactory.fetchCollation(collationId).supportsBinaryEquality
 
-  def supportsLowercaseEquality: Boolean =
+  private[sql] def supportsLowercaseEquality: Boolean =
     CollationFactory.fetchCollation(collationId).supportsLowercaseEquality
 
-  def isUTF8BinaryCollation: Boolean =
+  private[sql] def isUTF8BinaryCollation: Boolean =
     collationId == CollationFactory.UTF8_BINARY_COLLATION_ID
 
-  def isUTF8LcaseCollation: Boolean =
+  private[sql] def isUTF8LcaseCollation: Boolean =
     collationId == CollationFactory.UTF8_LCASE_COLLATION_ID
 
   /**
@@ -55,7 +55,7 @@ class StringType private(val collationId: Int) extends 
AtomicType with Serializa
    * it follows spark internal implementation. If this field is true, byte 
level operations
    * can be used against this datatype (e.g. for equality, hashing and 
ordering).
    */
-  def supportsBinaryOrdering: Boolean =
+  private[sql] def supportsBinaryOrdering: Boolean =
     CollationFactory.fetchCollation(collationId).supportsBinaryOrdering
 
   /**


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

Reply via email to