dbatomic commented on code in PR #45290:
URL: https://github.com/apache/spark/pull/45290#discussion_r1507736504


##########
sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.java:
##########
@@ -95,6 +96,20 @@ public static boolean isMutable(DataType dt) {
       pdt instanceof PhysicalCalendarIntervalType;
   }
 
+  /**
+   * True if comparisons, equality and hashing can be done purely on binary 
representation of
+   * Unsafe row. i.e. binary(e1) = binary(e2) <=> e1 = e2.
+   * e.g. this is not true for non-binary collations (any case/accent 
insensitive collation
+   * can lead to rows being semantically equal even though their binary 
representations differ).
+   */
+  public static boolean isBinaryStable(DataType dt) {
+    if (dt instanceof StringType st) {

Review Comment:
   done. I also moved method to `UnsafeRowUtils`. It feels a bit more natural 
to do this kind of checks in scala.



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to