You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2021/02/02 16:07:26 UTC

[GitHub] [spark] cloud-fan commented on a change in pull request #31438: [SPARK-34330][SQL] Literal's constructor support UTF8String

cloud-fan commented on a change in pull request #31438:
URL: https://github.com/apache/spark/pull/31438#discussion_r568725595



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/literals.scala
##########
@@ -62,6 +62,7 @@ object Literal {
     case b: Byte => Literal(b, ByteType)
     case s: Short => Literal(s, ShortType)
     case s: String => Literal(UTF8String.fromString(s), StringType)
+    case s: UTF8String => Literal(s, StringType)

Review comment:
       IIUC, `Literal.apply` is for external values. If you have internal values like `UTF8String`, you should use `Literal(value, dt)`.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org