sunchao commented on a change in pull request #32082:
URL: https://github.com/apache/spark/pull/32082#discussion_r614231047



##########
File path: 
sql/catalyst/src/main/java/org/apache/spark/sql/connector/catalog/functions/ScalarFunction.java
##########
@@ -30,10 +30,71 @@
  * <p>
  * The JVM type of result values produced by this function must be the type 
used by Spark's
  * InternalRow API for the {@link DataType SQL data type} returned by {@link 
#resultType()}.
+ * <p>
+ * <b>IMPORTANT</b>: the default implementation of {@link #produceResult} 
throws
+ * {@link UnsupportedOperationException}. Users can choose to override this 
method, or implement
+ * a "magic method" with name {@link #MAGIC_METHOD_NAME} which takes 
individual parameters

Review comment:
       Sure, will update it. It currently says "If no direct method is found or 
when not using codegen, Spark will call produceResult" which is different from 
what this PR does, which always call the magic method if it's defined. Do you 
think it matters much?




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