cloud-fan commented on a change in pull request #31336:
URL: https://github.com/apache/spark/pull/31336#discussion_r564335378
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/CharVarcharTestSuite.scala
##########
@@ -443,7 +460,29 @@ trait CharVarcharTestSuite extends QueryTest with
SQLTestUtils {
("c1 IN ('a', 'b')", true),
("c1 = c2", true),
("c1 < c2", false),
- ("c1 IN (c2)", true)))
+ ("c1 IN (c2)", true),
+ ("c1 <=> null", false)))
+ }
+ }
+
+ private def testNullConditions(df: DataFrame, conditions: Seq[String]): Unit
= {
+ conditions.foreach { cond =>
+ checkAnswer(df.selectExpr(cond), Row(null))
+ }
+ }
+
+ test("SPARK-34233: char type comparison with null values") {
+ val conditions = Seq("c1 = null", "c1 IN ('e', null)", "c1 IN (null)")
+ withTable("t") {
+ sql(s"CREATE TABLE t(c1 CHAR(2), c2 CHAR(5)) USING $format")
Review comment:
why do we need the `c2` column while all the conditions only refer to
`c1`?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]