Skip to content

Commit 484b00e

Browse files
committed
Fix formatting in /functions/
1 parent 274e05a commit 484b00e

File tree

4 files changed

+93
-93
lines changed

4 files changed

+93
-93
lines changed

presto-docs/src/main/sphinx/functions/aggregate.rst

Lines changed: 62 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -135,17 +135,17 @@ General Aggregate Functions
135135
``combineFunction`` is `commutative <https://en.wikipedia.org/wiki/Commutative_property>`_
136136
and `associative <https://en.wikipedia.org/wiki/Associative_property>`_
137137
operation with ``initialState`` as the
138-
`identity <https://en.wikipedia.org/wiki/Identity_element>`_ value.
138+
`identity <https://en.wikipedia.org/wiki/Identity_element>`_ value.::
139139

140-
combineFunction(s, initialState) = s for any s
140+
combineFunction(s, initialState) = s for any s
141141

142-
combineFunction(s1, s2) = combineFunction(s2, s1) for any s1 and s2
142+
combineFunction(s1, s2) = combineFunction(s2, s1) for any s1 and s2
143143

144-
combineFunction(s1, combineFunction(s2, s3)) = combineFunction(combineFunction(s1, s2), s3) for any s1, s2, s3
144+
combineFunction(s1, combineFunction(s2, s3)) = combineFunction(combineFunction(s1, s2), s3) for any s1, s2, s3
145145

146-
In addition, make sure that the following holds for the inputFunction:
146+
In addition, make sure that the following holds for the inputFunction::
147147

148-
inputFunction(inputFunction(initialState, x), y) = combineFunction(inputFunction(initialState, x), inputFunction(initialState, y)) for any x and y
148+
inputFunction(inputFunction(initialState, x), y) = combineFunction(inputFunction(initialState, x), inputFunction(initialState, y)) for any x and y
149149

150150
::
151151

@@ -511,62 +511,62 @@ classification thresholds. They are meant to be used in conjunction.
511511

512512
For example, to find the `precision-recall curve <https://en.wikipedia.org/wiki/Precision_and_recall>`_, use
513513

514-
.. code-block:: none
514+
.. code-block:: none
515515
516-
WITH
517-
recall_precision AS (
518-
SELECT
519-
CLASSIFICATION_RECALL(10000, correct, pred) AS recalls,
520-
CLASSIFICATION_PRECISION(10000, correct, pred) AS precisions
521-
FROM
522-
classification_dataset
523-
)
524-
SELECT
525-
recall,
526-
precision
527-
FROM
528-
recall_precision
529-
CROSS JOIN UNNEST(recalls, precisions) AS t(recall, precision)
516+
WITH
517+
recall_precision AS (
518+
SELECT
519+
CLASSIFICATION_RECALL(10000, correct, pred) AS recalls,
520+
CLASSIFICATION_PRECISION(10000, correct, pred) AS precisions
521+
FROM
522+
classification_dataset
523+
)
524+
SELECT
525+
recall,
526+
precision
527+
FROM
528+
recall_precision
529+
CROSS JOIN UNNEST(recalls, precisions) AS t(recall, precision)
530530
531531
To get the corresponding thresholds for these values, use
532532

533-
.. code-block:: none
533+
.. code-block:: none
534534
535-
WITH
536-
recall_precision AS (
537-
SELECT
538-
CLASSIFICATION_THRESHOLDS(10000, correct, pred) AS thresholds,
539-
CLASSIFICATION_RECALL(10000, correct, pred) AS recalls,
540-
CLASSIFICATION_PRECISION(10000, correct, pred) AS precisions
541-
FROM
542-
classification_dataset
543-
)
544-
SELECT
545-
threshold,
546-
recall,
547-
precision
548-
FROM
549-
recall_precision
550-
CROSS JOIN UNNEST(thresholds, recalls, precisions) AS t(threshold, recall, precision)
535+
WITH
536+
recall_precision AS (
537+
SELECT
538+
CLASSIFICATION_THRESHOLDS(10000, correct, pred) AS thresholds,
539+
CLASSIFICATION_RECALL(10000, correct, pred) AS recalls,
540+
CLASSIFICATION_PRECISION(10000, correct, pred) AS precisions
541+
FROM
542+
classification_dataset
543+
)
544+
SELECT
545+
threshold,
546+
recall,
547+
precision
548+
FROM
549+
recall_precision
550+
CROSS JOIN UNNEST(thresholds, recalls, precisions) AS t(threshold, recall, precision)
551551
552552
To find the `ROC curve <https://en.wikipedia.org/wiki/Receiver_operating_characteristic>`_, use
553553

554-
.. code-block:: none
554+
.. code-block:: none
555555
556-
WITH
557-
fallout_recall AS (
558-
SELECT
559-
CLASSIFICATION_FALLOUT(10000, correct, pred) AS fallouts,
560-
CLASSIFICATION_RECALL(10000, correct, pred) AS recalls
561-
FROM
562-
classification_dataset
563-
)
564-
SELECT
565-
fallout
566-
recall,
567-
FROM
568-
recall_fallout
569-
CROSS JOIN UNNEST(fallouts, recalls) AS t(fallout, recall)
556+
WITH
557+
fallout_recall AS (
558+
SELECT
559+
CLASSIFICATION_FALLOUT(10000, correct, pred) AS fallouts,
560+
CLASSIFICATION_RECALL(10000, correct, pred) AS recalls
561+
FROM
562+
classification_dataset
563+
)
564+
SELECT
565+
fallout
566+
recall,
567+
FROM
568+
recall_fallout
569+
CROSS JOIN UNNEST(fallouts, recalls) AS t(fallout, recall)
570570
571571
572572
.. function:: classification_miss_rate(buckets, y, x, weight) -> array<double>
@@ -725,10 +725,10 @@ where :math:`f(x)` is the partial density function of :math:`x`.
725725

726726
.. code-block:: none
727727
728-
SELECT
729-
differential_entropy(1000000, x)
730-
FROM
731-
data
728+
SELECT
729+
differential_entropy(1000000, x)
730+
FROM
731+
data
732732
733733
.. note::
734734

@@ -807,12 +807,12 @@ where :math:`f(x)` is the partial density function of :math:`x`.
807807
To find the differential entropy of ``x``, each between ``-2.0`` and ``2.0``,
808808
with weights ``weight`` of ``data`` using 1000000 buckets and maximum-likelihood estimates, use
809809

810-
.. code-block:: none
810+
.. code-block:: none
811811
812-
SELECT
813-
differential_entropy(1000000, x, weight, 'fixed_histogram_mle', -2.0, 2.0)
814-
FROM
815-
data
812+
SELECT
813+
differential_entropy(1000000, x, weight, 'fixed_histogram_mle', -2.0, 2.0)
814+
FROM
815+
data
816816
817817
.. note::
818818

presto-docs/src/main/sphinx/functions/comparison.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ The LIKE operator is used to match a specified character pattern in a string. Pa
160160
regular characters as well as wildcards. Wildcard characters can be escaped using the single character
161161
specified for the ESCAPE parameter. Matching is case sensitive, and the pattern must match the whole string.
162162

163-
Syntax:
163+
Syntax::
164164

165165
expression LIKE pattern [ ESCAPE 'escape_character' ]
166166

presto-docs/src/main/sphinx/functions/conditional.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ IF
5555
The ``IF`` function is actually a language construct
5656
that is equivalent to the following ``CASE`` expression:
5757

58-
.. code-block:: none
58+
.. code-block:: none
5959
60-
CASE
61-
WHEN condition THEN true_value
62-
[ ELSE false_value ]
63-
END
60+
CASE
61+
WHEN condition THEN true_value
62+
[ ELSE false_value ]
63+
END
6464
6565
.. function:: if(condition, true_value)
6666

presto-docs/src/main/sphinx/functions/setdigest.rst

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -65,49 +65,49 @@ Functions
6565

6666
Composes all input values of ``x`` into a ``setdigest``.
6767

68-
Examples::
68+
Examples:
6969

70-
Create a ``setdigest`` corresponding to a ``bigint`` array::
70+
Create a ``setdigest`` corresponding to a ``bigint`` array::
7171

72-
SELECT make_set_digest(value)
73-
FROM (VALUES 1, 2, 3) T(value);
72+
SELECT make_set_digest(value)
73+
FROM (VALUES 1, 2, 3) T(value);
7474

75-
Create a ``setdigest`` corresponding to a ``varchar`` array::
75+
Create a ``setdigest`` corresponding to a ``varchar`` array::
7676

77-
SELECT make_set_digest(value)
78-
FROM (VALUES 'Presto', 'SQL', 'on', 'everything') T(value);
77+
SELECT make_set_digest(value)
78+
FROM (VALUES 'Presto', 'SQL', 'on', 'everything') T(value);
7979

8080

8181
.. function:: merge_set_digest(setdigest) -> setdigest
8282

8383
Returns the ``setdigest`` of the aggregate union of the individual ``setdigest`` structures.
8484

85-
Examples::
85+
Example::
8686

87-
SELECT merge_set_digest(a) from (SELECT make_set_digest(value) as a FROM (VALUES 4,3,2,1) T(value));
87+
SELECT merge_set_digest(a) from (SELECT make_set_digest(value) as a FROM (VALUES 4,3,2,1) T(value));
8888

8989
.. function:: cardinality(setdigest) -> bigint
9090

9191
Returns the cardinality of the set digest from its internal
9292
``HyperLogLog`` component.
9393

94-
Examples::
94+
Example::
9595

96-
SELECT cardinality(make_set_digest(value))
97-
FROM (VALUES 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5) T(value);
98-
-- 5
96+
SELECT cardinality(make_set_digest(value))
97+
FROM (VALUES 1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5) T(value);
98+
-- 5
9999

100100
.. function:: intersection_cardinality(x,y) -> bigint
101101

102102
Returns the estimation for the cardinality of the intersection of the two set digests.
103103

104104
``x`` and ``y`` be of type ``setdigest``
105105

106-
Examples::
106+
Example::
107107

108-
SELECT intersection_cardinality(make_set_digest(v1), make_set_digest(v2))
109-
FROM (VALUES (1, 1), (NULL, 2), (2, 3), (3, 4)) T(v1, v2);
110-
-- 3
108+
SELECT intersection_cardinality(make_set_digest(v1), make_set_digest(v2))
109+
FROM (VALUES (1, 1), (NULL, 2), (2, 3), (3, 4)) T(v1, v2);
110+
-- 3
111111

112112
.. function:: jaccard_index(x, y) -> double
113113

@@ -116,11 +116,11 @@ the two set digests.
116116

117117
``x`` and ``y`` be of type ``setdigest``.
118118

119-
Examples::
119+
Example::
120120

121-
SELECT jaccard_index(make_set_digest(v1), make_set_digest(v2))
122-
FROM (VALUES (1, 1), (NULL,2), (2, 3), (NULL, 4)) T(v1, v2);
123-
-- 0.5
121+
SELECT jaccard_index(make_set_digest(v1), make_set_digest(v2))
122+
FROM (VALUES (1, 1), (NULL,2), (2, 3), (NULL, 4)) T(v1, v2);
123+
-- 0.5
124124

125125
.. function:: hash_counts(x) -> map(bigint, smallint)
126126

@@ -130,8 +130,8 @@ the internal ``MinHash`` structure belonging to ``x`` or varchar
130130

131131
``x`` must be of type ``setdigest``.
132132

133-
Examples::
133+
Example::
134134

135-
SELECT hash_counts(make_set_digest(value))
136-
FROM (VALUES 1, 1, 1, 2, 2) T(value);
137-
-- {19144387141682250=3, -2447670524089286488=2}
135+
SELECT hash_counts(make_set_digest(value))
136+
FROM (VALUES 1, 1, 1, 2, 2) T(value);
137+
-- {19144387141682250=3, -2447670524089286488=2}

0 commit comments

Comments
 (0)