cloud-fan commented on code in PR #45592:
URL: https://github.com/apache/spark/pull/45592#discussion_r1538478109


##########
sql/api/src/main/scala/org/apache/spark/sql/types/StringType.scala:
##########
@@ -29,25 +29,32 @@ import org.apache.spark.sql.catalyst.util.CollationFactory
 @Stable
 class StringType private(val collationId: Int) extends AtomicType with 
Serializable {
   /**
-   * Returns whether assigned collation is the default spark collation 
(UTF8_BINARY).
+   * Support for Binary Equality implies that strings are considered equal 
only if
+   * they are byte for byte equal. E.g. all accent or case-insensitive 
collations are considered
+   * non-binary. If this field is true, byte level operations can be used 
against this datatype
+   * (e.g. for equality and hashing).
    */
-  def isDefaultCollation: Boolean = collationId == 
CollationFactory.DEFAULT_COLLATION_ID
+  def supportsBinaryEquality: Boolean =
+    CollationFactory.fetchCollation(collationId).supportsBinaryEquality
+  def isUTF8BinaryLcaseCollation: Boolean =
+    collationId == CollationFactory.UTF8_BINARY_LCASE_COLLATION_ID
 
   /**
-   * Binary collation implies that strings are considered equal only if they 
are
-   * byte for byte equal. E.g. all accent or case-insensitive collations are 
considered non-binary.
-   * If this field is true, byte level operations can be used against this 
datatype (e.g. for
-   * equality and hashing).
+   * Support for Binary Ordering implies that strings are considered equal only

Review Comment:
   shall we mention ordering?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to