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



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/datetimeExpressions.scala
##########
@@ -2221,8 +2213,11 @@ case class Extract(field: Expression, source: 
Expression, child: Expression)
   }
 
   override def flatArguments: Iterator[Any] = Iterator(field, source)
-  override def sql: String = s"$prettyName(${field.sql} FROM ${source.sql})"
-  override def prettyName: String = "extract"
+  override def exprsReplaced: Seq[Expression] = Seq(field, source)
+
+  override def sql: String = super.sql.replace(", ", " FROM ")

Review comment:
       this is tricky and hard to read, can we just generate the sql string?




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