You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by al...@apache.org on 2023/08/09 14:00:18 UTC
[arrow-datafusion] branch main updated: add link of contributor guide for new functions to src (#7240)
This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new d8692b119a add link of contributor guide for new functions to src (#7240)
d8692b119a is described below
commit d8692b119a0c2c42eb3e63a84c74e0aea861b0b3
Author: Yongting You <20...@gmail.com>
AuthorDate: Wed Aug 9 07:00:13 2023 -0700
add link of contributor guide for new functions to src (#7240)
---
datafusion/expr/src/aggregate_function.rs | 2 ++
datafusion/expr/src/built_in_function.rs | 2 ++
docs/source/contributor-guide/index.md | 8 ++++++--
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/datafusion/expr/src/aggregate_function.rs b/datafusion/expr/src/aggregate_function.rs
index 876f746d05..d6cb5a1903 100644
--- a/datafusion/expr/src/aggregate_function.rs
+++ b/datafusion/expr/src/aggregate_function.rs
@@ -25,6 +25,8 @@ use std::{fmt, str::FromStr};
use strum_macros::EnumIter;
/// Enum of all built-in aggregate functions
+// Contributor's guide for adding new aggregate functions
+// https://arrow.apache.org/datafusion/contributor-guide/index.html#how-to-add-a-new-aggregate-function
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Hash, EnumIter)]
pub enum AggregateFunction {
/// count
diff --git a/datafusion/expr/src/built_in_function.rs b/datafusion/expr/src/built_in_function.rs
index 061d0689cd..f239155a92 100644
--- a/datafusion/expr/src/built_in_function.rs
+++ b/datafusion/expr/src/built_in_function.rs
@@ -34,6 +34,8 @@ use strum_macros::EnumIter;
use lazy_static::lazy_static;
/// Enum of all built-in scalar functions
+// Contributor's guide for adding new scalar functions
+// https://arrow.apache.org/datafusion/contributor-guide/index.html#how-to-add-a-new-scalar-function
#[derive(Debug, Clone, PartialEq, Eq, Hash, EnumIter, Copy)]
pub enum BuiltinScalarFunction {
// math functions
diff --git a/docs/source/contributor-guide/index.md b/docs/source/contributor-guide/index.md
index 5bb4e26b95..e42ab0dee0 100644
--- a/docs/source/contributor-guide/index.md
+++ b/docs/source/contributor-guide/index.md
@@ -221,9 +221,11 @@ Below is a checklist of what you need to do to add a new scalar function to Data
- 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.
-- In [core/tests/sql](../../../datafusion/core/tests/sql), add a new test where the function is called through SQL against well known data and returns the expected result.
+- In [core/tests/sqllogictests/test_files](../../../datafusion/core/tests/sqllogictests/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](../../../datafusion/core/tests/sqllogictests/README.md)
- In [expr/src/expr_fn.rs](../../../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](../../../docs/source/user-guide/sql/scalar_functions.md)
### How to add a new aggregate function
@@ -241,7 +243,9 @@ Below is a checklist of what you need to do to add a new aggregate function to D
- a new line in `signature` with the signature of the function (number and types of its arguments)
- a new line in `create_aggregate_expr` mapping the built-in to the implementation
- tests to the function.
-- In [tests/sql](../../../datafusion/core/tests/sql), add a new test where the function is called through SQL against well known data and returns the expected result.
+- In [core/tests/sqllogictests/test_files](../../../datafusion/core/tests/sqllogictests/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](../../../datafusion/core/tests/sqllogictests/README.md)
+- Add SQL reference documentation [here](../../../docs/source/user-guide/sql/aggregate_functions.md)
### How to display plans graphically