You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by gi...@apache.org on 2024/03/05 22:11:46 UTC

(arrow-datafusion) branch asf-site updated: Publish built docs triggered by 6041deaeb0fe65e0971768f414a91f30f286790a

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

github-bot pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git


The following commit(s) were added to refs/heads/asf-site by this push:
     new 5b32b103a4 Publish built docs triggered by 6041deaeb0fe65e0971768f414a91f30f286790a
5b32b103a4 is described below

commit 5b32b103a448cd678e576818d04bb2e4bef20b40
Author: github-actions[bot] <gi...@users.noreply.github.com>
AuthorDate: Tue Mar 5 22:11:40 2024 +0000

    Publish built docs triggered by 6041deaeb0fe65e0971768f414a91f30f286790a
---
 _sources/contributor-guide/index.md.txt | 33 ++++++++++++++++-------------
 contributor-guide/index.html            | 37 +++++++++++++++++++--------------
 searchindex.js                          |  2 +-
 3 files changed, 41 insertions(+), 31 deletions(-)

diff --git a/_sources/contributor-guide/index.md.txt b/_sources/contributor-guide/index.md.txt
index d26ed41b94..6b207aa40b 100644
--- a/_sources/contributor-guide/index.md.txt
+++ b/_sources/contributor-guide/index.md.txt
@@ -249,22 +249,27 @@ These are valuable for comparative evaluation against alternative Arrow implemen
 
 Below is a checklist of what you need to do to add a new scalar function to DataFusion:
 
-- Add the actual implementation of the function:
-  - [here](https://github.com/apache/arrow-datafusion/blob/main/datafusion/physical-expr/src/string_expressions.rs) for string functions
-  - [here](https://github.com/apache/arrow-datafusion/blob/main/datafusion/physical-expr/src/math_expressions.rs) for math functions
-  - [here](https://github.com/apache/arrow-datafusion/blob/main/datafusion/physical-expr/src/datetime_expressions.rs) for datetime functions
-  - create a new module [here](https://github.com/apache/arrow-datafusion/blob/main/datafusion/physical-expr/src) for other functions
-- In [physical-expr/src](https://github.com/apache/arrow-datafusion/blob/main/datafusion/physical-expr/src/functions.rs), add:
-  - a new variant to `BuiltinScalarFunction`
-  - a new entry to `FromStr` with the name of the function as called by SQL
-  - a new line in `return_type` with the expected return type of the function, given an incoming type
-  - a new line in `signature` with the signature of the function (number and types of its arguments)
-  - a new line in `create_physical_expr`/`create_physical_fun` mapping the built-in to the implementation
-  - tests to the function.
+- Add the actual implementation of the function to a new module file within:
+  - [here](https://github.com/apache/arrow-datafusion/blob/main/datafusion/functions-array/src) for array functions
+  - [here](https://github.com/apache/arrow-datafusion/blob/main/datafusion/functions/src/crypto) for crypto functions
+  - [here](https://github.com/apache/arrow-datafusion/blob/main/datafusion/functions/src/datetime) for datetime functions
+  - [here](https://github.com/apache/arrow-datafusion/blob/main/datafusion/functions/src/encoding) for encoding functions
+  - [here](https://github.com/apache/arrow-datafusion/blob/main/datafusion/functions/src/math) for math functions
+  - [here](https://github.com/apache/arrow-datafusion/blob/main/datafusion/functions/src/regex) for regex functions
+  - [here](https://github.com/apache/arrow-datafusion/blob/main/datafusion/functions/src/string) for string functions
+  - [here](https://github.com/apache/arrow-datafusion/blob/main/datafusion/functions/src/unicode) for unicode functions
+  - create a new module [here](https://github.com/apache/arrow-datafusion/blob/main/datafusion/functions/src) for other functions.
+- New function modules - for example a `vector` module, should use a [rust feature](https://doc.rust-lang.org/cargo/reference/features.html) (for example `vector_expressions`) to allow DataFusion
+  users to enable or disable the new module as desired.
+- The implementation of the function is done via implementing `ScalarUDFImpl` trait for the function struct.
+  - See the [advanced_udf.rs](https://github.com/apache/arrow-datafusion/blob/main/datafusion-examples/examples/advanced_udf.rs) example for an example implementation
+  - Add tests for the new function
+- To connect the implementation of the function add to the mod.rs file:
+  - a `mod xyz;` where xyz is the new module file
+  - a call to `make_udf_function!(..);`
+  - an item in `export_functions!(..);`
 - In [sqllogictest/test_files](https://github.com/apache/arrow-datafusion/blob/main/datafusion/sqllogictest/test_files), add new `sqllogictest` integration tests where the function is called through SQL against well known data and returns the expected result.
   - Documentation for `sqllogictest` [here](https://github.com/apache/arrow-datafusion/blob/main/datafusion/sqllogictest/README.md)
-- In [expr/src/expr_fn.rs](https://github.com/apache/arrow-datafusion/blob/main/datafusion/expr/src/expr_fn.rs), add:
-  - a new entry of the `unary_scalar_expr!` macro for the new function.
 - Add SQL reference documentation [here](https://github.com/apache/arrow-datafusion/blob/main/docs/source/user-guide/sql/scalar_functions.md)
 
 ### How to add a new aggregate function
diff --git a/contributor-guide/index.html b/contributor-guide/index.html
index fe18b97ac5..814f929cf6 100644
--- a/contributor-guide/index.html
+++ b/contributor-guide/index.html
@@ -757,32 +757,37 @@ and tries to follow the Rust standard <a class="reference external" href="https:
 <h3>How to add a new scalar function<a class="headerlink" href="#how-to-add-a-new-scalar-function" title="Link to this heading">ΒΆ</a></h3>
 <p>Below is a checklist of what you need to do to add a new scalar function to DataFusion:</p>
 <ul class="simple">
-<li><p>Add the actual implementation of the function:</p>
+<li><p>Add the actual implementation of the function to a new module file within:</p>
 <ul>
-<li><p><a class="reference external" href="https://github.com/apache/arrow-datafusion/blob/main/datafusion/physical-expr/src/string_expressions.rs">here</a> for string functions</p></li>
-<li><p><a class="reference external" href="https://github.com/apache/arrow-datafusion/blob/main/datafusion/physical-expr/src/math_expressions.rs">here</a> for math functions</p></li>
-<li><p><a class="reference external" href="https://github.com/apache/arrow-datafusion/blob/main/datafusion/physical-expr/src/datetime_expressions.rs">here</a> for datetime functions</p></li>
-<li><p>create a new module <a class="reference external" href="https://github.com/apache/arrow-datafusion/blob/main/datafusion/physical-expr/src">here</a> for other functions</p></li>
+<li><p><a class="reference external" href="https://github.com/apache/arrow-datafusion/blob/main/datafusion/functions-array/src">here</a> for array functions</p></li>
+<li><p><a class="reference external" href="https://github.com/apache/arrow-datafusion/blob/main/datafusion/functions/src/crypto">here</a> for crypto functions</p></li>
+<li><p><a class="reference external" href="https://github.com/apache/arrow-datafusion/blob/main/datafusion/functions/src/datetime">here</a> for datetime functions</p></li>
+<li><p><a class="reference external" href="https://github.com/apache/arrow-datafusion/blob/main/datafusion/functions/src/encoding">here</a> for encoding functions</p></li>
+<li><p><a class="reference external" href="https://github.com/apache/arrow-datafusion/blob/main/datafusion/functions/src/math">here</a> for math functions</p></li>
+<li><p><a class="reference external" href="https://github.com/apache/arrow-datafusion/blob/main/datafusion/functions/src/regex">here</a> for regex functions</p></li>
+<li><p><a class="reference external" href="https://github.com/apache/arrow-datafusion/blob/main/datafusion/functions/src/string">here</a> for string functions</p></li>
+<li><p><a class="reference external" href="https://github.com/apache/arrow-datafusion/blob/main/datafusion/functions/src/unicode">here</a> for unicode functions</p></li>
+<li><p>create a new module <a class="reference external" href="https://github.com/apache/arrow-datafusion/blob/main/datafusion/functions/src">here</a> for other functions.</p></li>
 </ul>
 </li>
-<li><p>In <a class="reference external" href="https://github.com/apache/arrow-datafusion/blob/main/datafusion/physical-expr/src/functions.rs">physical-expr/src</a>, add:</p>
+<li><p>New function modules - for example a <code class="docutils literal notranslate"><span class="pre">vector</span></code> module, should use a <a class="reference external" href="https://doc.rust-lang.org/cargo/reference/features.html">rust feature</a> (for example <code class="docutils literal notranslate"><span class="pre">vector_expressions</span></code>) to allow DataFusion
+users to enable or disable the new module as desired.</p></li>
+<li><p>The implementation of the function is done via implementing <code class="docutils literal notranslate"><span class="pre">ScalarUDFImpl</span></code> trait for the function struct.</p>
 <ul>
-<li><p>a new variant to <code class="docutils literal notranslate"><span class="pre">BuiltinScalarFunction</span></code></p></li>
-<li><p>a new entry to <code class="docutils literal notranslate"><span class="pre">FromStr</span></code> with the name of the function as called by SQL</p></li>
-<li><p>a new line in <code class="docutils literal notranslate"><span class="pre">return_type</span></code> with the expected return type of the function, given an incoming type</p></li>
-<li><p>a new line in <code class="docutils literal notranslate"><span class="pre">signature</span></code> with the signature of the function (number and types of its arguments)</p></li>
-<li><p>a new line in <code class="docutils literal notranslate"><span class="pre">create_physical_expr</span></code>/<code class="docutils literal notranslate"><span class="pre">create_physical_fun</span></code> mapping the built-in to the implementation</p></li>
-<li><p>tests to the function.</p></li>
+<li><p>See the <a class="reference external" href="https://github.com/apache/arrow-datafusion/blob/main/datafusion-examples/examples/advanced_udf.rs">advanced_udf.rs</a> example for an example implementation</p></li>
+<li><p>Add tests for the new function</p></li>
 </ul>
 </li>
-<li><p>In <a class="reference external" href="https://github.com/apache/arrow-datafusion/blob/main/datafusion/sqllogictest/test_files">sqllogictest/test_files</a>, add new <code class="docutils literal notranslate"><span class="pre">sqllogictest</span></code> integration tests where the function is called through SQL against well known data and returns the expected result.</p>
+<li><p>To connect the implementation of the function add to the mod.rs file:</p>
 <ul>
-<li><p>Documentation for <code class="docutils literal notranslate"><span class="pre">sqllogictest</span></code> <a class="reference external" href="https://github.com/apache/arrow-datafusion/blob/main/datafusion/sqllogictest/README.md">here</a></p></li>
+<li><p>a <code class="docutils literal notranslate"><span class="pre">mod</span> <span class="pre">xyz;</span></code> where xyz is the new module file</p></li>
+<li><p>a call to <code class="docutils literal notranslate"><span class="pre">make_udf_function!(..);</span></code></p></li>
+<li><p>an item in <code class="docutils literal notranslate"><span class="pre">export_functions!(..);</span></code></p></li>
 </ul>
 </li>
-<li><p>In <a class="reference external" href="https://github.com/apache/arrow-datafusion/blob/main/datafusion/expr/src/expr_fn.rs">expr/src/expr_fn.rs</a>, add:</p>
+<li><p>In <a class="reference external" href="https://github.com/apache/arrow-datafusion/blob/main/datafusion/sqllogictest/test_files">sqllogictest/test_files</a>, add new <code class="docutils literal notranslate"><span class="pre">sqllogictest</span></code> integration tests where the function is called through SQL against well known data and returns the expected result.</p>
 <ul>
-<li><p>a new entry of the <code class="docutils literal notranslate"><span class="pre">unary_scalar_expr!</span></code> macro for the new function.</p></li>
+<li><p>Documentation for <code class="docutils literal notranslate"><span class="pre">sqllogictest</span></code> <a class="reference external" href="https://github.com/apache/arrow-datafusion/blob/main/datafusion/sqllogictest/README.md">here</a></p></li>
 </ul>
 </li>
 <li><p>Add SQL reference documentation <a class="reference external" href="https://github.com/apache/arrow-datafusion/blob/main/docs/source/user-guide/sql/scalar_functions.md">here</a></p></li>
diff --git a/searchindex.js b/searchindex.js
index 9bac1d79e2..99771645c5 100644
--- a/searchindex.js
+++ b/searchindex.js
@@ -1 +1 @@
-Search.setIndex({"docnames": ["contributor-guide/architecture", "contributor-guide/communication", "contributor-guide/index", "contributor-guide/quarterly_roadmap", "contributor-guide/roadmap", "contributor-guide/specification/index", "contributor-guide/specification/invariants", "contributor-guide/specification/output-field-name-semantic", "index", "library-user-guide/adding-udfs", "library-user-guide/building-logical-plans", "library-user-guide/catalogs", "library-user-guide/custom-tab [...]
\ No newline at end of file
+Search.setIndex({"docnames": ["contributor-guide/architecture", "contributor-guide/communication", "contributor-guide/index", "contributor-guide/quarterly_roadmap", "contributor-guide/roadmap", "contributor-guide/specification/index", "contributor-guide/specification/invariants", "contributor-guide/specification/output-field-name-semantic", "index", "library-user-guide/adding-udfs", "library-user-guide/building-logical-plans", "library-user-guide/catalogs", "library-user-guide/custom-tab [...]
\ No newline at end of file