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 2020/12/09 02:38:07 UTC

[GitHub] [spark] beliefer commented on a change in pull request #30479: [SPARK-33527][SQL] Extend the function of decode so as consistent with mainstream databases

beliefer commented on a change in pull request #30479:
URL: https://github.com/apache/spark/pull/30479#discussion_r538960499



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/stringExpressions.scala
##########
@@ -2082,6 +2082,64 @@ case class UnBase64(child: Expression)
   }
 }
 
+object Decode {
+  def createExpr(params: Seq[Expression]): Expression = {
+    params.length match {
+      case 0 => StringDecode(Literal.create(null, StringType), Literal.create(null, StringType))
+      case 1 => StringDecode(params.head, Literal.create(null, StringType))

Review comment:
       Let's preserve the `AnalysisException(s"Invalid number of arguments for function decode. ")`




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