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 f5b99463f2 Publish built docs triggered by
b2cbc7809ee0656099169307a73aadff23ab1030
f5b99463f2 is described below
commit f5b99463f29d1abe7559ffc2e9665483338e5075
Author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
AuthorDate: Thu Dec 28 20:08:12 2023 +0000
Publish built docs triggered by b2cbc7809ee0656099169307a73aadff23ab1030
---
_sources/library-user-guide/adding-udfs.md.txt | 9 ++++++++-
library-user-guide/adding-udfs.html | 4 +++-
searchindex.js | 2 +-
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/_sources/library-user-guide/adding-udfs.md.txt
b/_sources/library-user-guide/adding-udfs.md.txt
index 11cf52eb3f..c51e4de323 100644
--- a/_sources/library-user-guide/adding-udfs.md.txt
+++ b/_sources/library-user-guide/adding-udfs.md.txt
@@ -76,7 +76,9 @@ The challenge however is that DataFusion doesn't know about
this function. We ne
### Registering a Scalar UDF
-To register a Scalar UDF, you need to wrap the function implementation in a
`ScalarUDF` struct and then register it with the `SessionContext`. DataFusion
provides the `create_udf` and `make_scalar_function` helper functions to make
this easier.
+To register a Scalar UDF, you need to wrap the function implementation in a
[`ScalarUDF`] struct and then register it with the `SessionContext`.
+DataFusion provides the [`create_udf`] and helper functions to make this
easier.
+There is a lower level API with more functionality but is more complex, that
is documented in [`advanced_udf.rs`].
```rust
use datafusion::logical_expr::{Volatility, create_udf};
@@ -93,6 +95,11 @@ let udf = create_udf(
);
```
+[`scalarudf`]:
https://docs.rs/datafusion/latest/datafusion/logical_expr/struct.ScalarUDF.html
+[`create_udf`]:
https://docs.rs/datafusion/latest/datafusion/logical_expr/fn.create_udf.html
+[`make_scalar_function`]:
https://docs.rs/datafusion/latest/datafusion/physical_expr/functions/fn.make_scalar_function.html
+[`advanced_udf.rs`]:
https://github.com/apache/arrow-datafusion/blob/main/datafusion-examples/examples/advanced_udf.rs
+
A few things to note:
- The first argument is the name of the function. This is the name that will
be used in SQL queries.
diff --git a/library-user-guide/adding-udfs.html
b/library-user-guide/adding-udfs.html
index 5a196cd09f..f6898892ab 100644
--- a/library-user-guide/adding-udfs.html
+++ b/library-user-guide/adding-udfs.html
@@ -520,7 +520,9 @@
<p>The challenge however is that DataFusion doesn’t know about this function.
We need to register it with DataFusion so that it can be used in the context of
a query.</p>
<section id="registering-a-scalar-udf">
<h3>Registering a Scalar UDF<a class="headerlink"
href="#registering-a-scalar-udf" title="Link to this heading">¶</a></h3>
-<p>To register a Scalar UDF, you need to wrap the function implementation in a
<code class="docutils literal notranslate"><span
class="pre">ScalarUDF</span></code> struct and then register it with the <code
class="docutils literal notranslate"><span
class="pre">SessionContext</span></code>. DataFusion provides the <code
class="docutils literal notranslate"><span class="pre">create_udf</span></code>
and <code class="docutils literal notranslate"><span
class="pre">make_scalar_function</spa [...]
+<p>To register a Scalar UDF, you need to wrap the function implementation in a
<a class="reference external"
href="https://docs.rs/datafusion/latest/datafusion/logical_expr/struct.ScalarUDF.html"><code
class="docutils literal notranslate"><span
class="pre">ScalarUDF</span></code></a> struct and then register it with the
<code class="docutils literal notranslate"><span
class="pre">SessionContext</span></code>.
+DataFusion provides the <a class="reference external"
href="https://docs.rs/datafusion/latest/datafusion/logical_expr/fn.create_udf.html"><code
class="docutils literal notranslate"><span
class="pre">create_udf</span></code></a> and helper functions to make this
easier.
+There is a lower level API with more functionality but is more complex, that
is documented in <a class="reference external"
href="https://github.com/apache/arrow-datafusion/blob/main/datafusion-examples/examples/advanced_udf.rs"><code
class="docutils literal notranslate"><span
class="pre">advanced_udf.rs</span></code></a>.</p>
<div class="highlight-rust notranslate"><div
class="highlight"><pre><span></span><span class="k">use</span><span class="w">
</span><span class="n">datafusion</span>::<span
class="n">logical_expr</span>::<span class="p">{</span><span
class="n">Volatility</span><span class="p">,</span><span class="w">
</span><span class="n">create_udf</span><span class="p">};</span>
<span class="k">use</span><span class="w"> </span><span
class="n">datafusion</span>::<span class="n">physical_plan</span>::<span
class="n">functions</span>::<span class="n">make_scalar_function</span><span
class="p">;</span>
<span class="k">use</span><span class="w"> </span><span
class="n">datafusion</span>::<span class="n">arrow</span>::<span
class="n">datatypes</span>::<span class="n">DataType</span><span
class="p">;</span>
diff --git a/searchindex.js b/searchindex.js
index ab456affd9..9ed1fb1944 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