uros-b commented on code in PR #56892:
URL: https://github.com/apache/spark/pull/56892#discussion_r3497374282


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/literals.scala:
##########
@@ -592,13 +592,16 @@ case class Literal (value: Any, dataType: DataType) 
extends LeafExpression {
   override def sql: String = (value, dataType) match {
     case (_, NullType | _: ArrayType | _: MapType | _: StructType) if value == 
null => "NULL"
     case _ if value == null => s"CAST(NULL AS ${dataType.sql})"
-    case (v: UTF8String, StringType) =>
-      // Escapes all backslashes and single quotes.
-      "'" + v.toString.replace("\\", "\\\\").replace("'", "\\'") + "'"
     case (v: UTF8String, st: StringType) =>

Review Comment:
   Nit: there's no direct unit assertion for the central behavior change: an 
explicit-UTF8_BINARY literal now rendering collate UTF8_BINARY (and the default 
singleton staying clause-free) is covered only indirectly via regenerated 
Connect goldens. A ~3-line LiteralExpressionSuite test pinning StringType 
singleton -> 'x', StringType("UTF8_BINARY") (non-eq) -> 'x' collate 
UTF8_BINARY, StringType("UTF8_LCASE") unchanged would lock in the regression 
guard cheaply.



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