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



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/predicates.scala
##########
@@ -519,7 +520,9 @@ case class InSet(child: Expression, hset: Set[Any]) extends 
UnaryExpression with
 
   override def sql: String = {
     val valueSQL = child.sql
-    val listSQL = hset.toSeq.map(Literal(_).sql).mkString(", ")
+    val listSQL = hset.toSeq
+      .map(elem => Literal(convertToScala(elem, child.dataType)).sql)

Review comment:
       this converts the internal value to external value, and then 
`Literal.apply` converts external value to internal value.
   
   Can we just do `Literal(elem, child.dataType).sql`?




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



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

Reply via email to