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


##########
sql/core/src/test/scala/org/apache/spark/sql/CharVarcharTestSuite.scala:
##########
@@ -508,6 +508,80 @@ trait CharVarcharTestSuite extends QueryTest {
     }
   }
 
+  test("SPARK-59278: char type IN list with a NULL ahead of the matching 
literal") {
+    // A NULL element must not shift the literals that follow it. `c IN (null, 
'a')` is TRUE
+    // because one of the comparisons is TRUE, and NULL OR TRUE is TRUE. Both 
spellings of NULL
+    // are covered: an untyped NULL makes InConversion coerce every element of 
the IN, while a

Review Comment:
   **Nit (P3):** `castIfNotSameType` does not coerce every operand here: `c` 
and `'a'` are already `StringType`, so only the untyped `NULL` gets cast. 
Please update this explanation to say that the untyped form invokes 
`InConversion`, while the pre-typed `STRING` NULL needs no coercion; the 
CHAR-backed value stays unchanged in both cases.



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