Edit on GitHub

sqlglot expressions - aggregate, window, and statistical functions.

  1"""sqlglot expressions - aggregate, window, and statistical functions."""
  2
  3from __future__ import annotations
  4
  5from sqlglot.expressions.core import Expression, Func, AggFunc, Binary
  6
  7
  8class Agg(Expression, AggFunc):
  9    @property
 10    def output_name(self) -> str:
 11        return self.this.name
 12
 13
 14class AIAgg(Expression, AggFunc):
 15    arg_types = {"this": True, "expression": True}
 16    _sql_names = ["AI_AGG"]
 17
 18
 19class AISummarizeAgg(Expression, AggFunc):
 20    _sql_names = ["AI_SUMMARIZE_AGG"]
 21
 22
 23class AnyValue(Expression, AggFunc):
 24    pass
 25
 26
 27class ApproximateSimilarity(Expression, AggFunc):
 28    _sql_names = ["APPROXIMATE_SIMILARITY", "APPROXIMATE_JACCARD_INDEX"]
 29
 30
 31class ApproxPercentileAccumulate(Expression, AggFunc):
 32    pass
 33
 34
 35class ApproxPercentileCombine(Expression, AggFunc):
 36    pass
 37
 38
 39class ApproxPercentileEstimate(Expression, Func):
 40    arg_types = {"this": True, "percentile": True}
 41
 42
 43class ApproxQuantiles(Expression, AggFunc):
 44    arg_types = {"this": True, "expression": False}
 45
 46
 47class ApproxTopK(Expression, AggFunc):
 48    arg_types = {"this": True, "expression": False, "counters": False}
 49
 50
 51class ApproxTopKAccumulate(Expression, AggFunc):
 52    arg_types = {"this": True, "expression": False}
 53
 54
 55class ApproxTopKCombine(Expression, AggFunc):
 56    arg_types = {"this": True, "expression": False}
 57
 58
 59class ApproxTopKEstimate(Expression, Func):
 60    arg_types = {"this": True, "expression": False}
 61
 62
 63class ApproxTopSum(Expression, AggFunc):
 64    arg_types = {"this": True, "expression": True, "count": True}
 65
 66
 67class ArgMax(Expression, AggFunc):
 68    arg_types = {"this": True, "expression": True, "count": False, "include_nulls": False}
 69    _sql_names = ["ARG_MAX", "ARGMAX", "MAX_BY"]
 70
 71
 72class ArgMin(Expression, AggFunc):
 73    arg_types = {"this": True, "expression": True, "count": False, "include_nulls": False}
 74    _sql_names = ["ARG_MIN", "ARGMIN", "MIN_BY"]
 75
 76
 77class ArrayAgg(Expression, AggFunc):
 78    arg_types = {"this": True, "nulls_excluded": False, "null_on_empty": False}
 79
 80
 81class ArrayConcatAgg(Expression, AggFunc):
 82    pass
 83
 84
 85class ArrayUnionAgg(Expression, AggFunc):
 86    pass
 87
 88
 89class ArrayUniqueAgg(Expression, AggFunc):
 90    pass
 91
 92
 93class Avg(Expression, AggFunc):
 94    pass
 95
 96
 97class Corr(Expression, AggFunc, Binary):
 98    # Correlation divides by variance(column). If a column has 0 variance, the denominator
 99    # is 0 - some dialects return NaN (DuckDB) while others return NULL (Snowflake).
100    # `null_on_zero_variance` is set to True at parse time for dialects that return NULL.
101    arg_types = {"this": True, "expression": True, "null_on_zero_variance": False}
102
103
104class Count(Expression, AggFunc):
105    arg_types = {"this": False, "expressions": False, "big_int": False}
106    is_var_len_args = True
107
108
109class CountIf(Expression, AggFunc):
110    _sql_names = ["COUNT_IF", "COUNTIF"]
111    arg_types = {"this": True, "zero_on_all_null": False}
112
113
114class CovarPop(Expression, AggFunc):
115    arg_types = {"this": True, "expression": True}
116
117
118class CovarSamp(Expression, AggFunc):
119    arg_types = {"this": True, "expression": True}
120
121
122class CumeDist(Expression, AggFunc):
123    arg_types = {"expressions": False}
124    is_var_len_args = True
125
126
127class DenseRank(Expression, AggFunc):
128    arg_types = {"expressions": False}
129    is_var_len_args = True
130
131
132class First(Expression, AggFunc):
133    arg_types = {"this": True, "expression": False}
134
135
136class FirstValue(Expression, AggFunc):
137    pass
138
139
140class GroupConcat(Expression, AggFunc):
141    arg_types = {
142        "this": True,
143        "separator": False,
144        "on_overflow": False,
145        "null_separator_is_empty": False,
146        "empty_string_on_empty": False,
147    }
148
149
150class Grouping(Expression, AggFunc):
151    arg_types = {"expressions": True}
152    is_var_len_args = True
153
154
155class GroupingId(Expression, AggFunc):
156    arg_types = {"expressions": False}
157    is_var_len_args = True
158
159
160class Kurtosis(Expression, AggFunc):
161    pass
162
163
164class Lag(Expression, AggFunc):
165    arg_types = {"this": True, "offset": False, "default": False}
166
167
168class Last(Expression, AggFunc):
169    arg_types = {"this": True, "expression": False}
170
171
172class LastValue(Expression, AggFunc):
173    pass
174
175
176class Lead(Expression, AggFunc):
177    arg_types = {"this": True, "offset": False, "default": False}
178
179
180class LogicalAnd(Expression, AggFunc):
181    _sql_names = ["LOGICAL_AND", "BOOL_AND", "BOOLAND_AGG"]
182
183
184class LogicalOr(Expression, AggFunc):
185    _sql_names = ["LOGICAL_OR", "BOOL_OR", "BOOLOR_AGG"]
186
187
188class Max(Expression, AggFunc):
189    arg_types = {"this": True, "expressions": False, "count": False}
190    is_var_len_args = True
191
192
193class Median(Expression, AggFunc):
194    pass
195
196
197class Min(Expression, AggFunc):
198    arg_types = {"this": True, "expressions": False, "count": False}
199    is_var_len_args = True
200
201
202class Minhash(Expression, AggFunc):
203    arg_types = {"this": True, "expressions": True}
204    is_var_len_args = True
205
206
207class MinhashCombine(Expression, AggFunc):
208    pass
209
210
211class Mode(Expression, AggFunc):
212    arg_types = {"this": False, "deterministic": False}
213
214
215class Ntile(Expression, AggFunc):
216    arg_types = {"this": False}
217
218
219class NthValue(Expression, AggFunc):
220    arg_types = {"this": True, "offset": True, "from_first": False}
221
222
223class ObjectAgg(Expression, AggFunc):
224    arg_types = {"this": True, "expression": False}
225
226
227class PercentileCont(Expression, AggFunc):
228    arg_types = {"this": True, "expression": False}
229
230
231class PercentileDisc(Expression, AggFunc):
232    arg_types = {"this": True, "expression": False}
233
234
235PERCENTILES = (PercentileCont, PercentileDisc)
236
237
238class PercentRank(Expression, AggFunc):
239    arg_types = {"expressions": False}
240    is_var_len_args = True
241
242
243class Quantile(Expression, AggFunc):
244    arg_types = {"this": True, "quantile": True}
245
246
247class ApproxQuantile(Quantile):
248    arg_types = {
249        "this": True,
250        "quantile": True,
251        "accuracy": False,
252        "weight": False,
253        "error_tolerance": False,
254    }
255
256
257class Rank(Expression, AggFunc):
258    arg_types = {"expressions": False}
259    is_var_len_args = True
260
261
262class RegrAvgx(Expression, AggFunc):
263    arg_types = {"this": True, "expression": True}
264
265
266class RegrAvgy(Expression, AggFunc):
267    arg_types = {"this": True, "expression": True}
268
269
270class RegrCount(Expression, AggFunc):
271    arg_types = {"this": True, "expression": False}
272
273
274class RegrIntercept(Expression, AggFunc):
275    arg_types = {"this": True, "expression": False}
276
277
278class RegrR2(Expression, AggFunc):
279    arg_types = {"this": True, "expression": False}
280
281
282class RegrSlope(Expression, AggFunc):
283    arg_types = {"this": True, "expression": False}
284
285
286class RegrSxx(Expression, AggFunc):
287    arg_types = {"this": True, "expression": True}
288
289
290class RegrSxy(Expression, AggFunc):
291    arg_types = {"this": True, "expression": True}
292
293
294class RegrSyy(Expression, AggFunc):
295    arg_types = {"this": True, "expression": True}
296
297
298class RegrValx(Expression, AggFunc):
299    arg_types = {"this": True, "expression": True}
300
301
302class RegrValy(Expression, AggFunc):
303    arg_types = {"this": True, "expression": True}
304
305
306class RowNumber(Expression, Func):
307    arg_types = {"this": False}
308
309
310class Skewness(Expression, AggFunc):
311    pass
312
313
314class Stddev(Expression, AggFunc):
315    _sql_names = ["STDDEV", "STDEV"]
316
317
318class StddevPop(Expression, AggFunc):
319    pass
320
321
322class StddevSamp(Expression, AggFunc):
323    pass
324
325
326class Sum(Expression, AggFunc):
327    pass
328
329
330class Variance(Expression, AggFunc):
331    # single_value_returns_zero: Oracle's VARIANCE returns 0 instead of NULL for a single value
332    arg_types = {"this": True, "single_value_returns_zero": False}
333    _sql_names = ["VARIANCE", "VARIANCE_SAMP", "VAR_SAMP"]
334
335
336class VariancePop(Expression, AggFunc):
337    _sql_names = ["VARIANCE_POP", "VAR_POP"]
 9class Agg(Expression, AggFunc):
10    @property
11    def output_name(self) -> str:
12        return self.this.name
output_name: str
10    @property
11    def output_name(self) -> str:
12        return self.this.name

Name of the output column if this expression is a selection.

If the Expr has no output name, an empty string is returned.

Example:
>>> from sqlglot import parse_one
>>> parse_one("SELECT a").expressions[0].output_name
'a'
>>> parse_one("SELECT b AS c").expressions[0].output_name
'c'
>>> parse_one("SELECT 1 + 2").expressions[0].output_name
''
key: ClassVar[str] = 'agg'
required_args: 't.ClassVar[set[str]]' = {'this'}
15class AIAgg(Expression, AggFunc):
16    arg_types = {"this": True, "expression": True}
17    _sql_names = ["AI_AGG"]
arg_types = {'this': True, 'expression': True}
key: ClassVar[str] = 'aiagg'
required_args: 't.ClassVar[set[str]]' = {'expression', 'this'}
20class AISummarizeAgg(Expression, AggFunc):
21    _sql_names = ["AI_SUMMARIZE_AGG"]
key: ClassVar[str] = 'aisummarizeagg'
required_args: 't.ClassVar[set[str]]' = {'this'}
24class AnyValue(Expression, AggFunc):
25    pass
key: ClassVar[str] = 'anyvalue'
required_args: 't.ClassVar[set[str]]' = {'this'}
class ApproximateSimilarity(sqlglot.expressions.core.Expression, sqlglot.expressions.core.AggFunc):
28class ApproximateSimilarity(Expression, AggFunc):
29    _sql_names = ["APPROXIMATE_SIMILARITY", "APPROXIMATE_JACCARD_INDEX"]
key: ClassVar[str] = 'approximatesimilarity'
required_args: 't.ClassVar[set[str]]' = {'this'}
class ApproxPercentileAccumulate(sqlglot.expressions.core.Expression, sqlglot.expressions.core.AggFunc):
32class ApproxPercentileAccumulate(Expression, AggFunc):
33    pass
key: ClassVar[str] = 'approxpercentileaccumulate'
required_args: 't.ClassVar[set[str]]' = {'this'}
class ApproxPercentileCombine(sqlglot.expressions.core.Expression, sqlglot.expressions.core.AggFunc):
36class ApproxPercentileCombine(Expression, AggFunc):
37    pass
key: ClassVar[str] = 'approxpercentilecombine'
required_args: 't.ClassVar[set[str]]' = {'this'}
class ApproxPercentileEstimate(sqlglot.expressions.core.Expression, sqlglot.expressions.core.Func):
40class ApproxPercentileEstimate(Expression, Func):
41    arg_types = {"this": True, "percentile": True}
arg_types = {'this': True, 'percentile': True}
key: ClassVar[str] = 'approxpercentileestimate'
required_args: 't.ClassVar[set[str]]' = {'percentile', 'this'}
44class ApproxQuantiles(Expression, AggFunc):
45    arg_types = {"this": True, "expression": False}
arg_types = {'this': True, 'expression': False}
key: ClassVar[str] = 'approxquantiles'
required_args: 't.ClassVar[set[str]]' = {'this'}
48class ApproxTopK(Expression, AggFunc):
49    arg_types = {"this": True, "expression": False, "counters": False}
arg_types = {'this': True, 'expression': False, 'counters': False}
key: ClassVar[str] = 'approxtopk'
required_args: 't.ClassVar[set[str]]' = {'this'}
class ApproxTopKAccumulate(sqlglot.expressions.core.Expression, sqlglot.expressions.core.AggFunc):
52class ApproxTopKAccumulate(Expression, AggFunc):
53    arg_types = {"this": True, "expression": False}
arg_types = {'this': True, 'expression': False}
key: ClassVar[str] = 'approxtopkaccumulate'
required_args: 't.ClassVar[set[str]]' = {'this'}
56class ApproxTopKCombine(Expression, AggFunc):
57    arg_types = {"this": True, "expression": False}
arg_types = {'this': True, 'expression': False}
key: ClassVar[str] = 'approxtopkcombine'
required_args: 't.ClassVar[set[str]]' = {'this'}
class ApproxTopKEstimate(sqlglot.expressions.core.Expression, sqlglot.expressions.core.Func):
60class ApproxTopKEstimate(Expression, Func):
61    arg_types = {"this": True, "expression": False}
arg_types = {'this': True, 'expression': False}
key: ClassVar[str] = 'approxtopkestimate'
required_args: 't.ClassVar[set[str]]' = {'this'}
64class ApproxTopSum(Expression, AggFunc):
65    arg_types = {"this": True, "expression": True, "count": True}
arg_types = {'this': True, 'expression': True, 'count': True}
key: ClassVar[str] = 'approxtopsum'
required_args: 't.ClassVar[set[str]]' = {'count', 'expression', 'this'}
68class ArgMax(Expression, AggFunc):
69    arg_types = {"this": True, "expression": True, "count": False, "include_nulls": False}
70    _sql_names = ["ARG_MAX", "ARGMAX", "MAX_BY"]
arg_types = {'this': True, 'expression': True, 'count': False, 'include_nulls': False}
key: ClassVar[str] = 'argmax'
required_args: 't.ClassVar[set[str]]' = {'expression', 'this'}
73class ArgMin(Expression, AggFunc):
74    arg_types = {"this": True, "expression": True, "count": False, "include_nulls": False}
75    _sql_names = ["ARG_MIN", "ARGMIN", "MIN_BY"]
arg_types = {'this': True, 'expression': True, 'count': False, 'include_nulls': False}
key: ClassVar[str] = 'argmin'
required_args: 't.ClassVar[set[str]]' = {'expression', 'this'}
78class ArrayAgg(Expression, AggFunc):
79    arg_types = {"this": True, "nulls_excluded": False, "null_on_empty": False}
arg_types = {'this': True, 'nulls_excluded': False, 'null_on_empty': False}
key: ClassVar[str] = 'arrayagg'
required_args: 't.ClassVar[set[str]]' = {'this'}
82class ArrayConcatAgg(Expression, AggFunc):
83    pass
key: ClassVar[str] = 'arrayconcatagg'
required_args: 't.ClassVar[set[str]]' = {'this'}
86class ArrayUnionAgg(Expression, AggFunc):
87    pass
key: ClassVar[str] = 'arrayunionagg'
required_args: 't.ClassVar[set[str]]' = {'this'}
90class ArrayUniqueAgg(Expression, AggFunc):
91    pass
key: ClassVar[str] = 'arrayuniqueagg'
required_args: 't.ClassVar[set[str]]' = {'this'}
94class Avg(Expression, AggFunc):
95    pass
key: ClassVar[str] = 'avg'
required_args: 't.ClassVar[set[str]]' = {'this'}
 98class Corr(Expression, AggFunc, Binary):
 99    # Correlation divides by variance(column). If a column has 0 variance, the denominator
100    # is 0 - some dialects return NaN (DuckDB) while others return NULL (Snowflake).
101    # `null_on_zero_variance` is set to True at parse time for dialects that return NULL.
102    arg_types = {"this": True, "expression": True, "null_on_zero_variance": False}
arg_types = {'this': True, 'expression': True, 'null_on_zero_variance': False}
key: ClassVar[str] = 'corr'
required_args: 't.ClassVar[set[str]]' = {'expression', 'this'}
105class Count(Expression, AggFunc):
106    arg_types = {"this": False, "expressions": False, "big_int": False}
107    is_var_len_args = True
arg_types = {'this': False, 'expressions': False, 'big_int': False}
is_var_len_args = True
key: ClassVar[str] = 'count'
required_args: 't.ClassVar[set[str]]' = set()
110class CountIf(Expression, AggFunc):
111    _sql_names = ["COUNT_IF", "COUNTIF"]
112    arg_types = {"this": True, "zero_on_all_null": False}
arg_types = {'this': True, 'zero_on_all_null': False}
key: ClassVar[str] = 'countif'
required_args: 't.ClassVar[set[str]]' = {'this'}
115class CovarPop(Expression, AggFunc):
116    arg_types = {"this": True, "expression": True}
arg_types = {'this': True, 'expression': True}
key: ClassVar[str] = 'covarpop'
required_args: 't.ClassVar[set[str]]' = {'expression', 'this'}
119class CovarSamp(Expression, AggFunc):
120    arg_types = {"this": True, "expression": True}
arg_types = {'this': True, 'expression': True}
key: ClassVar[str] = 'covarsamp'
required_args: 't.ClassVar[set[str]]' = {'expression', 'this'}
123class CumeDist(Expression, AggFunc):
124    arg_types = {"expressions": False}
125    is_var_len_args = True
arg_types = {'expressions': False}
is_var_len_args = True
key: ClassVar[str] = 'cumedist'
required_args: 't.ClassVar[set[str]]' = set()
128class DenseRank(Expression, AggFunc):
129    arg_types = {"expressions": False}
130    is_var_len_args = True
arg_types = {'expressions': False}
is_var_len_args = True
key: ClassVar[str] = 'denserank'
required_args: 't.ClassVar[set[str]]' = set()
133class First(Expression, AggFunc):
134    arg_types = {"this": True, "expression": False}
arg_types = {'this': True, 'expression': False}
key: ClassVar[str] = 'first'
required_args: 't.ClassVar[set[str]]' = {'this'}
137class FirstValue(Expression, AggFunc):
138    pass
key: ClassVar[str] = 'firstvalue'
required_args: 't.ClassVar[set[str]]' = {'this'}
141class GroupConcat(Expression, AggFunc):
142    arg_types = {
143        "this": True,
144        "separator": False,
145        "on_overflow": False,
146        "null_separator_is_empty": False,
147        "empty_string_on_empty": False,
148    }
arg_types = {'this': True, 'separator': False, 'on_overflow': False, 'null_separator_is_empty': False, 'empty_string_on_empty': False}
key: ClassVar[str] = 'groupconcat'
required_args: 't.ClassVar[set[str]]' = {'this'}
151class Grouping(Expression, AggFunc):
152    arg_types = {"expressions": True}
153    is_var_len_args = True
arg_types = {'expressions': True}
is_var_len_args = True
key: ClassVar[str] = 'grouping'
required_args: 't.ClassVar[set[str]]' = {'expressions'}
156class GroupingId(Expression, AggFunc):
157    arg_types = {"expressions": False}
158    is_var_len_args = True
arg_types = {'expressions': False}
is_var_len_args = True
key: ClassVar[str] = 'groupingid'
required_args: 't.ClassVar[set[str]]' = set()
161class Kurtosis(Expression, AggFunc):
162    pass
key: ClassVar[str] = 'kurtosis'
required_args: 't.ClassVar[set[str]]' = {'this'}
165class Lag(Expression, AggFunc):
166    arg_types = {"this": True, "offset": False, "default": False}
arg_types = {'this': True, 'offset': False, 'default': False}
key: ClassVar[str] = 'lag'
required_args: 't.ClassVar[set[str]]' = {'this'}
169class Last(Expression, AggFunc):
170    arg_types = {"this": True, "expression": False}
arg_types = {'this': True, 'expression': False}
key: ClassVar[str] = 'last'
required_args: 't.ClassVar[set[str]]' = {'this'}
173class LastValue(Expression, AggFunc):
174    pass
key: ClassVar[str] = 'lastvalue'
required_args: 't.ClassVar[set[str]]' = {'this'}
177class Lead(Expression, AggFunc):
178    arg_types = {"this": True, "offset": False, "default": False}
arg_types = {'this': True, 'offset': False, 'default': False}
key: ClassVar[str] = 'lead'
required_args: 't.ClassVar[set[str]]' = {'this'}
181class LogicalAnd(Expression, AggFunc):
182    _sql_names = ["LOGICAL_AND", "BOOL_AND", "BOOLAND_AGG"]
key: ClassVar[str] = 'logicaland'
required_args: 't.ClassVar[set[str]]' = {'this'}
185class LogicalOr(Expression, AggFunc):
186    _sql_names = ["LOGICAL_OR", "BOOL_OR", "BOOLOR_AGG"]
key: ClassVar[str] = 'logicalor'
required_args: 't.ClassVar[set[str]]' = {'this'}
189class Max(Expression, AggFunc):
190    arg_types = {"this": True, "expressions": False, "count": False}
191    is_var_len_args = True
arg_types = {'this': True, 'expressions': False, 'count': False}
is_var_len_args = True
key: ClassVar[str] = 'max'
required_args: 't.ClassVar[set[str]]' = {'this'}
194class Median(Expression, AggFunc):
195    pass
key: ClassVar[str] = 'median'
required_args: 't.ClassVar[set[str]]' = {'this'}
198class Min(Expression, AggFunc):
199    arg_types = {"this": True, "expressions": False, "count": False}
200    is_var_len_args = True
arg_types = {'this': True, 'expressions': False, 'count': False}
is_var_len_args = True
key: ClassVar[str] = 'min'
required_args: 't.ClassVar[set[str]]' = {'this'}
203class Minhash(Expression, AggFunc):
204    arg_types = {"this": True, "expressions": True}
205    is_var_len_args = True
arg_types = {'this': True, 'expressions': True}
is_var_len_args = True
key: ClassVar[str] = 'minhash'
required_args: 't.ClassVar[set[str]]' = {'expressions', 'this'}
208class MinhashCombine(Expression, AggFunc):
209    pass
key: ClassVar[str] = 'minhashcombine'
required_args: 't.ClassVar[set[str]]' = {'this'}
212class Mode(Expression, AggFunc):
213    arg_types = {"this": False, "deterministic": False}
arg_types = {'this': False, 'deterministic': False}
key: ClassVar[str] = 'mode'
required_args: 't.ClassVar[set[str]]' = set()
216class Ntile(Expression, AggFunc):
217    arg_types = {"this": False}
arg_types = {'this': False}
key: ClassVar[str] = 'ntile'
required_args: 't.ClassVar[set[str]]' = set()
220class NthValue(Expression, AggFunc):
221    arg_types = {"this": True, "offset": True, "from_first": False}
arg_types = {'this': True, 'offset': True, 'from_first': False}
key: ClassVar[str] = 'nthvalue'
required_args: 't.ClassVar[set[str]]' = {'offset', 'this'}
224class ObjectAgg(Expression, AggFunc):
225    arg_types = {"this": True, "expression": False}
arg_types = {'this': True, 'expression': False}
key: ClassVar[str] = 'objectagg'
required_args: 't.ClassVar[set[str]]' = {'this'}
228class PercentileCont(Expression, AggFunc):
229    arg_types = {"this": True, "expression": False}
arg_types = {'this': True, 'expression': False}
key: ClassVar[str] = 'percentilecont'
required_args: 't.ClassVar[set[str]]' = {'this'}
232class PercentileDisc(Expression, AggFunc):
233    arg_types = {"this": True, "expression": False}
arg_types = {'this': True, 'expression': False}
key: ClassVar[str] = 'percentiledisc'
required_args: 't.ClassVar[set[str]]' = {'this'}
PERCENTILES = (<class 'PercentileCont'>, <class 'PercentileDisc'>)
239class PercentRank(Expression, AggFunc):
240    arg_types = {"expressions": False}
241    is_var_len_args = True
arg_types = {'expressions': False}
is_var_len_args = True
key: ClassVar[str] = 'percentrank'
required_args: 't.ClassVar[set[str]]' = set()
244class Quantile(Expression, AggFunc):
245    arg_types = {"this": True, "quantile": True}
arg_types = {'this': True, 'quantile': True}
key: ClassVar[str] = 'quantile'
required_args: 't.ClassVar[set[str]]' = {'quantile', 'this'}
class ApproxQuantile(Quantile):
248class ApproxQuantile(Quantile):
249    arg_types = {
250        "this": True,
251        "quantile": True,
252        "accuracy": False,
253        "weight": False,
254        "error_tolerance": False,
255    }
arg_types = {'this': True, 'quantile': True, 'accuracy': False, 'weight': False, 'error_tolerance': False}
key: ClassVar[str] = 'approxquantile'
required_args: 't.ClassVar[set[str]]' = {'quantile', 'this'}
258class Rank(Expression, AggFunc):
259    arg_types = {"expressions": False}
260    is_var_len_args = True
arg_types = {'expressions': False}
is_var_len_args = True
key: ClassVar[str] = 'rank'
required_args: 't.ClassVar[set[str]]' = set()
263class RegrAvgx(Expression, AggFunc):
264    arg_types = {"this": True, "expression": True}
arg_types = {'this': True, 'expression': True}
key: ClassVar[str] = 'regravgx'
required_args: 't.ClassVar[set[str]]' = {'expression', 'this'}
267class RegrAvgy(Expression, AggFunc):
268    arg_types = {"this": True, "expression": True}
arg_types = {'this': True, 'expression': True}
key: ClassVar[str] = 'regravgy'
required_args: 't.ClassVar[set[str]]' = {'expression', 'this'}
271class RegrCount(Expression, AggFunc):
272    arg_types = {"this": True, "expression": False}
arg_types = {'this': True, 'expression': False}
key: ClassVar[str] = 'regrcount'
required_args: 't.ClassVar[set[str]]' = {'this'}
275class RegrIntercept(Expression, AggFunc):
276    arg_types = {"this": True, "expression": False}
arg_types = {'this': True, 'expression': False}
key: ClassVar[str] = 'regrintercept'
required_args: 't.ClassVar[set[str]]' = {'this'}
279class RegrR2(Expression, AggFunc):
280    arg_types = {"this": True, "expression": False}
arg_types = {'this': True, 'expression': False}
key: ClassVar[str] = 'regrr2'
required_args: 't.ClassVar[set[str]]' = {'this'}
283class RegrSlope(Expression, AggFunc):
284    arg_types = {"this": True, "expression": False}
arg_types = {'this': True, 'expression': False}
key: ClassVar[str] = 'regrslope'
required_args: 't.ClassVar[set[str]]' = {'this'}
287class RegrSxx(Expression, AggFunc):
288    arg_types = {"this": True, "expression": True}
arg_types = {'this': True, 'expression': True}
key: ClassVar[str] = 'regrsxx'
required_args: 't.ClassVar[set[str]]' = {'expression', 'this'}
291class RegrSxy(Expression, AggFunc):
292    arg_types = {"this": True, "expression": True}
arg_types = {'this': True, 'expression': True}
key: ClassVar[str] = 'regrsxy'
required_args: 't.ClassVar[set[str]]' = {'expression', 'this'}
295class RegrSyy(Expression, AggFunc):
296    arg_types = {"this": True, "expression": True}
arg_types = {'this': True, 'expression': True}
key: ClassVar[str] = 'regrsyy'
required_args: 't.ClassVar[set[str]]' = {'expression', 'this'}
299class RegrValx(Expression, AggFunc):
300    arg_types = {"this": True, "expression": True}
arg_types = {'this': True, 'expression': True}
key: ClassVar[str] = 'regrvalx'
required_args: 't.ClassVar[set[str]]' = {'expression', 'this'}
303class RegrValy(Expression, AggFunc):
304    arg_types = {"this": True, "expression": True}
arg_types = {'this': True, 'expression': True}
key: ClassVar[str] = 'regrvaly'
required_args: 't.ClassVar[set[str]]' = {'expression', 'this'}
307class RowNumber(Expression, Func):
308    arg_types = {"this": False}
arg_types = {'this': False}
key: ClassVar[str] = 'rownumber'
required_args: 't.ClassVar[set[str]]' = set()
311class Skewness(Expression, AggFunc):
312    pass
key: ClassVar[str] = 'skewness'
required_args: 't.ClassVar[set[str]]' = {'this'}
315class Stddev(Expression, AggFunc):
316    _sql_names = ["STDDEV", "STDEV"]
key: ClassVar[str] = 'stddev'
required_args: 't.ClassVar[set[str]]' = {'this'}
319class StddevPop(Expression, AggFunc):
320    pass
key: ClassVar[str] = 'stddevpop'
required_args: 't.ClassVar[set[str]]' = {'this'}
323class StddevSamp(Expression, AggFunc):
324    pass
key: ClassVar[str] = 'stddevsamp'
required_args: 't.ClassVar[set[str]]' = {'this'}
327class Sum(Expression, AggFunc):
328    pass
key: ClassVar[str] = 'sum'
required_args: 't.ClassVar[set[str]]' = {'this'}
331class Variance(Expression, AggFunc):
332    # single_value_returns_zero: Oracle's VARIANCE returns 0 instead of NULL for a single value
333    arg_types = {"this": True, "single_value_returns_zero": False}
334    _sql_names = ["VARIANCE", "VARIANCE_SAMP", "VAR_SAMP"]
arg_types = {'this': True, 'single_value_returns_zero': False}
key: ClassVar[str] = 'variance'
required_args: 't.ClassVar[set[str]]' = {'this'}
337class VariancePop(Expression, AggFunc):
338    _sql_names = ["VARIANCE_POP", "VAR_POP"]
key: ClassVar[str] = 'variancepop'
required_args: 't.ClassVar[set[str]]' = {'this'}