wangyum opened a new pull request #28883:
URL: https://github.com/apache/spark/pull/28883


   ### What changes were proposed in this pull request?
   
   This pr add Support `UTF8String` literals.
   
   
   ### Why are the changes needed?
   
   To fix `Unsupported literal type` for the following use case:
   
   ```scala
   val min = spark.sql("select min(concat('a', id)) from 
range(10)").queryExecution.executedPlan.executeCollect().head
   assert(Literal(min.get(0, StringType)) === Literal("a0"))
   ```
   
   ```
   Unsupported literal type class org.apache.spark.unsafe.types.UTF8String a0
   java.lang.RuntimeException: Unsupported literal type class 
org.apache.spark.unsafe.types.UTF8String a0
        at 
org.apache.spark.sql.catalyst.expressions.Literal$.apply(literals.scala:89)
   ```
   
   
   ### Does this PR introduce _any_ user-facing change?
   No.
   
   
   ### How was this patch tested?
   Unit test.
   


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

Reply via email to