harshmotw-db commented on code in PR #50108:
URL: https://github.com/apache/spark/pull/50108#discussion_r1980130494


##########
sql/core/src/test/scala/org/apache/spark/sql/QueryTest.scala:
##########
@@ -326,7 +326,13 @@ object QueryTest extends Assertions {
     // For binary arrays, we convert it to Seq to avoid of calling 
java.util.Arrays.equals for
     // equality test.
     val converted: Seq[Row] = answer.map(prepareRow)
-    if (!isSorted) converted.sortBy(_.toString()) else converted
+    // SPARK-51349: "null" and null had the same precedence in sorting
+    if (!isSorted) converted.sortBy( r =>
+      Row(r.toSeq.map {
+        case null => (0, null)

Review Comment:
   Yeah, and we turn `__null_string__` to `__null_string_string__`, 
__null_string_string__` to `__null_string_string_string__` and so on. I think 
that would be logically complete.



##########
sql/core/src/test/scala/org/apache/spark/sql/QueryTest.scala:
##########
@@ -326,7 +326,13 @@ object QueryTest extends Assertions {
     // For binary arrays, we convert it to Seq to avoid of calling 
java.util.Arrays.equals for
     // equality test.
     val converted: Seq[Row] = answer.map(prepareRow)
-    if (!isSorted) converted.sortBy(_.toString()) else converted
+    // SPARK-51349: "null" and null had the same precedence in sorting
+    if (!isSorted) converted.sortBy( r =>
+      Row(r.toSeq.map {
+        case null => (0, null)

Review Comment:
   Yeah, and we turn `__null_string__` to `__null_string_string__`, 
`__null_string_string__` to `__null_string_string_string__` and so on. I think 
that would be logically complete.



-- 
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