Deploying to gh-pages from @ GreptimeTeam/greptimedb@e52013ac0a 🚀

This commit is contained in:
github-merge-queue[bot] committed 2026-12-04 12:43:48 +00:00
commit f4689e26af
30001 files changed
+3492888

No files matched your search

@@ -0,0 +1,32 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Scalar function trait, modified from databend to adapt datafusion TODO(dennis): optimize function by it’s features such as monotonicity etc."><title>Function in common_function::function - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2"href="../../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../../static.files/rustdoc-1ed95124.css"><meta name="rustdoc-vars" data-root-path="../../" data-static-root-path="../../static.files/" data-current-crate="common_function" data-themes="" data-resource-suffix="" data-rustdoc-version="1.98.1 (48a229cea 2026-09-01)" data-channel="1.98.1" data-search-js="search-9944d736.js" data-stringdex-js="stringdex-2da4960a.js" data-settings-js="settings-170eb4bf.js" ><script src="../../static.files/storage-41dd4d93.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../static.files/main-417ebf0a.js"></script><noscript><link rel="stylesheet" href="../../static.files/noscript-f7c3ffd8.css"></noscript><link rel="alternate icon" type="image/png" href="../../static.files/favicon-32x32-eab170b8.png"><link rel="icon" type="image/svg+xml" href="../../static.files/favicon-044be391.svg"></head><body class="rustdoc trait"><a class="skip-main-content" href="#main-content">Skip to main content</a><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><rustdoc-topbar><h2><a href="#">Function</a></h2></rustdoc-topbar><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../../common_function/index.html">common_<wbr>function</a><span class="version">1.4.0-alpha.0</span></h2></div><div class="sidebar-elems"><section id="rustdoc-toc"><h2 class="location"><a href="#">Function</a></h2><h3><a href="#required-methods">Required Methods</a></h3><ul class="block"><li><a href="#tymethod.invoke_with_args" title="invoke_with_args">invoke_with_args</a></li><li><a href="#tymethod.name" title="name">name</a></li><li><a href="#tymethod.return_type" title="return_type">return_type</a></li><li><a href="#tymethod.signature" title="signature">signature</a></li></ul><h3><a href="#provided-methods">Provided Methods</a></h3><ul class="block"><li><a href="#method.aliases" title="aliases">aliases</a></li><li><a href="#method.return_field_from_args" title="return_field_from_args">return_field_from_args</a></li></ul><h3><a href="#implementors">Implementors</a></h3></section><div id="rustdoc-modnav"><h2><a href="index.html">In common_<wbr>function::<wbr>function</a></h2></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><section id="main-content" class="content" tabindex="-1"><div class="main-heading"><div class="rustdoc-breadcrumbs"><a href="../index.html">common_function</a>::<wbr><a href="index.html">function</a></div><h1>Trait <span class="trait">Function</span>&nbsp;<button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../../src/common_function/function.rs.html#101-136">Source</a> </span></div><pre class="rust item-decl"><code>pub trait Function:
<a class="trait" href="https://doc.rust-lang.org/1.98.1/core/fmt/trait.Display.html" title="trait core::fmt::Display">Display</a>
+ <a class="trait" href="https://doc.rust-lang.org/1.98.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a>
+ <a class="trait" href="https://doc.rust-lang.org/1.98.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> {
// Required methods
fn <a href="#tymethod.name" class="fn">name</a>(&amp;self) -&gt; &amp;<a class="primitive" href="https://doc.rust-lang.org/1.98.1/std/primitive.str.html">str</a>;
<span class="item-spacer"></span> fn <a href="#tymethod.return_type" class="fn">return_type</a>(&amp;self, input_types: &amp;[DataType]) -&gt; Result&lt;DataType&gt;;
<span class="item-spacer"></span> fn <a href="#tymethod.signature" class="fn">signature</a>(&amp;self) -&gt; &amp;Signature;
<span class="item-spacer"></span> fn <a href="#tymethod.invoke_with_args" class="fn">invoke_with_args</a>(
&amp;self,
args: ScalarFunctionArgs,
) -&gt; Result&lt;ColumnarValue&gt;;
// Provided methods
fn <a href="#method.aliases" class="fn">aliases</a>(&amp;self) -&gt; &amp;[<a class="struct" href="https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>] { ... }
<span class="item-spacer"></span> fn <a href="#method.return_field_from_args" class="fn">return_field_from_args</a>(
&amp;self,
args: ReturnFieldArgs&lt;'_&gt;,
) -&gt; Result&lt;<a class="struct" href="https://doc.rust-lang.org/1.98.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;Field&gt;&gt; { ... }
}</code></pre><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Scalar function trait, modified from databend to adapt datafusion
TODO(dennis): optimize function by it’s features such as monotonicity etc.</p>
</div></details><h2 id="required-methods" class="section-header">Required Methods<a href="#required-methods" class="anchor">§</a></h2><div class="methods"><details class="toggle method-toggle" open><summary><section id="tymethod.name" class="method"><a class="src rightside" href="../../src/common_function/function.rs.html#103">Source</a><h4 class="code-header">fn <a href="#tymethod.name" class="fn">name</a>(&amp;self) -&gt; &amp;<a class="primitive" href="https://doc.rust-lang.org/1.98.1/std/primitive.str.html">str</a></h4></section></summary><div class="docblock"><p>Returns the name of the function, should be unique.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.return_type" class="method"><a class="src rightside" href="../../src/common_function/function.rs.html#106">Source</a><h4 class="code-header">fn <a href="#tymethod.return_type" class="fn">return_type</a>(&amp;self, input_types: &amp;[DataType]) -&gt; Result&lt;DataType&gt;</h4></section></summary><div class="docblock"><p>The returned data type of function execution.</p>
</div></details><details class="toggle method-toggle" open><summary><section id="tymethod.signature" class="method"><a class="src rightside" href="../../src/common_function/function.rs.html#109">Source</a><h4 class="code-header">fn <a href="#tymethod.signature" class="fn">signature</a>(&amp;self) -&gt; &amp;Signature</h4></section></summary><div class="docblock"><p>The signature of function.</p>
</div></details><section id="tymethod.invoke_with_args" class="method"><a class="src rightside" href="../../src/common_function/function.rs.html#111-114">Source</a><h4 class="code-header">fn <a href="#tymethod.invoke_with_args" class="fn">invoke_with_args</a>(&amp;self, args: ScalarFunctionArgs) -&gt; Result&lt;ColumnarValue&gt;</h4></section></div><h2 id="provided-methods" class="section-header">Provided Methods<a href="#provided-methods" class="anchor">§</a></h2><div class="methods"><section id="method.aliases" class="method"><a class="src rightside" href="../../src/common_function/function.rs.html#116-118">Source</a><h4 class="code-header">fn <a href="#method.aliases" class="fn">aliases</a>(&amp;self) -&gt; &amp;[<a class="struct" href="https://doc.rust-lang.org/1.98.1/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>]</h4></section><details class="toggle method-toggle" open><summary><section id="method.return_field_from_args" class="method"><a class="src rightside" href="../../src/common_function/function.rs.html#124-135">Source</a><h4 class="code-header">fn <a href="#method.return_field_from_args" class="fn">return_field_from_args</a>(
&amp;self,
args: ReturnFieldArgs&lt;'_&gt;,
) -&gt; Result&lt;<a class="struct" href="https://doc.rust-lang.org/1.98.1/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a>&lt;Field&gt;&gt;</h4></section></summary><div class="docblock"><p>Returns the return field for this function given the input fields.</p>
<p>Default implementation extracts data types from input fields and calls
<a href="trait.Function.html#tymethod.return_type" title="method common_function::function::Function::return_type"><code>Function::return_type</code></a>, creating a generic field with the returned type.</p>
</div></details></div><h2 id="dyn-compatibility" class="section-header">Dyn Compatibility<a href="#dyn-compatibility" class="anchor">§</a></h2><div class="dyn-compatibility-info"><p>This trait <b>is</b> <a href="https://doc.rust-lang.org/1.98.1/reference/items/traits.html#dyn-compatibility">dyn compatible</a>.</p><p><i>In older versions of Rust, dyn compatibility was called "object safety".</i></p></div><h2 id="implementors" class="section-header">Implementors<a href="#implementors" class="anchor">§</a></h2><div id="implementors-list"><div class="negative-marker"></div><section id="impl-Function-for-AvgCalcFunction" class="impl"><a class="src rightside" href="../../src/common_function/scalars/avg_calc.rs.html#58-105">Source</a><a href="#impl-Function-for-AvgCalcFunction" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Function.html" title="trait common_function::function::Function">Function</a> for <a class="struct" href="../scalars/avg_calc/struct.AvgCalcFunction.html" title="struct common_function::scalars::avg_calc::AvgCalcFunction">AvgCalcFunction</a></h3></section><section id="impl-Function-for-BuildFunction" class="impl"><a class="src rightside" href="../../src/common_function/system/build.rs.html#29-48">Source</a><a href="#impl-Function-for-BuildFunction" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Function.html" title="trait common_function::function::Function">Function</a> for <a class="struct" href="../system/build/struct.BuildFunction.html" title="struct common_function::system::build::BuildFunction">BuildFunction</a></h3></section><section id="impl-Function-for-ClampFunction" class="impl"><a class="src rightside" href="../../src/common_function/scalars/math/clamp.rs.html#43-67">Source</a><a href="#impl-Function-for-ClampFunction" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Function.html" title="trait common_function::function::Function">Function</a> for <a class="struct" href="../scalars/math/clamp/struct.ClampFunction.html" title="struct common_function::scalars::math::clamp::ClampFunction">ClampFunction</a></h3></section><section id="impl-Function-for-ClampMaxFunction" class="impl"><a class="src rightside" href="../../src/common_function/scalars/math/clamp.rs.html#296-326">Source</a><a href="#impl-Function-for-ClampMaxFunction" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Function.html" title="trait common_function::function::Function">Function</a> for <a class="struct" href="../scalars/math/clamp/struct.ClampMaxFunction.html" title="struct common_function::scalars::math::clamp::ClampMaxFunction">ClampMaxFunction</a></h3></section><section id="impl-Function-for-ClampMinFunction" class="impl"><a class="src rightside" href="../../src/common_function/scalars/math/clamp.rs.html#242-272">Source</a><a href="#impl-Function-for-ClampMinFunction" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Function.html" title="trait common_function::function::Function">Function</a> for <a class="struct" href="../scalars/math/clamp/struct.ClampMinFunction.html" title="struct common_function::scalars::math::clamp::ClampMinFunction">ClampMinFunction</a></h3></section><section id="impl-Function-for-ColDescriptionFunction" class="impl"><a class="src rightside" href="../../src/common_function/system/pg_catalog.rs.html#259-283">Source</a><a href="#impl-Function-for-ColDescriptionFunction" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Function.html" title="trait common_function::function::Function">Function</a> for <a class="struct" href="../system/pg_catalog/struct.ColDescriptionFunction.html" title="struct common_function::system::pg_catalog::ColDescriptionFunction">ColDescriptionFunction</a></h3></section><section id="impl-Function-for-ConnectionIdFunction" class="impl"><a class="src rightside" href="../../src/common_function/system/database.rs.html#160-182">Source</a><a href="#impl-Function-for-ConnectionIdFunction" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Function.html" title="trait common_function::function::Function">Function</a> for <a class="struct" href="../system/database/struct.ConnectionIdFunction.html" title="struct common_function::system::database::ConnectionIdFunction">ConnectionIdFunction</a></h3></section><section id="impl-Function-for-CosDistanceFunction" class="impl"><a class="src rightside" href="../../src/common_function/scalars/vector/distance.rs.html#116">Source</a><a href="#impl-Function-for-CosDistanceFunction" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Function.html" title="trait common_function::function::Function">Function</a> for <a class="struct" href="../scalars/vector/distance/struct.CosDistanceFunction.html" title="struct common_function::scalars::vector::distance::CosDistanceFunction">CosDistanceFunction</a></h3></sLine truncated
</div></section><section id="impl-Function-for-RangeFunction" class="impl"><a class="src rightside" href="../../src/common_function/scalars/math.rs.html#67-91">Source</a><a href="#impl-Function-for-RangeFunction" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Function.html" title="trait common_function::function::Function">Function</a> for <a class="struct" href="../scalars/math/struct.RangeFunction.html" title="struct common_function::scalars::math::RangeFunction">RangeFunction</a></h3></section><section id="impl-Function-for-RateFunction" class="impl"><a class="src rightside" href="../../src/common_function/scalars/math/rate.rs.html#47-82">Source</a><a href="#impl-Function-for-RateFunction" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Function.html" title="trait common_function::function::Function">Function</a> for <a class="struct" href="../scalars/math/rate/struct.RateFunction.html" title="struct common_function::scalars::math::rate::RateFunction">RateFunction</a></h3></section><section id="impl-Function-for-ReadPreferenceFunction" class="impl"><a class="src rightside" href="../../src/common_function/system/database.rs.html#110-134">Source</a><a href="#impl-Function-for-ReadPreferenceFunction" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Function.html" title="trait common_function::function::Function">Function</a> for <a class="struct" href="../system/database/struct.ReadPreferenceFunction.html" title="struct common_function::system::database::ReadPreferenceFunction">ReadPreferenceFunction</a></h3></section><section id="impl-Function-for-RegexpExtractFunction" class="impl"><a class="src rightside" href="../../src/common_function/scalars/string/regexp_extract.rs.html#80-180">Source</a><a href="#impl-Function-for-RegexpExtractFunction" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Function.html" title="trait common_function::function::Function">Function</a> for <a class="struct" href="../scalars/string/regexp_extract/struct.RegexpExtractFunction.html" title="struct common_function::scalars::string::regexp_extract::RegexpExtractFunction">RegexpExtractFunction</a></h3></section><section id="impl-Function-for-S2CellLevel" class="impl"><a class="src rightside" href="../../src/common_function/scalars/geo/s2.rs.html#135-166">Source</a><a href="#impl-Function-for-S2CellLevel" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Function.html" title="trait common_function::function::Function">Function</a> for <a class="struct" href="../scalars/geo/s2/struct.S2CellLevel.html" title="struct common_function::scalars::geo::s2::S2CellLevel">S2CellLevel</a></h3></section><section id="impl-Function-for-S2CellParent" class="impl"><a class="src rightside" href="../../src/common_function/scalars/geo/s2.rs.html#231-267">Source</a><a href="#impl-Function-for-S2CellParent" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Function.html" title="trait common_function::function::Function">Function</a> for <a class="struct" href="../scalars/geo/s2/struct.S2CellParent.html" title="struct common_function::scalars::geo::s2::S2CellParent">S2CellParent</a></h3></section><section id="impl-Function-for-S2CellToToken" class="impl"><a class="src rightside" href="../../src/common_function/scalars/geo/s2.rs.html#183-214">Source</a><a href="#impl-Function-for-S2CellToToken" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Function.html" title="trait common_function::function::Function">Function</a> for <a class="struct" href="../scalars/geo/s2/struct.S2CellToToken.html" title="struct common_function::scalars::geo::s2::S2CellToToken">S2CellToToken</a></h3></section><section id="impl-Function-for-S2LatLngToCell" class="impl"><a class="src rightside" href="../../src/common_function/scalars/geo/s2.rs.html#66-118">Source</a><a href="#impl-Function-for-S2LatLngToCell" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Function.html" title="trait common_function::function::Function">Function</a> for <a class="struct" href="../scalars/geo/s2/struct.S2LatLngToCell.html" title="struct common_function::scalars::geo::s2::S2LatLngToCell">S2LatLngToCell</a></h3></section><section id="impl-Function-for-STArea" class="impl"><a class="src rightside" href="../../src/common_function/scalars/geo/measure.rs.html#184-224">Source</a><a href="#impl-Function-for-STArea" class="anchor">§</a><h3 class="code-header">impl <a class="trait" href="trait.Function.html" title="trait common_function::function::Function">Function</a> for <a class="struct" href="../scalars/geo/measure/struct.STArea.html" title="struct common_function::scalars::geo::measure::STArea">STArea</a></h3></section><section id="impl-Function-for-STDistance" class="impl"><a class="src rightside" href="../../src/common_function/scalars/geo/measure.rs.html#48-94"Line truncated