marin-ma commented on code in PR #13105:
URL: https://github.com/apache/gluten/pull/13105#discussion_r4103239776


##########
backends-velox/src/main/scala/org/apache/spark/sql/expression/UDFResolver.scala:
##########
@@ -386,14 +430,80 @@ object UDFResolver extends Logging {
     }
   }
 
+  // Velox types carry no nullability, so it is not part of the question being 
asked here.
+  private def encodeArgTypes(argTypes: Seq[DataType]): Array[Byte] = {
+    val argTypeNodes = argTypes.map(t => ConverterUtils.getTypeNode(t, 
nullable = true))
+    TypeBuilder.makeStruct(false, argTypeNodes.asJava).toProtobuf.toByteArray
+  }
+
+  private def logNoBind(name: String, argTypes: Seq[DataType]): Unit =
+    logDebug(
+      s"No Velox signature of $name binds to 
${argTypes.map(_.simpleString).mkString(", ")}.")
+
+  /**
+   * Resolves the return type of a scalar call by binding 'argTypes' against 
the signatures the
+   * library registered with Velox for 'name'. Returns None if nothing binds.
+   *
+   * Binding is exact: no cast is injected to make a call fit. Velox does not 
support coercion for
+   * signatures carrying type variables, and where one is in play "cast the 
arguments until they
+   * bind" has too many answers to pick from.
+   */
+  private def resolveUdfFromRegistry(

Review Comment:
   Should we catch any exceptions thrown from `resolveUdfFromRegistry` and 
re-throw `GlutenNotSupportException` to allow fallback? Same for 
`resolveUdafFromRegistry`



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