You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by vo...@apache.org on 2023/06/01 23:52:17 UTC
[druid] branch 26.0.0 updated (855e576e87 -> 3cb5974f7d)
This is an automated email from the ASF dual-hosted git repository.
vogievetsky pushed a change to branch 26.0.0
in repository https://gitbox.apache.org/repos/asf/druid.git
from 855e576e87 Docs: Tutorial for streaming ingestion using Kafka + Docker file to use with Jupyter tutorials (#13984) (#14289)
new 2bb706bc7b docs: add sql array functions to nav (#14361)
new 3cb5974f7d Docs: fix broken link to Python API jupyter notebook (#14332)
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
docs/querying/sql-array-functions.md | 6 +-
docs/querying/sql-functions.md | 105 +++++++++++++++++++++++
docs/querying/sql-multivalue-string-functions.md | 2 +-
docs/tutorials/tutorial-jupyter-index.md | 2 +-
website/.spelling | 1 +
website/sidebars.json | 1 +
6 files changed, 113 insertions(+), 4 deletions(-)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
[druid] 01/02: docs: add sql array functions to nav (#14361)
Posted by vo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
vogievetsky pushed a commit to branch 26.0.0
in repository https://gitbox.apache.org/repos/asf/druid.git
commit 2bb706bc7bc0b5bb440cc98baa91bc0f8cfd26fe
Author: 317brian <53...@users.noreply.github.com>
AuthorDate: Thu Jun 1 16:45:27 2023 -0700
docs: add sql array functions to nav (#14361)
* docs: add sql array functions to nav
* fix typo
* add sql array functions to list
* fix spelling errors
---
docs/querying/sql-array-functions.md | 6 +-
docs/querying/sql-functions.md | 105 +++++++++++++++++++++++
docs/querying/sql-multivalue-string-functions.md | 2 +-
website/.spelling | 1 +
website/sidebars.json | 1 +
5 files changed, 112 insertions(+), 3 deletions(-)
diff --git a/docs/querying/sql-array-functions.md b/docs/querying/sql-array-functions.md
index ed7d51b9e8..06ea8bd3f4 100644
--- a/docs/querying/sql-array-functions.md
+++ b/docs/querying/sql-array-functions.md
@@ -34,11 +34,13 @@ sidebar_label: "Array functions"
> Apache Druid supports two query languages: Druid SQL and [native queries](querying.md).
> This document describes the SQL language.
-This page describes the operations you can perform on arrays using [Druid SQL](./sql.md). See [`ARRAY` data type documentation](./sql-data-types.md#arrays) for additional details.
+This page describes the operations you can perform on arrays using [Druid SQL](./sql.md). See [`ARRAY` data type documentation](./sql-data-types.md#arrays) for additional details.
All array references in the array function documentation can refer to multi-value string columns or `ARRAY` literals. These functions are largely
identical to the [multi-value string functions](sql-multivalue-string-functions.md), but use `ARRAY` types and behavior.
+The following table describes array functions. To learn more about array aggregation functions, see [SQL aggregation functions](./sql-aggregations.md).
+
|Function|Description|
|--------|-----|
|`ARRAY[expr1, expr2, ...]`|Constructs a SQL `ARRAY` literal from the expression arguments, using the type of the first argument as the output array type.|
@@ -54,4 +56,4 @@ identical to the [multi-value string functions](sql-multivalue-string-functions.
|`ARRAY_CONCAT(arr1, arr2)`|Concatenates `arr2` to `arr1`. The resulting array type is determined by the type of `arr1`.|
|`ARRAY_SLICE(arr, start, end)`|Returns the subarray of `arr` from the 0-based index `start` (inclusive) to `end` (exclusive). Returns `null`, if `start` is less than 0, greater than length of `arr`, or greater than `end`.|
|`ARRAY_TO_STRING(arr, str)`|Joins all elements of `arr` by the delimiter specified by `str`.|
-|`STRING_TO_ARRAY(str1, str2)`|Splits `str1` into an array on the delimiter specified by `str2`.|
+|`STRING_TO_ARRAY(str1, str2)`|Splits `str1` into an array on the delimiter specified by `str2`, which is a regular expression.|
diff --git a/docs/querying/sql-functions.md b/docs/querying/sql-functions.md
index 9f5a82deb1..475a1e2aa7 100644
--- a/docs/querying/sql-functions.md
+++ b/docs/querying/sql-functions.md
@@ -128,6 +128,22 @@ Constructs a SQL ARRAY literal from the expression arguments. The arguments must
Returns an array of all values of the specified expression.
+## ARRAY_APPEND
+
+`ARRAY_APPEND(arr1, expr)`
+
+**Function type:** [Array](./sql-array-functions.md)
+
+Appends `expr` to `arr`, the resulting array type determined by the type of `arr1`.
+
+## ARRAY_CONCAT
+
+`ARRAY_CONCAT(arr1, arr2)`
+
+**Function type:** [Array](./sql-array-functions.md)
+
+Concatenates `arr2` to `arr1`. The resulting array type is determined by the type of `arr1`.|
+
## ARRAY_CONCAT_AGG
`ARRAY_CONCAT_AGG([DISTINCT] expr, [<NUMERIC>])`
@@ -136,6 +152,86 @@ Returns an array of all values of the specified expression.
Concatenates array inputs into a single array.
+## ARRAY_CONTAINS
+
+`ARRAY_CONTAINS(arr, expr)`
+
+**Function type:** [Array](./sql-array-functions.md)
+
+If `expr` is a scalar type, returns 1 if `arr` contains `expr`. If `expr` is an array, returns 1 if `arr` contains all elements of `expr`. Otherwise returns 0.
+
+
+## ARRAY_LENGTH
+
+`ARRAY_LENGTH(arr)`
+
+**Function type:** [Array](./sql-array-functions.md)
+
+Returns length of the array expression.
+
+## ARRAY_OFFSET
+
+`ARRAY_OFFSET(arr, long)`
+
+**Function type:** [Array](./sql-array-functions.md)
+
+Returns the array element at the 0-based index supplied, or null for an out of range index.
+
+## ARRAY_OFFSET_OF
+
+`ARRAY_OFFSET_OF(arr, expr)`
+
+**Function type:** [Array](./sql-array-functions.md)
+
+Returns the 0-based index of the first occurrence of `expr` in the array. If no matching elements exist in the array, returns `-1` or `null` if `druid.generic.useDefaultValueForNull=false`.
+
+## ARRAY_ORDINAL
+
+**Function type:** [Array](./sql-array-functions.md)
+
+`ARRAY_ORDINAL(arr, long)`
+
+Returns the array element at the 1-based index supplied, or null for an out of range index.
+## ARRAY_ORDINAL_OF
+
+`ARRAY_ORDINAL_OF(arr, expr)`
+
+**Function type:** [Array](./sql-array-functions.md)
+
+Returns the 1-based index of the first occurrence of `expr` in the array. If no matching elements exist in the array, returns `-1` or `null` if `druid.generic.useDefaultValueForNull=false`.|
+
+## ARRAY_OVERLAP
+
+`ARRAY_OVERLAP(arr1, arr2)`
+
+**Function type:** [Array](./sql-array-functions.md)
+
+Returns 1 if `arr1` and `arr2` have any elements in common, else 0.|
+
+## ARRAY_PREPEND
+
+`ARRAY_PREPEND(expr, arr)`
+
+**Function type:** [Array](./sql-array-functions.md)
+
+Prepends `expr` to `arr` at the beginning, the resulting array type determined by the type of `arr`.
+
+## ARRAY_SLICE
+
+`ARRAY_SLICE(arr, start, end)`
+
+**Function type:** [Array](./sql-array-functions.md)
+
+Returns the subarray of `arr` from the 0-based index `start` (inclusive) to `end` (exclusive). Returns `null`, if `start` is less than 0, greater than length of `arr`, or greater than `end`.
+
+## ARRAY_TO_STRING
+
+`ARRAY_TO_STRING(arr, str)`
+
+**Function type:** [Array](./sql-array-functions.md)
+
+Joins all elements of `arr` by the delimiter specified by `str`.
+
## ASIN
`ASIN(<NUMERIC>)`
@@ -1149,6 +1245,15 @@ Calculates the sample standard deviation of a set of values.
Collects all values of an expression into a single string.
+## STRING_TO_ARRAY
+
+`STRING_TO_ARRAY(str1, str2)`
+
+**Function type:** [Array](sql-array-functions.md)
+
+Splits `str1` into an array on the delimiter specified by `str2`, which is a regular expression.
+
+
## STRING_FORMAT
`STRING_FORMAT(pattern[, args...])`
diff --git a/docs/querying/sql-multivalue-string-functions.md b/docs/querying/sql-multivalue-string-functions.md
index d0d9040a24..821f966d7d 100644
--- a/docs/querying/sql-multivalue-string-functions.md
+++ b/docs/querying/sql-multivalue-string-functions.md
@@ -59,5 +59,5 @@ additional details about `ARRAY` types, see [`ARRAY` data type documentation](./
|`MV_CONCAT(arr1, arr2)`|Concatenates `arr2` to `arr1`. The resulting array type is determined by the type of `arr1`.|
|`MV_SLICE(arr, start, end)`|Returns the subarray of `arr` from the 0-based index start(inclusive) to end(exclusive), or `null`, if start is less than 0, greater than length of arr or greater than end.|
|`MV_TO_STRING(arr, str)`|Joins all elements of `arr` by the delimiter specified by `str`.|
-|`STRING_TO_MV(str1, str2)`|Splits `str1` into an array on the delimiter specified by `str2`.|
+|`STRING_TO_MV(str1, str2)`|Splits `str1` into an array on the delimiter specified by `str2`, which is a regular expression.|
|`MV_TO_ARRAY(str)`|Converts a multi-value string from a `VARCHAR` to a `VARCHAR ARRAY`.|
diff --git a/website/.spelling b/website/.spelling
index 6126a38f2a..d279989431 100644
--- a/website/.spelling
+++ b/website/.spelling
@@ -552,6 +552,7 @@ znodes
APPROX_COUNT_DISTINCT
APPROX_QUANTILE
ARRAY_AGG
+ARRAY_TO_MV
BIGINT
CATALOG_NAME
CHARACTER_MAXIMUM_LENGTH
diff --git a/website/sidebars.json b/website/sidebars.json
index f1ab145c04..9245a5768a 100644
--- a/website/sidebars.json
+++ b/website/sidebars.json
@@ -102,6 +102,7 @@
"querying/sql-operators",
"querying/sql-scalar",
"querying/sql-aggregations",
+ "querying/sql-array-functions",
"querying/sql-multivalue-string-functions",
"querying/sql-json-functions",
"querying/sql-functions",
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
[druid] 02/02: Docs: fix broken link to Python API jupyter notebook (#14332)
Posted by vo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
vogievetsky pushed a commit to branch 26.0.0
in repository https://gitbox.apache.org/repos/asf/druid.git
commit 3cb5974f7d331f5f11918bdd2543cda4d4177461
Author: 317brian <53...@users.noreply.github.com>
AuthorDate: Tue May 30 19:42:27 2023 -0700
Docs: fix broken link to Python API jupyter notebook (#14332)
---
docs/tutorials/tutorial-jupyter-index.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/tutorials/tutorial-jupyter-index.md b/docs/tutorials/tutorial-jupyter-index.md
index d7f401cae5..458c914eaa 100644
--- a/docs/tutorials/tutorial-jupyter-index.md
+++ b/docs/tutorials/tutorial-jupyter-index.md
@@ -55,7 +55,7 @@ topics and use a simple set of Python wrappers around the underlying REST API. T
wrappers reside in the `druidapi` package within the notebooks directory. While the package
can be used in any Python program, the key purpose, at present, is to support these
notebooks. See
-[Introduction to the Druid Python API](https://github.com/apache/druid/tree/master/examples/quickstart/jupyter-notebooks/python-api-tutorial.ipynb)
+[Introduction to the Druid Python API](https://github.com/apache/druid/blob/master/examples/quickstart/jupyter-notebooks/Python_API_Tutorial.ipynb)
for an overview of the Python API.
The `druidapi` package is already installed in the custom Jupyter Docker container for Druid tutorials.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org