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/datafusion.git
The following commit(s) were added to refs/heads/asf-site by this push:
new 3654dc9aec Publish built docs triggered by
24a08465e12bc07275cafe5310a7ac44898e39de
3654dc9aec is described below
commit 3654dc9aec220b1df9185484bbb6b3779abb94f9
Author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
AuthorDate: Sun Jun 9 05:49:49 2024 +0000
Publish built docs triggered by 24a08465e12bc07275cafe5310a7ac44898e39de
---
.../aggregate_function.rs | 19 -------------------
_sources/user-guide/expressions.md.txt | 10 ++++++++++
searchindex.js | 2 +-
user-guide/expressions.html | 22 ++++++++++++++++++++++
4 files changed, 33 insertions(+), 20 deletions(-)
diff --git a/_downloads/f9718f9b04809de030b1693c73858f19/aggregate_function.rs
b/_downloads/f9718f9b04809de030b1693c73858f19/aggregate_function.rs
index 8f683cabe6..edefd0f3ed 100644
--- a/_downloads/f9718f9b04809de030b1693c73858f19/aggregate_function.rs
+++ b/_downloads/f9718f9b04809de030b1693c73858f19/aggregate_function.rs
@@ -35,8 +35,6 @@ use strum_macros::EnumIter;
pub enum AggregateFunction {
/// Count
Count,
- /// Sum
- Sum,
/// Minimum
Min,
/// Maximum
@@ -51,10 +49,6 @@ pub enum AggregateFunction {
NthValue,
/// Variance (Population)
VariancePop,
- /// Standard Deviation (Sample)
- Stddev,
- /// Standard Deviation (Population)
- StddevPop,
/// Correlation
Correlation,
/// Slope from linear regression
@@ -102,7 +96,6 @@ impl AggregateFunction {
use AggregateFunction::*;
match self {
Count => "COUNT",
- Sum => "SUM",
Min => "MIN",
Max => "MAX",
Avg => "AVG",
@@ -110,8 +103,6 @@ impl AggregateFunction {
ArrayAgg => "ARRAY_AGG",
NthValue => "NTH_VALUE",
VariancePop => "VAR_POP",
- Stddev => "STDDEV",
- StddevPop => "STDDEV_POP",
Correlation => "CORR",
RegrSlope => "REGR_SLOPE",
RegrIntercept => "REGR_INTERCEPT",
@@ -157,15 +148,11 @@ impl FromStr for AggregateFunction {
"max" => AggregateFunction::Max,
"mean" => AggregateFunction::Avg,
"min" => AggregateFunction::Min,
- "sum" => AggregateFunction::Sum,
"array_agg" => AggregateFunction::ArrayAgg,
"nth_value" => AggregateFunction::NthValue,
"string_agg" => AggregateFunction::StringAgg,
// statistical
"corr" => AggregateFunction::Correlation,
- "stddev" => AggregateFunction::Stddev,
- "stddev_pop" => AggregateFunction::StddevPop,
- "stddev_samp" => AggregateFunction::Stddev,
"var_pop" => AggregateFunction::VariancePop,
"regr_slope" => AggregateFunction::RegrSlope,
"regr_intercept" => AggregateFunction::RegrIntercept,
@@ -223,7 +210,6 @@ impl AggregateFunction {
// The coerced_data_types is same with input_types.
Ok(coerced_data_types[0].clone())
}
- AggregateFunction::Sum => sum_return_type(&coerced_data_types[0]),
AggregateFunction::BitAnd
| AggregateFunction::BitOr
| AggregateFunction::BitXor => Ok(coerced_data_types[0].clone()),
@@ -236,8 +222,6 @@ impl AggregateFunction {
AggregateFunction::Correlation => {
correlation_return_type(&coerced_data_types[0])
}
- AggregateFunction::Stddev =>
stddev_return_type(&coerced_data_types[0]),
- AggregateFunction::StddevPop =>
stddev_return_type(&coerced_data_types[0]),
AggregateFunction::RegrSlope
| AggregateFunction::RegrIntercept
| AggregateFunction::RegrCount
@@ -308,10 +292,7 @@ impl AggregateFunction {
Signature::uniform(1, vec![DataType::Boolean],
Volatility::Immutable)
}
AggregateFunction::Avg
- | AggregateFunction::Sum
| AggregateFunction::VariancePop
- | AggregateFunction::Stddev
- | AggregateFunction::StddevPop
| AggregateFunction::ApproxMedian => {
Signature::uniform(1, NUMERICS.to_vec(), Volatility::Immutable)
}
diff --git a/_sources/user-guide/expressions.md.txt
b/_sources/user-guide/expressions.md.txt
index a5fc134916..cae9627210 100644
--- a/_sources/user-guide/expressions.md.txt
+++ b/_sources/user-guide/expressions.md.txt
@@ -304,6 +304,16 @@ select log(-1), log(0), sqrt(-1);
| rollup(exprs) | Creates
a grouping set for rollup sets.
|
| sum(expr) |
Сalculates the sum of `expr`.
|
+## Aggregate Function Builder
+
+You can also use the `AggregateExt` trait to more easily build Aggregate
arguments `Expr`.
+
+See `datafusion-examples/examples/expr_api.rs` for example usage.
+
+| Syntax |
Equivalent to |
+| ----------------------------------------------------------------------- |
----------------------------------- |
+| first_value_udaf.call(vec![expr]).order_by(vec![expr]).build().unwrap() |
first_value(expr, Some(vec![expr])) |
+
## Subquery Expressions
| Syntax | Description
|
diff --git a/searchindex.js b/searchindex.js
index 0b868818a5..4d364e5dd2 100644
--- a/searchindex.js
+++ b/searchindex.js
@@ -1 +1 @@
-Search.setIndex({"alltitles": {"!=": [[43, "op-neq"]], "!~": [[43,
"op-re-not-match"]], "!~*": [[43, "op-re-not-match-i"]], "!~~": [[43, "id18"]],
"!~~*": [[43, "id19"]], "#": [[43, "op-bit-xor"]], "%": [[43, "op-modulo"]],
"&": [[43, "op-bit-and"]], "(relation, name) tuples in logical fields and
logical columns are unique": [[10,
"relation-name-tuples-in-logical-fields-and-logical-columns-are-unique"]], "*":
[[43, "op-multiply"]], "+": [[43, "op-plus"]], "-": [[43, "op-minus"]], "/": [[
[...]
\ No newline at end of file
+Search.setIndex({"alltitles": {"!=": [[43, "op-neq"]], "!~": [[43,
"op-re-not-match"]], "!~*": [[43, "op-re-not-match-i"]], "!~~": [[43, "id18"]],
"!~~*": [[43, "id19"]], "#": [[43, "op-bit-xor"]], "%": [[43, "op-modulo"]],
"&": [[43, "op-bit-and"]], "(relation, name) tuples in logical fields and
logical columns are unique": [[10,
"relation-name-tuples-in-logical-fields-and-logical-columns-are-unique"]], "*":
[[43, "op-multiply"]], "+": [[43, "op-plus"]], "-": [[43, "op-minus"]], "/": [[
[...]
\ No newline at end of file
diff --git a/user-guide/expressions.html b/user-guide/expressions.html
index 042fad1fbc..3f62740d98 100644
--- a/user-guide/expressions.html
+++ b/user-guide/expressions.html
@@ -538,6 +538,11 @@
Aggregate Functions
</a>
</li>
+ <li class="toc-h2 nav-item toc-entry">
+ <a class="reference internal nav-link" href="#aggregate-function-builder">
+ Aggregate Function Builder
+ </a>
+ </li>
<li class="toc-h2 nav-item toc-entry">
<a class="reference internal nav-link" href="#subquery-expressions">
Subquery Expressions
@@ -1308,6 +1313,23 @@ but these operators always return a <code
class="docutils literal notranslate"><
</tbody>
</table>
</section>
+<section id="aggregate-function-builder">
+<h2>Aggregate Function Builder<a class="headerlink"
href="#aggregate-function-builder" title="Link to this heading">¶</a></h2>
+<p>You can also use the <code class="docutils literal notranslate"><span
class="pre">AggregateExt</span></code> trait to more easily build Aggregate
arguments <code class="docutils literal notranslate"><span
class="pre">Expr</span></code>.</p>
+<p>See <code class="docutils literal notranslate"><span
class="pre">datafusion-examples/examples/expr_api.rs</span></code> for example
usage.</p>
+<table class="table">
+<thead>
+<tr class="row-odd"><th class="head"><p>Syntax</p></th>
+<th class="head"><p>Equivalent to</p></th>
+</tr>
+</thead>
+<tbody>
+<tr
class="row-even"><td><p>first_value_udaf.call(vec![expr]).order_by(vec![expr]).build().unwrap()</p></td>
+<td><p>first_value(expr, Some(vec![expr]))</p></td>
+</tr>
+</tbody>
+</table>
+</section>
<section id="subquery-expressions">
<h2>Subquery Expressions<a class="headerlink" href="#subquery-expressions"
title="Link to this heading">¶</a></h2>
<table class="table">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]