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 2022/08/27 08:00:47 UTC

[GitHub] [spark] wangyum commented on a diff in pull request #37688: [SPARK-40243][DOCS] Enhance Hive UDF support documentation

wangyum commented on code in PR #37688:
URL: https://github.com/apache/spark/pull/37688#discussion_r956553540


##########
docs/sql-ref-functions-udf-hive.md:
##########
@@ -52,6 +52,18 @@ SELECT testUDF(value) FROM t;
 |           2.0|
 |           3.0|
 +--------------+
+
+-- Register `UDFSubstr` and use it in Spark SQL.
+-- Note that, it can achieve better performance if the return types and method parameters use Java primitives.
+-- e.g., UDFSubstr. The data processing method is UTF8String <-> Text <-> String. we can avoid UTF8String <-> Text. 

Review Comment:
   Example of how to rewrite UDF: 
   <img width="1681" alt="image" src="https://user-images.githubusercontent.com/5399861/187021044-ade75cb9-6f3e-40be-aac1-0cd6aab97d0b.png">
   



-- 
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: reviews-unsubscribe@spark.apache.org

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