Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
velox committed Feb 10, 2024
1 parent 4fba352 commit 231a2c6
Show file tree
Hide file tree
Showing 124 changed files with 4,756 additions and 4,554 deletions.
21 changes: 7 additions & 14 deletions docs/_sources/functions/presto/array.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ Array Functions
SELECT array_sort(ARRAY [ARRAY [1, 2], ARRAY [1, null]]); -- failed: Ordering nulls is not supported

.. function:: array_sort(array(T), function(T,U)) -> array(T)
:noindex:

Returns the array sorted by values computed using specified lambda in ascending
order. U must be an orderable type. Null elements will be placed at the end of
Expand All @@ -186,7 +185,6 @@ Array Functions
SELECT array_sort(ARRAY [ARRAY [1, 2], ARRAY [1, null]]); -- failed: Ordering nulls is not supported

.. function:: array_sort_desc(array(T), function(T,U)) -> array(T)
:noindex:

Returns the array sorted by values computed using specified lambda in descending
order. U must be an orderable type. Null elements will be placed at the end of
Expand Down Expand Up @@ -223,9 +221,9 @@ Array Functions
When 'element' is of complex type, throws if 'x' or 'element' contains nested nulls
and these need to be compared to produce a result. ::

SELECT contains(ARRAY[ARRAY[1, 3]], ARRAY[2, null]); -- false.
SELECT contains(ARRAY[ARRAY[2, 3]], ARRAY[2, null]); -- failed: contains does not support arrays with elements that are null or contain null
SELECT contains(ARRAY[ARRAY[2, null]], ARRAY[2, 1]); -- failed: contains does not support arrays with elements that are null or contain null
SELECT contains(ARRAY[ARRAY[1, 3]], ARRAY[2, null]); -- false.
SELECT contains(ARRAY[ARRAY[2, 3]], ARRAY[2, null]); -- failed: contains does not support arrays with elements that are null or contain null
SELECT contains(ARRAY[ARRAY[2, null]], ARRAY[2, 1]); -- failed: contains does not support arrays with elements that are null or contain null

.. function:: element_at(array(E), index) -> E

Expand All @@ -249,7 +247,6 @@ Array Functions
for no-match and first-match-is-null cases.

.. function:: find_first(array(T), index, function(T,boolean)) -> E
:noindex:

Returns the first element of ``array`` that matches the predicate.
Returns ``NULL`` if no element matches the predicate.
Expand All @@ -271,7 +268,6 @@ Array Functions
Returns ``NULL`` if no such element exists.

.. function:: find_first_index(array(T), index, function(T,boolean)) -> BIGINT
:noindex:

Returns the 1-based index of the first element of ``array`` that matches the predicate.
Returns ``NULL`` if no such element exists.
Expand Down Expand Up @@ -308,9 +304,7 @@ Array Functions
the element, ``inputFunction`` takes the current state, initially
``initialState``, and returns the new state. ``outputFunction`` will be
invoked to turn the final state into the result value. It may be the
identity function (``i -> i``).

Throws if array has more than 10,000 elements. ::
identity function (``i -> i``). ::

SELECT reduce(ARRAY [], 0, (s, x) -> s + x, s -> s); -- 0
SELECT reduce(ARRAY [5, 20, 50], 0, (s, x) -> s + x, s -> s); -- 75
Expand All @@ -333,7 +327,7 @@ Array Functions

.. function:: shuffle(array(E)) -> array(E)

Generate a random permutation of the given ``array`` ::
Generate a random permutation of the given ``array``::

SELECT shuffle(ARRAY [1, 2, 3]); -- [3, 1, 2] or any other random permutation
SELECT shuffle(ARRAY [0, 0, 0]); -- [0, 0, 0]
Expand Down Expand Up @@ -381,7 +375,7 @@ Array Functions

.. function:: remove_nulls(x) -> array

Remove null values from an array ``array`` ::
Remove null values from an array ``array``::

SELECT remove_nulls(ARRAY[1, NULL, 3, NULL]); -- [1, 3]
SELECT remove_nulls(ARRAY[true, false, NULL]); -- [true, false]
Expand All @@ -398,8 +392,7 @@ Array Functions
.. function:: zip_with(array(T), array(U), function(T,U,R)) -> array(R)

Merges the two given arrays, element-wise, into a single array using ``function``.
If one array is shorter, nulls are appended at the end to match the length of the
longer array, before applying ``function`` ::
If one array is shorter, nulls are appended at the end to match the length of the longer array, before applying ``function``::

SELECT zip_with(ARRAY[1, 3, 5], ARRAY['a', 'b', 'c'], (x, y) -> (y, x)); -- [ROW('a', 1), ROW('b', 3), ROW('c', 5)]
SELECT zip_with(ARRAY[1, 2], ARRAY[3, 4], (x, y) -> x + y); -- [4, 6]
Expand Down
11 changes: 3 additions & 8 deletions docs/_sources/functions/presto/regexp.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ supports only a subset of PCRE syntax and in particular does not support
backtracking and associated features (e.g. back references).
See https://github.com/google/re2/wiki/Syntax for more information.

Compiling regular expressions is CPU intensive. Hence, each function is
limited to 20 different expressions per instance and thread of execution.

.. function:: like(string, pattern) -> boolean
like(string, pattern, escape) -> boolean

Expand All @@ -22,11 +19,9 @@ limited to 20 different expressions per instance and thread of execution.
wildcard '_' represents exactly one character.

Note: Each function instance allow for a maximum of 20 regular expressions to
be compiled per thread of execution. Not all patterns require
compilation of regular expressions. Patterns 'aaa', 'aaa%', '%aaa', where 'aaa'
contains only regular characters and '_' wildcards are evaluated without
using regular expressions. Only those patterns that require the compilation of
regular expressions are counted towards the limit.
be compiled throughout the lifetime of the query. Not all Patterns requires
compilation of regular expressions; for example a pattern 'aa' does not.
Only those that require the compilation of regular expressions are counted.

SELECT like('abc', '%b%'); -- true
SELECT like('a_c', '%#_%', '#'); -- true
Expand Down
12 changes: 0 additions & 12 deletions docs/_sources/functions/spark/array.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,6 @@ Array Functions
SELECT array_min(ARRAY [4.0, float('nan')]); -- 4.0
SELECT array_min(ARRAY [NULL, float('nan')]); -- NaN

.. spark:function:: array_repeat(element, count) -> array(E)
Returns an array containing ``element`` ``count`` times. If ``count`` is negative or zero,
returns empty array. If ``element`` is NULL, returns an array containing ``count`` NULLs.
If ``count`` is NULL, returns NULL as result. Throws an exception if ``count`` exceeds 10'000. ::

SELECT array_repeat(100, 3); -- [100, 100, 100]
SELECT array_repeat(NULL, 3); -- [NULL, NULL, NULL]
SELECT array_repeat(100, NULL); -- NULL
SELECT array_repeat(100, 0); -- []
SELECT array_repeat(100, -1); -- []

.. spark:function:: array_sort(array(E)) -> array(E)
Returns an array which has the sorted order of the input array(E). The elements of array(E) must
Expand Down
5 changes: 0 additions & 5 deletions docs/_sources/functions/spark/window.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,3 @@ Returns the rank of a value in a group of values. The rank is one plus the numbe
Returns the rank of a value in a group of values. This is similar to rank(), except that tie values do not produce gaps in the sequence.

.. spark:function:: ntile(n) -> integer
Divides the rows for each window partition into n buckets ranging from 1 to at most ``n``. Bucket values will differ by at most 1. If the number of rows in the partition does not divide evenly into the number of buckets, then the remainder values are distributed one per bucket, starting with the first bucket.

For example, with 6 rows and 4 buckets, the bucket values would be as follows: ``1 1 2 2 3 4``
55 changes: 25 additions & 30 deletions docs/_static/basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Sphinx stylesheet -- basic theme.
*
* :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS.
* :copyright: Copyright 2007-2023 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
Expand Down Expand Up @@ -237,6 +237,10 @@ a.headerlink {
visibility: hidden;
}

a:visited {
color: #551A8B;
}

h1:hover > a.headerlink,
h2:hover > a.headerlink,
h3:hover > a.headerlink,
Expand Down Expand Up @@ -324,17 +328,17 @@ aside.sidebar {
p.sidebar-title {
font-weight: bold;
}

nav.contents,
aside.topic,

div.admonition, div.topic, blockquote {
clear: left;
}

/* -- topics ---------------------------------------------------------------- */

nav.contents,
aside.topic,

div.topic {
border: 1px solid #ccc;
padding: 7px;
Expand Down Expand Up @@ -375,7 +379,6 @@ div.sidebar > :last-child,
aside.sidebar > :last-child,
nav.contents > :last-child,
aside.topic > :last-child,

div.topic > :last-child,
div.admonition > :last-child {
margin-bottom: 0;
Expand All @@ -385,7 +388,6 @@ div.sidebar::after,
aside.sidebar::after,
nav.contents::after,
aside.topic::after,

div.topic::after,
div.admonition::after,
blockquote::after {
Expand Down Expand Up @@ -611,25 +613,6 @@ ul.simple p {
margin-bottom: 0;
}

/* Docutils 0.17 and older (footnotes & citations) */
dl.footnote > dt,
dl.citation > dt {
float: left;
margin-right: 0.5em;
}

dl.footnote > dd,
dl.citation > dd {
margin-bottom: 0em;
}

dl.footnote > dd:after,
dl.citation > dd:after {
content: "";
clear: both;
}

/* Docutils 0.18+ (footnotes & citations) */
aside.footnote > span,
div.citation > span {
float: left;
Expand All @@ -654,8 +637,6 @@ div.citation > p:last-of-type:after {
clear: both;
}

/* Footnotes & citations ends */

dl.field-list {
display: grid;
grid-template-columns: fit-content(30%) auto;
Expand All @@ -668,10 +649,6 @@ dl.field-list > dt {
padding-right: 5px;
}

dl.field-list > dt:after {
content: ":";
}

dl.field-list > dd {
padding-left: 0.5em;
margin-top: 0em;
Expand All @@ -697,6 +674,16 @@ dd {
margin-left: 30px;
}

.sig dd {
margin-top: 0px;
margin-bottom: 0px;
}

.sig dl {
margin-top: 0px;
margin-bottom: 0px;
}

dl > dd:last-child,
dl > dd:last-child > :last-child {
margin-bottom: 0;
Expand Down Expand Up @@ -765,6 +752,14 @@ abbr, acronym {
cursor: help;
}

.translated {
background-color: rgba(207, 255, 207, 0.2)
}

.untranslated {
background-color: rgba(255, 207, 207, 0.2)
}

/* -- code displays --------------------------------------------------------- */

pre {
Expand Down
Loading

0 comments on commit 231a2c6

Please sign in to comment.