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}
 69    _sql_names = ["ARG_MAX", "ARGMAX", "MAX_BY"]
 70
 71
 72class ArgMin(Expression, AggFunc):
 73    arg_types = {"this": True, "expression": True, "count": False}
 74    _sql_names = ["ARG_MIN", "ARGMIN", "MIN_BY"]
 75
 76
 77class ArrayAgg(Expression, AggFunc):
 78    arg_types = {"this": True, "nulls_excluded": 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 = {"this": True, "separator": False, "on_overflow": False}
142
143
144class Grouping(Expression, AggFunc):
145    arg_types = {"expressions": True}
146    is_var_len_args = True
147
148
149class GroupingId(Expression, AggFunc):
150    arg_types = {"expressions": False}
151    is_var_len_args = True
152
153
154class Kurtosis(Expression, AggFunc):
155    pass
156
157
158class Lag(Expression, AggFunc):
159    arg_types = {"this": True, "offset": False, "default": False}
160
161
162class Last(Expression, AggFunc):
163    arg_types = {"this": True, "expression": False}
164
165
166class LastValue(Expression, AggFunc):
167    pass
168
169
170class Lead(Expression, AggFunc):
171    arg_types = {"this": True, "offset": False, "default": False}
172
173
174class LogicalAnd(Expression, AggFunc):
175    _sql_names = ["LOGICAL_AND", "BOOL_AND", "BOOLAND_AGG"]
176
177
178class LogicalOr(Expression, AggFunc):
179    _sql_names = ["LOGICAL_OR", "BOOL_OR", "BOOLOR_AGG"]
180
181
182class Max(Expression, AggFunc):
183    arg_types = {"this": True, "expressions": False}
184    is_var_len_args = True
185
186
187class Median(Expression, AggFunc):
188    pass
189
190
191class Min(Expression, AggFunc):
192    arg_types = {"this": True, "expressions": False}
193    is_var_len_args = True
194
195
196class Minhash(Expression, AggFunc):
197    arg_types = {"this": True, "expressions": True}
198    is_var_len_args = True
199
200
201class MinhashCombine(Expression, AggFunc):
202    pass
203
204
205class Mode(Expression, AggFunc):
206    arg_types = {"this": False, "deterministic": False}
207
208
209class Ntile(Expression, AggFunc):
210    arg_types = {"this": False}
211
212
213class NthValue(Expression, AggFunc):
214    arg_types = {"this": True, "offset": True, "from_first": False}
215
216
217class ObjectAgg(Expression, AggFunc):
218    arg_types = {"this": True, "expression": False}
219
220
221class PercentileCont(Expression, AggFunc):
222    arg_types = {"this": True, "expression": False}
223
224
225class PercentileDisc(Expression, AggFunc):
226    arg_types = {"this": True, "expression": False}
227
228
229PERCENTILES = (PercentileCont, PercentileDisc)
230
231
232class PercentRank(Expression, AggFunc):
233    arg_types = {"expressions": False}
234    is_var_len_args = True
235
236
237class Quantile(Expression, AggFunc):
238    arg_types = {"this": True, "quantile": True}
239
240
241class ApproxQuantile(Quantile):
242    arg_types = {
243        "this": True,
244        "quantile": True,
245        "accuracy": False,
246        "weight": False,
247        "error_tolerance": False,
248    }
249
250
251class Rank(Expression, AggFunc):
252    arg_types = {"expressions": False}
253    is_var_len_args = True
254
255
256class RegrAvgx(Expression, AggFunc):
257    arg_types = {"this": True, "expression": True}
258
259
260class RegrAvgy(Expression, AggFunc):
261    arg_types = {"this": True, "expression": True}
262
263
264class RegrCount(Expression, AggFunc):
265    arg_types = {"this": True, "expression": False}
266
267
268class RegrIntercept(Expression, AggFunc):
269    arg_types = {"this": True, "expression": False}
270
271
272class RegrR2(Expression, AggFunc):
273    arg_types = {"this": True, "expression": False}
274
275
276class RegrSlope(Expression, AggFunc):
277    arg_types = {"this": True, "expression": False}
278
279
280class RegrSxx(Expression, AggFunc):
281    arg_types = {"this": True, "expression": True}
282
283
284class RegrSxy(Expression, AggFunc):
285    arg_types = {"this": True, "expression": True}
286
287
288class RegrSyy(Expression, AggFunc):
289    arg_types = {"this": True, "expression": True}
290
291
292class RegrValx(Expression, AggFunc):
293    arg_types = {"this": True, "expression": True}
294
295
296class RegrValy(Expression, AggFunc):
297    arg_types = {"this": True, "expression": True}
298
299
300class RowNumber(Expression, Func):
301    arg_types = {"this": False}
302
303
304class Skewness(Expression, AggFunc):
305    pass
306
307
308class Stddev(Expression, AggFunc):
309    _sql_names = ["STDDEV", "STDEV"]
310
311
312class StddevPop(Expression, AggFunc):
313    pass
314
315
316class StddevSamp(Expression, AggFunc):
317    pass
318
319
320class Sum(Expression, AggFunc):
321    pass
322
323
324class Variance(Expression, AggFunc):
325    _sql_names = ["VARIANCE", "VARIANCE_SAMP", "VAR_SAMP"]
326
327
328class VariancePop(Expression, AggFunc):
329    _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]]' = {'this', 'expression'}
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]]' = {'this', 'percentile'}
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]]' = {'this', 'count', 'expression'}
68class ArgMax(Expression, AggFunc):
69    arg_types = {"this": True, "expression": True, "count": False}
70    _sql_names = ["ARG_MAX", "ARGMAX", "MAX_BY"]
arg_types = {'this': True, 'expression': True, 'count': False}
key: ClassVar[str] = 'argmax'
required_args: 't.ClassVar[set[str]]' = {'this', 'expression'}
73class ArgMin(Expression, AggFunc):
74    arg_types = {"this": True, "expression": True, "count": False}
75    _sql_names = ["ARG_MIN", "ARGMIN", "MIN_BY"]
arg_types = {'this': True, 'expression': True, 'count': False}
key: ClassVar[str] = 'argmin'
required_args: 't.ClassVar[set[str]]' = {'this', 'expression'}
78class ArrayAgg(Expression, AggFunc):
79    arg_types = {"this": True, "nulls_excluded": False}
arg_types = {'this': True, 'nulls_excluded': 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]]' = {'this', 'expression'}
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]]' = {'this', 'expression'}
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]]' = {'this', 'expression'}
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 = {"this": True, "separator": False, "on_overflow": False}
arg_types = {'this': True, 'separator': False, 'on_overflow': False}
key: ClassVar[str] = 'groupconcat'
required_args: 't.ClassVar[set[str]]' = {'this'}
145class Grouping(Expression, AggFunc):
146    arg_types = {"expressions": True}
147    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'}
150class GroupingId(Expression, AggFunc):
151    arg_types = {"expressions": False}
152    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()
155class Kurtosis(Expression, AggFunc):
156    pass
key: ClassVar[str] = 'kurtosis'
required_args: 't.ClassVar[set[str]]' = {'this'}
159class Lag(Expression, AggFunc):
160    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'}
163class Last(Expression, AggFunc):
164    arg_types = {"this": True, "expression": False}
arg_types = {'this': True, 'expression': False}
key: ClassVar[str] = 'last'
required_args: 't.ClassVar[set[str]]' = {'this'}
167class LastValue(Expression, AggFunc):
168    pass
key: ClassVar[str] = 'lastvalue'
required_args: 't.ClassVar[set[str]]' = {'this'}
171class Lead(Expression, AggFunc):
172    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'}
175class LogicalAnd(Expression, AggFunc):
176    _sql_names = ["LOGICAL_AND", "BOOL_AND", "BOOLAND_AGG"]
key: ClassVar[str] = 'logicaland'
required_args: 't.ClassVar[set[str]]' = {'this'}
179class LogicalOr(Expression, AggFunc):
180    _sql_names = ["LOGICAL_OR", "BOOL_OR", "BOOLOR_AGG"]
key: ClassVar[str] = 'logicalor'
required_args: 't.ClassVar[set[str]]' = {'this'}
183class Max(Expression, AggFunc):
184    arg_types = {"this": True, "expressions": False}
185    is_var_len_args = True
arg_types = {'this': True, 'expressions': False}
is_var_len_args = True
key: ClassVar[str] = 'max'
required_args: 't.ClassVar[set[str]]' = {'this'}
188class Median(Expression, AggFunc):
189    pass
key: ClassVar[str] = 'median'
required_args: 't.ClassVar[set[str]]' = {'this'}
192class Min(Expression, AggFunc):
193    arg_types = {"this": True, "expressions": False}
194    is_var_len_args = True
arg_types = {'this': True, 'expressions': False}
is_var_len_args = True
key: ClassVar[str] = 'min'
required_args: 't.ClassVar[set[str]]' = {'this'}
197class Minhash(Expression, AggFunc):
198    arg_types = {"this": True, "expressions": True}
199    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]]' = {'this', 'expressions'}
202class MinhashCombine(Expression, AggFunc):
203    pass
key: ClassVar[str] = 'minhashcombine'
required_args: 't.ClassVar[set[str]]' = {'this'}
206class Mode(Expression, AggFunc):
207    arg_types = {"this": False, "deterministic": False}
arg_types = {'this': False, 'deterministic': False}
key: ClassVar[str] = 'mode'
required_args: 't.ClassVar[set[str]]' = set()
210class Ntile(Expression, AggFunc):
211    arg_types = {"this": False}
arg_types = {'this': False}
key: ClassVar[str] = 'ntile'
required_args: 't.ClassVar[set[str]]' = set()
214class NthValue(Expression, AggFunc):
215    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]]' = {'this', 'offset'}
218class ObjectAgg(Expression, AggFunc):
219    arg_types = {"this": True, "expression": False}
arg_types = {'this': True, 'expression': False}
key: ClassVar[str] = 'objectagg'
required_args: 't.ClassVar[set[str]]' = {'this'}
222class PercentileCont(Expression, AggFunc):
223    arg_types = {"this": True, "expression": False}
arg_types = {'this': True, 'expression': False}
key: ClassVar[str] = 'percentilecont'
required_args: 't.ClassVar[set[str]]' = {'this'}
226class PercentileDisc(Expression, AggFunc):
227    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'>)
233class PercentRank(Expression, AggFunc):
234    arg_types = {"expressions": False}
235    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()
238class Quantile(Expression, AggFunc):
239    arg_types = {"this": True, "quantile": True}
arg_types = {'this': True, 'quantile': True}
key: ClassVar[str] = 'quantile'
required_args: 't.ClassVar[set[str]]' = {'this', 'quantile'}
class ApproxQuantile(Quantile):
242class ApproxQuantile(Quantile):
243    arg_types = {
244        "this": True,
245        "quantile": True,
246        "accuracy": False,
247        "weight": False,
248        "error_tolerance": False,
249    }
arg_types = {'this': True, 'quantile': True, 'accuracy': False, 'weight': False, 'error_tolerance': False}
key: ClassVar[str] = 'approxquantile'
required_args: 't.ClassVar[set[str]]' = {'this', 'quantile'}
252class Rank(Expression, AggFunc):
253    arg_types = {"expressions": False}
254    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()
257class RegrAvgx(Expression, AggFunc):
258    arg_types = {"this": True, "expression": True}
arg_types = {'this': True, 'expression': True}
key: ClassVar[str] = 'regravgx'
required_args: 't.ClassVar[set[str]]' = {'this', 'expression'}
261class RegrAvgy(Expression, AggFunc):
262    arg_types = {"this": True, "expression": True}
arg_types = {'this': True, 'expression': True}
key: ClassVar[str] = 'regravgy'
required_args: 't.ClassVar[set[str]]' = {'this', 'expression'}
265class RegrCount(Expression, AggFunc):
266    arg_types = {"this": True, "expression": False}
arg_types = {'this': True, 'expression': False}
key: ClassVar[str] = 'regrcount'
required_args: 't.ClassVar[set[str]]' = {'this'}
269class RegrIntercept(Expression, AggFunc):
270    arg_types = {"this": True, "expression": False}
arg_types = {'this': True, 'expression': False}
key: ClassVar[str] = 'regrintercept'
required_args: 't.ClassVar[set[str]]' = {'this'}
273class RegrR2(Expression, AggFunc):
274    arg_types = {"this": True, "expression": False}
arg_types = {'this': True, 'expression': False}
key: ClassVar[str] = 'regrr2'
required_args: 't.ClassVar[set[str]]' = {'this'}
277class RegrSlope(Expression, AggFunc):
278    arg_types = {"this": True, "expression": False}
arg_types = {'this': True, 'expression': False}
key: ClassVar[str] = 'regrslope'
required_args: 't.ClassVar[set[str]]' = {'this'}
281class RegrSxx(Expression, AggFunc):
282    arg_types = {"this": True, "expression": True}
arg_types = {'this': True, 'expression': True}
key: ClassVar[str] = 'regrsxx'
required_args: 't.ClassVar[set[str]]' = {'this', 'expression'}
285class RegrSxy(Expression, AggFunc):
286    arg_types = {"this": True, "expression": True}
arg_types = {'this': True, 'expression': True}
key: ClassVar[str] = 'regrsxy'
required_args: 't.ClassVar[set[str]]' = {'this', 'expression'}
289class RegrSyy(Expression, AggFunc):
290    arg_types = {"this": True, "expression": True}
arg_types = {'this': True, 'expression': True}
key: ClassVar[str] = 'regrsyy'
required_args: 't.ClassVar[set[str]]' = {'this', 'expression'}
293class RegrValx(Expression, AggFunc):
294    arg_types = {"this": True, "expression": True}
arg_types = {'this': True, 'expression': True}
key: ClassVar[str] = 'regrvalx'
required_args: 't.ClassVar[set[str]]' = {'this', 'expression'}
297class RegrValy(Expression, AggFunc):
298    arg_types = {"this": True, "expression": True}
arg_types = {'this': True, 'expression': True}
key: ClassVar[str] = 'regrvaly'
required_args: 't.ClassVar[set[str]]' = {'this', 'expression'}
301class RowNumber(Expression, Func):
302    arg_types = {"this": False}
arg_types = {'this': False}
key: ClassVar[str] = 'rownumber'
required_args: 't.ClassVar[set[str]]' = set()
305class Skewness(Expression, AggFunc):
306    pass
key: ClassVar[str] = 'skewness'
required_args: 't.ClassVar[set[str]]' = {'this'}
309class Stddev(Expression, AggFunc):
310    _sql_names = ["STDDEV", "STDEV"]
key: ClassVar[str] = 'stddev'
required_args: 't.ClassVar[set[str]]' = {'this'}
313class StddevPop(Expression, AggFunc):
314    pass
key: ClassVar[str] = 'stddevpop'
required_args: 't.ClassVar[set[str]]' = {'this'}
317class StddevSamp(Expression, AggFunc):
318    pass
key: ClassVar[str] = 'stddevsamp'
required_args: 't.ClassVar[set[str]]' = {'this'}
321class Sum(Expression, AggFunc):
322    pass
key: ClassVar[str] = 'sum'
required_args: 't.ClassVar[set[str]]' = {'this'}
325class Variance(Expression, AggFunc):
326    _sql_names = ["VARIANCE", "VARIANCE_SAMP", "VAR_SAMP"]
key: ClassVar[str] = 'variance'
required_args: 't.ClassVar[set[str]]' = {'this'}
329class VariancePop(Expression, AggFunc):
330    _sql_names = ["VARIANCE_POP", "VAR_POP"]
key: ClassVar[str] = 'variancepop'
required_args: 't.ClassVar[set[str]]' = {'this'}