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


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/CallMethodViaReflection.scala:
##########
@@ -55,64 +55,73 @@ import org.apache.spark.util.Utils
   """,
   since = "2.0.0",
   group = "misc_funcs")
-case class CallMethodViaReflection(children: Seq[Expression])
+case class CallMethodViaReflection(
+      children: Seq[Expression],
+      failOnError: Boolean = true)
   extends Nondeterministic
   with CodegenFallback
   with QueryErrorsBase {
 
+  def this(children: Seq[Expression]) =
+    this(children, true)
+
   override def prettyName: String = 
getTagValue(FunctionRegistry.FUNC_ALIAS).getOrElse("reflect")
 
   override def checkInputDataTypes(): TypeCheckResult = {
-    if (children.size < 2) {
-      throw QueryCompilationErrors.wrongNumArgsError(
-        toSQLId(prettyName), Seq("> 1"), children.length
-      )
+    if (!failOnError) {

Review Comment:
   I don't think this flag should change the analysis check. Look at the `lazy 
val`s in this expression, how can it work with less than 2 children?



-- 
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: [email protected]

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