cloud-fan commented on code in PR #49840:
URL: https://github.com/apache/spark/pull/49840#discussion_r1947410556


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/literals.scala:
##########
@@ -265,6 +267,15 @@ object Literal {
       s"Literal must have a corresponding value to ${dataType.catalogString}, 
" +
       s"but class ${Utils.getSimpleName(value.getClass)} found.")
   }
+
+  def fromSQL(sql: String): Expression = {
+    CatalystSqlParser.parseExpression(sql).transformUp {
+      case u: UnresolvedFunction =>
+          assert(u.nameParts.length == 1)
+          assert(!u.isDistinct)

Review Comment:
   can we check other fields in `UnresolvedFunction` as well? The SQL string 
produced by `Literal#sql` should not specify any extra fields



-- 
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: reviews-unsubscr...@spark.apache.org

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