HyukjinKwon commented on code in PR #49555:
URL: https://github.com/apache/spark/pull/49555#discussion_r1921668160
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/connector/expressions/expressions.scala:
##########
@@ -388,12 +388,13 @@ private[sql] object HoursTransform {
}
private[sql] final case class LiteralValue[T](value: T, dataType: DataType)
extends Literal[T] {
- override def toString: String = {
- if (dataType.isInstanceOf[StringType]) {
- s"'${StringUtils.replace(s"$value", "'", "''")}'"
- } else {
- s"$value"
- }
+ override def toString: String = dataType match {
+ case StringType => s"'${StringUtils.replace(s"$value", "'", "''")}'"
+ case BinaryType =>
Review Comment:
From a cursory look, it seems so but would be great to check if this
complies ANSI, and mention it in PR description.
--
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]