Skip to content

Commit 14d303f

Browse files
committed
replace numeric type to concrete type
1 parent 6ddeca4 commit 14d303f

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

docs/sql-ref-functions-builtin-aggregate.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ license: |
2020
---
2121

2222
Spark SQL provides build-in aggregate functions defined in the dataset API and SQL interface. Aggregate functions
23-
operate on a group of rows and return a single value.
23+
operate on a group of rows and return a single aggregated value.
2424

2525
<table class="table">
2626
<thead>
@@ -39,7 +39,7 @@ operate on a group of rows and return a single value.
3939
</tr>
4040
<tr>
4141
<td><b>{avg | mean}</b>(<i>expression</i>)</td>
42-
<td>numeric or string</td>
42+
<td>short, float, byte, decimal, double, int, long or string</td>
4343
<td>Returns the average of values in the input expression.</td>
4444
</tr>
4545
<tr>
@@ -79,7 +79,7 @@ operate on a group of rows and return a single value.
7979
</tr>
8080
<tr>
8181
<td><b>count_min_sketch</b>(<i>expression, eps, confidence, seed</i>)</td>
82-
<td>(integer or string or binary, double, double, integer)</td>
82+
<td>(byte, short, int, long, string or binary, double, double, integer)</td>
8383
<td>`eps` and `confidence` are the double values between 0.0 and 1.0, `seed` is a positive integer. Returns a count-min sketch of a expression with the given `esp`, `confidence` and `seed`. The result is an array of bytes, which can be deserialized to a `CountMinSketch` before usage. Count-min sketch is a probabilistic data structure used for cardinality estimation using sub-linear space.</td>
8484
</tr>
8585
<tr>
@@ -109,52 +109,52 @@ operate on a group of rows and return a single value.
109109
</tr>
110110
<tr>
111111
<td><b>max</b>(<i>expression</i>)</td>
112-
<td>any numeric, string, datetime or arrays of these types</td>
112+
<td>short, float, byte, decimal, double, int, long, string, date, timestamp or arrays of these types</td>
113113
<td>Returns the maximum value of the expression.</td>
114114
</tr>
115115
<tr>
116116
<td><b>max_by</b>(<i>expression1, expression2</i>)</td>
117-
<td>any numeric, string, datetime or arrays of these types</td>
117+
<td>short, float, byte, decimal, double, int, long, string, date, timestamp or arrays of these types</td>
118118
<td>Returns the value of expression1 associated with the maximum value of expression2.</td>
119119
</tr>
120120
<tr>
121121
<td><b>min</b>(<i>expression</i>)</td>
122-
<td>any numeric, string, datetime or arrays of these types</td>
122+
<td>short, float, byte, decimal, double, int, long, string, date, timestamp or arrays of these types</td>
123123
<td>Returns the minimum value of the expression.</td>
124124
</tr>
125125
<tr>
126126
<td><b>min_by</b>(<i>expression1, expression2</i>)</td>
127-
<td>any numeric, string, datetime or arrays of these types</td>
127+
<td>short, float, byte, decimal, double, int, long, string, date, timestamp or arrays of these types</td>
128128
<td>Returns the value of expression1 associated with the minimum value of expression2.</td>
129129
</tr>
130130
<tr>
131131
<td><b>percentile</b>(<i>expression, percentage [, frequency]</i>)</td>
132-
<td>numeric, double, integer</td>
132+
<td>short, float, byte, decimal, double, int, or long, double, int</td>
133133
<td>`percentage` is a number between 0 and 1; `frequency` is a positive integer. Returns the exact percentile value of numeric expression at the given percentage.</td>
134134
</tr>
135135
<tr>
136136
<td><b>percentile</b>(<i>expression, <b>array</b>(percentage1 [, percentage2]...) [, frequency]</i>)</td>
137-
<td>numeric, double, integer</td>
137+
<td>short, float, byte, decimal, double, int, or long, double, int</td>
138138
<td>Percentage array is an array of number between 0 and 1; `frequency` is a positive integer. Returns the exact percentile value array of numeric expression at the given percentage(s).</td>
139139
</tr>
140140
<tr>
141141
<td><b>{percentile_approx | percentile_approx}</b>(<i>expression, percentage [, frequency]</i>)</td>
142-
<td>numeric, double, integer</td>
142+
<td>short, float, byte, decimal, double, int, or long, double, int</td>
143143
<td>`percentage` is a number between 0 and 1; `frequency` is a positive integer. Returns the approximate percentile value of numeric expression at the given percentage.</td>
144144
</tr>
145145
<tr>
146146
<td><b>{percentile_approx | percentile_approx}</b>(<i>expression, percentage [, frequency]</i>)</td>
147-
<td>datetime, double, integer</td>
147+
<td>date or timestamp, double, int</td>
148148
<td>`percentage` is a number between 0 and 1; `frequency` is a positive integer. Returns the approximate percentile value of numeric expression at the given percentage.</td>
149149
</tr>
150150
<tr>
151151
<td><b>{percentile_approx | percentile_approx}</b>(<i>expression, <b>array</b>(percentage1 [, percentage2]...) [, frequency]</i>)</td>
152-
<td>numeric, double, integer</td>
152+
<td>short, float, byte, decimal, double, int, or long, double, int</td>
153153
<td>`percentage` is a number between 0 and 1; `frequency` is a positive integer. Returns the approximate percentile value of numeric expression at the given percentage.</td>
154154
</tr>
155155
<tr>
156156
<td><b>{percentile_approx | percentile_approx}</b>(<i>expression, <b>array</b>(percentage1 [, percentage2]...) [, frequency]</i>)</td>
157-
<td>datetime , double, integer</td>
157+
<td>date or timestamp, double, int</td>
158158
<td>`percentage` is a number between 0 and 1; `frequency` is a positive integer. Returns the approximate percentile value of numeric expression at the given percentage.</td>
159159
</tr>
160160
<tr>
@@ -174,7 +174,7 @@ operate on a group of rows and return a single value.
174174
</tr>
175175
<tr>
176176
<td><b>sum</b>(<i>expression</i>)</td>
177-
<td>numeric</td>
177+
<td>short, float, byte, decimal, double, int, or long</td>
178178
<td>Returns the sum calculated from values of a group.</td>
179179
</tr>
180180
<tr>

0 commit comments

Comments
 (0)