maropu commented on a change in pull request #28106: [SPARK-31335][SQL] Add try 
function support
URL: https://github.com/apache/spark/pull/28106#discussion_r407872264
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala
 ##########
 @@ -198,3 +201,85 @@ case class TypeOf(child: Expression) extends 
UnaryExpression {
     defineCodeGen(ctx, ev, _ => 
s"""UTF8String.fromString(${child.dataType.catalogString})""")
   }
 }
+
+// scalastyle:off line.size.limit
+@ExpressionDescription(
+  usage = """
+    _FUNC_(expr) - Evaluate an expression and handle certain types of runtime 
exceptions by returning NULL.
+    In cases where it is preferable that queries produce NULL instead of 
failing when corrupt or invalid data is encountered, the TRY function may be 
useful, especially when ANSI mode is on and the users need null-tolerant on 
certain columns or outputs.
 
 Review comment:
   nit: "the TRY function" ->  "the `_FUNC_` function"?

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


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to