This is an automated email from the ASF dual-hosted git repository.

ulyssesyou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-gluten.git


The following commit(s) were added to refs/heads/main by this push:
     new acf3e6de2 [VL][DOC] Update udf doc (#5814)
acf3e6de2 is described below

commit acf3e6de24cf7b858d2a3b4f9f7e93824d4f4c86
Author: Rong Ma <[email protected]>
AuthorDate: Tue May 21 11:01:36 2024 +0800

    [VL][DOC] Update udf doc (#5814)
    
    Update the compile command for build native udf library.
---
 docs/developers/VeloxNativeUDF.md | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/docs/developers/VeloxNativeUDF.md 
b/docs/developers/VeloxNativeUDF.md
index 13e0a97d1..b95190593 100644
--- a/docs/developers/VeloxNativeUDF.md
+++ b/docs/developers/VeloxNativeUDF.md
@@ -137,7 +137,16 @@ You can also specify the local or HDFS URIs to the UDF 
libraries or archives. Lo
 ## Try the example
 
 We provided Velox UDF examples in file 
[MyUDF.cc](../../cpp/velox/udf/examples/MyUDF.cc) and UDAF examples in file 
[MyUDAF.cc](../../cpp/velox/udf/examples/MyUDAF.cc).
-After building gluten cpp, you can find the example libraries at 
/path/to/gluten/cpp/build/velox/udf/examples/
+You need to build the gluten cpp project with `--build_example=ON` to get the 
example libraries.
+
+```shell
+## compile Gluten cpp module
+cd /path/to/gluten/cpp
+## if you use custom velox_home, make sure specified here by --velox_home
+./compile.sh --build_velox_backend=ON --build_examples=ON
+```
+
+Then, you can find the example libraries at 
/path/to/gluten/cpp/build/velox/udf/examples/
 
 Start spark-shell or spark-sql with below configuration
 
@@ -157,16 +166,16 @@ or
 Run query. The functions `myudf1` and `myudf2` increment the input value by a 
constant of 5
 
 ```
-select myudf1(1), myudf2(100L)
+select myudf1(100L), myudf2(1)
 ```
 
 The output from spark-shell will be like
 
 ```
-+----------------+------------------+
-|udfexpression(1)|udfexpression(100)|
-+----------------+------------------+
-|               6|               105|
-+----------------+------------------+
++------------------+----------------+
+|udfexpression(100)|udfexpression(1)|
++------------------+----------------+
+|               105|               6|
++------------------+----------------+
 ```
 


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

Reply via email to