@uwdata/mosaic-sql 0.13.0 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types/ast/aggregate.d.ts +5 -4
- package/dist/types/ast/case.d.ts +6 -7
- package/dist/types/ast/column-param.d.ts +7 -7
- package/dist/types/ast/column-ref.d.ts +7 -6
- package/dist/types/ast/param.d.ts +5 -4
- package/dist/types/ast/query.d.ts +46 -39
- package/dist/types/ast/window.d.ts +15 -12
- package/dist/types/functions/aggregate.d.ts +89 -88
- package/dist/types/functions/case.d.ts +6 -8
- package/dist/types/functions/column.d.ts +5 -3
- package/dist/types/functions/datetime.d.ts +12 -11
- package/dist/types/functions/numeric.d.ts +48 -46
- package/dist/types/functions/operators.d.ts +80 -78
- package/dist/types/functions/order-by.d.ts +5 -4
- package/dist/types/functions/spatial.d.ts +14 -13
- package/dist/types/functions/sql-template-tag.d.ts +4 -5
- package/dist/types/functions/string.d.ts +22 -20
- package/dist/types/functions/util.d.ts +8 -0
- package/dist/types/functions/window.d.ts +18 -16
- package/dist/types/index.d.ts +5 -0
- package/dist/types/transforms/bin-1d.d.ts +3 -2
- package/dist/types/transforms/bin-2d.d.ts +6 -5
- package/dist/types/transforms/bin-date.d.ts +44 -0
- package/dist/types/transforms/bin-histogram.d.ts +51 -0
- package/dist/types/transforms/bin-linear-1d.d.ts +6 -4
- package/dist/types/transforms/bin-linear-2d.d.ts +6 -5
- package/dist/types/transforms/line-density.d.ts +5 -4
- package/dist/types/transforms/m4.d.ts +7 -4
- package/dist/types/transforms/util/bin-step.d.ts +61 -0
- package/dist/types/transforms/util/time-interval.d.ts +13 -0
- package/dist/types/types.d.ts +1 -0
- package/dist/types/util/ast.d.ts +6 -5
- package/dist/types/util/function.d.ts +6 -4
- package/dist/types/util/type-check.d.ts +6 -2
- package/dist/types/visit/visitors.d.ts +3 -2
- package/dist/types/visit/walk.d.ts +7 -4
- package/package.json +2 -2
- package/src/ast/aggregate.js +5 -2
- package/src/ast/case.js +6 -5
- package/src/ast/column-param.js +7 -5
- package/src/ast/column-ref.js +6 -3
- package/src/ast/param.js +5 -2
- package/src/ast/query.js +23 -19
- package/src/ast/window.js +10 -6
- package/src/functions/aggregate.js +55 -52
- package/src/functions/case.js +7 -7
- package/src/functions/column.js +6 -2
- package/src/functions/datetime.js +9 -6
- package/src/functions/numeric.js +35 -31
- package/src/functions/operators.js +53 -50
- package/src/functions/order-by.js +5 -2
- package/src/functions/spatial.js +10 -7
- package/src/functions/sql-template-tag.js +5 -5
- package/src/functions/string.js +16 -13
- package/src/functions/util.js +14 -0
- package/src/functions/window.js +13 -10
- package/src/index.js +6 -0
- package/src/transforms/bin-1d.js +4 -1
- package/src/transforms/bin-2d.js +7 -4
- package/src/transforms/bin-date.js +37 -0
- package/src/transforms/bin-histogram.js +52 -0
- package/src/transforms/bin-linear-1d.js +7 -3
- package/src/transforms/bin-linear-2d.js +12 -8
- package/src/transforms/line-density.js +7 -3
- package/src/transforms/m4.js +7 -3
- package/src/transforms/util/bin-step.js +79 -0
- package/src/transforms/util/time-interval.js +97 -0
- package/src/types.ts +11 -0
- package/src/util/ast.js +6 -3
- package/src/util/function.js +6 -2
- package/src/util/type-check.js +5 -1
- package/src/visit/visitors.js +6 -2
- package/src/visit/walk.js +8 -3
|
@@ -1,235 +1,236 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Compute an arg_max aggregate.
|
|
3
|
-
* @param {
|
|
4
|
-
* @param {
|
|
3
|
+
* @param {ExprValue} y The argument to return.
|
|
4
|
+
* @param {ExprValue} x The expression to maximize.
|
|
5
5
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
6
6
|
*/
|
|
7
|
-
export function argmax(y:
|
|
7
|
+
export function argmax(y: ExprValue, x: ExprValue): AggregateNode;
|
|
8
8
|
/**
|
|
9
9
|
* Compute an arg_min aggregate.
|
|
10
|
-
* @param {
|
|
11
|
-
* @param {
|
|
10
|
+
* @param {ExprValue} y The argument to return.
|
|
11
|
+
* @param {ExprValue} x The expression to minimize.
|
|
12
12
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
13
13
|
*/
|
|
14
|
-
export function argmin(y:
|
|
14
|
+
export function argmin(y: ExprValue, x: ExprValue): AggregateNode;
|
|
15
15
|
/**
|
|
16
16
|
* Compute an array aggregation.
|
|
17
|
-
* @param {
|
|
17
|
+
* @param {ExprValue} expr The expression to aggregate.
|
|
18
18
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
19
19
|
*/
|
|
20
|
-
export function arrayAgg(expr:
|
|
20
|
+
export function arrayAgg(expr: ExprValue): AggregateNode;
|
|
21
21
|
/**
|
|
22
22
|
* Compute an average aggregate.
|
|
23
|
-
* @param {
|
|
23
|
+
* @param {ExprValue} expr The expression to aggregate.
|
|
24
24
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
25
25
|
*/
|
|
26
|
-
export function avg(expr:
|
|
26
|
+
export function avg(expr: ExprValue): AggregateNode;
|
|
27
27
|
/**
|
|
28
28
|
* Compute a correlation aggregate.
|
|
29
|
-
* @param {
|
|
30
|
-
* @param {
|
|
29
|
+
* @param {ExprValue} x The x expression to aggregate.
|
|
30
|
+
* @param {ExprValue} y The y expression to aggregate.
|
|
31
31
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
32
32
|
*/
|
|
33
|
-
export function corr(x:
|
|
33
|
+
export function corr(x: ExprValue, y: ExprValue): AggregateNode;
|
|
34
34
|
/**
|
|
35
35
|
* Compute a count aggregate.
|
|
36
|
-
* @param {
|
|
36
|
+
* @param {ExprValue} [expr] An optional expression
|
|
37
37
|
* to count. If specified, only non-null expression values are counted.
|
|
38
38
|
* If omitted, all rows within a group are counted.
|
|
39
39
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
40
40
|
*/
|
|
41
|
-
export function count(expr?:
|
|
41
|
+
export function count(expr?: ExprValue): AggregateNode;
|
|
42
42
|
/**
|
|
43
43
|
* Compute a sample covariance aggregate.
|
|
44
|
-
* @param {
|
|
45
|
-
* @param {
|
|
44
|
+
* @param {ExprValue} x The x expression to aggregate.
|
|
45
|
+
* @param {ExprValue} y The y expression to aggregate.
|
|
46
46
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
47
47
|
*/
|
|
48
|
-
export function covariance(x:
|
|
48
|
+
export function covariance(x: ExprValue, y: ExprValue): AggregateNode;
|
|
49
49
|
/**
|
|
50
50
|
* Compute a population covariance aggregate.
|
|
51
|
-
* @param {
|
|
52
|
-
* @param {
|
|
51
|
+
* @param {ExprValue} x The x expression to aggregate.
|
|
52
|
+
* @param {ExprValue} y The y expression to aggregate.
|
|
53
53
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
54
54
|
*/
|
|
55
|
-
export function covarPop(x:
|
|
55
|
+
export function covarPop(x: ExprValue, y: ExprValue): AggregateNode;
|
|
56
56
|
/**
|
|
57
57
|
* Compute an entropy aggregate.
|
|
58
|
-
* @param {
|
|
58
|
+
* @param {ExprValue} expr The expression to aggregate.
|
|
59
59
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
60
60
|
*/
|
|
61
|
-
export function entropy(expr:
|
|
61
|
+
export function entropy(expr: ExprValue): AggregateNode;
|
|
62
62
|
/**
|
|
63
63
|
* Compute a first aggregate.
|
|
64
|
-
* @param {
|
|
64
|
+
* @param {ExprValue} expr The expression to aggregate.
|
|
65
65
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
66
66
|
*/
|
|
67
|
-
export function first(expr:
|
|
67
|
+
export function first(expr: ExprValue): AggregateNode;
|
|
68
68
|
/**
|
|
69
69
|
* Compute a geomean aggregate.
|
|
70
|
-
* @param {
|
|
70
|
+
* @param {ExprValue} expr The expression to aggregate.
|
|
71
71
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
72
72
|
*/
|
|
73
|
-
export function geomean(expr:
|
|
73
|
+
export function geomean(expr: ExprValue): AggregateNode;
|
|
74
74
|
/**
|
|
75
75
|
* Compute a sample kurtosis aggregate.
|
|
76
|
-
* @param {
|
|
76
|
+
* @param {ExprValue} expr The expression to aggregate.
|
|
77
77
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
78
78
|
*/
|
|
79
|
-
export function kurtosis(expr:
|
|
79
|
+
export function kurtosis(expr: ExprValue): AggregateNode;
|
|
80
80
|
/**
|
|
81
81
|
* Compute a median absolute deviation (MAD) aggregate.
|
|
82
|
-
* @param {
|
|
82
|
+
* @param {ExprValue} expr The expression to aggregate.
|
|
83
83
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
84
84
|
*/
|
|
85
|
-
export function mad(expr:
|
|
85
|
+
export function mad(expr: ExprValue): AggregateNode;
|
|
86
86
|
/**
|
|
87
87
|
* Compute a maximum aggregate.
|
|
88
|
-
* @param {
|
|
88
|
+
* @param {ExprValue} expr The expression to aggregate.
|
|
89
89
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
90
90
|
*/
|
|
91
|
-
export function max(expr:
|
|
91
|
+
export function max(expr: ExprValue): AggregateNode;
|
|
92
92
|
/**
|
|
93
93
|
* Compute a median aggregate.
|
|
94
|
-
* @param {
|
|
94
|
+
* @param {ExprValue} expr The expression to aggregate.
|
|
95
95
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
96
96
|
*/
|
|
97
|
-
export function median(expr:
|
|
97
|
+
export function median(expr: ExprValue): AggregateNode;
|
|
98
98
|
/**
|
|
99
99
|
* Compute a minimum aggregate.
|
|
100
|
-
* @param {
|
|
100
|
+
* @param {ExprValue} expr The expression to aggregate.
|
|
101
101
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
102
102
|
*/
|
|
103
|
-
export function min(expr:
|
|
103
|
+
export function min(expr: ExprValue): AggregateNode;
|
|
104
104
|
/**
|
|
105
105
|
* Compute a mode aggregate.
|
|
106
|
-
* @param {
|
|
106
|
+
* @param {ExprValue} expr The expression to aggregate.
|
|
107
107
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
108
108
|
*/
|
|
109
|
-
export function mode(expr:
|
|
109
|
+
export function mode(expr: ExprValue): AggregateNode;
|
|
110
110
|
/**
|
|
111
111
|
* Compute a last aggregate.
|
|
112
|
-
* @param {
|
|
112
|
+
* @param {ExprValue} expr The expression to aggregate.
|
|
113
113
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
114
114
|
*/
|
|
115
|
-
export function last(expr:
|
|
115
|
+
export function last(expr: ExprValue): AggregateNode;
|
|
116
116
|
/**
|
|
117
117
|
* Compute a product aggregate.
|
|
118
|
-
* @param {
|
|
118
|
+
* @param {ExprValue} expr The expression to aggregate.
|
|
119
119
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
120
120
|
*/
|
|
121
|
-
export function product(expr:
|
|
121
|
+
export function product(expr: ExprValue): AggregateNode;
|
|
122
122
|
/**
|
|
123
123
|
* Compute a quantile aggregate.
|
|
124
|
-
* @param {
|
|
125
|
-
* @param {
|
|
124
|
+
* @param {ExprValue} expr The expression to aggregate.
|
|
125
|
+
* @param {ExprValue} p The quantile value.
|
|
126
126
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
127
127
|
*/
|
|
128
|
-
export function quantile(expr:
|
|
128
|
+
export function quantile(expr: ExprValue, p: ExprValue): AggregateNode;
|
|
129
129
|
/**
|
|
130
130
|
* Compute a linear regression reg_avgX aggregate.
|
|
131
|
-
* @param {
|
|
132
|
-
* @param {
|
|
131
|
+
* @param {ExprValue} x The x expression to aggregate.
|
|
132
|
+
* @param {ExprValue} y The y expression to aggregate.
|
|
133
133
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
134
134
|
*/
|
|
135
|
-
export function regrAvgX(x:
|
|
135
|
+
export function regrAvgX(x: ExprValue, y: ExprValue): AggregateNode;
|
|
136
136
|
/**
|
|
137
137
|
* Compute a linear regression reg_avgY aggregate.
|
|
138
|
-
* @param {
|
|
139
|
-
* @param {
|
|
138
|
+
* @param {ExprValue} x The x expression to aggregate.
|
|
139
|
+
* @param {ExprValue} y The y expression to aggregate.
|
|
140
140
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
141
141
|
*/
|
|
142
|
-
export function regrAvgY(x:
|
|
142
|
+
export function regrAvgY(x: ExprValue, y: ExprValue): AggregateNode;
|
|
143
143
|
/**
|
|
144
144
|
* Compute a linear regression count aggregate.
|
|
145
145
|
* This returns the count of rows where both x and y are non-null.
|
|
146
|
-
* @param {
|
|
147
|
-
* @param {
|
|
146
|
+
* @param {ExprValue} x The x expression to aggregate.
|
|
147
|
+
* @param {ExprValue} y The y expression to aggregate.
|
|
148
148
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
149
149
|
*/
|
|
150
|
-
export function regrCount(x:
|
|
150
|
+
export function regrCount(x: ExprValue, y: ExprValue): AggregateNode;
|
|
151
151
|
/**
|
|
152
152
|
* Compute a linear regression intercept aggregate.
|
|
153
|
-
* @param {
|
|
154
|
-
* @param {
|
|
153
|
+
* @param {ExprValue} x The x expression to aggregate.
|
|
154
|
+
* @param {ExprValue} y The y expression to aggregate.
|
|
155
155
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
156
156
|
*/
|
|
157
|
-
export function regrIntercept(x:
|
|
157
|
+
export function regrIntercept(x: ExprValue, y: ExprValue): AggregateNode;
|
|
158
158
|
/**
|
|
159
159
|
* Compute a linear regression R^2 aggregate.
|
|
160
|
-
* @param {
|
|
161
|
-
* @param {
|
|
160
|
+
* @param {ExprValue} x The x expression to aggregate.
|
|
161
|
+
* @param {ExprValue} y The y expression to aggregate.
|
|
162
162
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
163
163
|
*/
|
|
164
|
-
export function regrR2(x:
|
|
164
|
+
export function regrR2(x: ExprValue, y: ExprValue): AggregateNode;
|
|
165
165
|
/**
|
|
166
166
|
* Compute a linear regression regr_sxx aggregate.
|
|
167
|
-
* @param {
|
|
168
|
-
* @param {
|
|
167
|
+
* @param {ExprValue} x The x expression to aggregate.
|
|
168
|
+
* @param {ExprValue} y The y expression to aggregate.
|
|
169
169
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
170
170
|
*/
|
|
171
|
-
export function regrSXX(x:
|
|
171
|
+
export function regrSXX(x: ExprValue, y: ExprValue): AggregateNode;
|
|
172
172
|
/**
|
|
173
173
|
* Compute a linear regression regr_sxy aggregate.
|
|
174
|
-
* @param {
|
|
175
|
-
* @param {
|
|
174
|
+
* @param {ExprValue} x The x expression to aggregate.
|
|
175
|
+
* @param {ExprValue} y The y expression to aggregate.
|
|
176
176
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
177
177
|
*/
|
|
178
|
-
export function regrSXY(x:
|
|
178
|
+
export function regrSXY(x: ExprValue, y: ExprValue): AggregateNode;
|
|
179
179
|
/**
|
|
180
180
|
* Compute a linear regression regr_syy aggregate.
|
|
181
|
-
* @param {
|
|
182
|
-
* @param {
|
|
181
|
+
* @param {ExprValue} x The x expression to aggregate.
|
|
182
|
+
* @param {ExprValue} y The y expression to aggregate.
|
|
183
183
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
184
184
|
*/
|
|
185
|
-
export function regrSYY(x:
|
|
185
|
+
export function regrSYY(x: ExprValue, y: ExprValue): AggregateNode;
|
|
186
186
|
/**
|
|
187
187
|
* Compute a linear regression slope aggregate.
|
|
188
|
-
* @param {
|
|
189
|
-
* @param {
|
|
188
|
+
* @param {ExprValue} x The x expression to aggregate.
|
|
189
|
+
* @param {ExprValue} y The y expression to aggregate.
|
|
190
190
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
191
191
|
*/
|
|
192
|
-
export function regrSlope(x:
|
|
192
|
+
export function regrSlope(x: ExprValue, y: ExprValue): AggregateNode;
|
|
193
193
|
/**
|
|
194
194
|
* Compute a skewness aggregate.
|
|
195
|
-
* @param {
|
|
195
|
+
* @param {ExprValue} expr The expression to aggregate.
|
|
196
196
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
197
197
|
*/
|
|
198
|
-
export function skewness(expr:
|
|
198
|
+
export function skewness(expr: ExprValue): AggregateNode;
|
|
199
199
|
/**
|
|
200
200
|
* Compute a sample standard deviation aggregate.
|
|
201
|
-
* @param {
|
|
201
|
+
* @param {ExprValue} expr The expression to aggregate.
|
|
202
202
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
203
203
|
*/
|
|
204
|
-
export function stddev(expr:
|
|
204
|
+
export function stddev(expr: ExprValue): AggregateNode;
|
|
205
205
|
/**
|
|
206
206
|
* Compute a population standard deviation aggregate.
|
|
207
|
-
* @param {
|
|
207
|
+
* @param {ExprValue} expr The expression to aggregate.
|
|
208
208
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
209
209
|
*/
|
|
210
|
-
export function stddevPop(expr:
|
|
210
|
+
export function stddevPop(expr: ExprValue): AggregateNode;
|
|
211
211
|
/**
|
|
212
212
|
* Compute a string aggregation.
|
|
213
|
-
* @param {
|
|
213
|
+
* @param {ExprValue} expr The expression to aggregate.
|
|
214
214
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
215
215
|
*/
|
|
216
|
-
export function stringAgg(expr:
|
|
216
|
+
export function stringAgg(expr: ExprValue): AggregateNode;
|
|
217
217
|
/**
|
|
218
218
|
* Compute a sum aggregate.
|
|
219
|
-
* @param {
|
|
219
|
+
* @param {ExprValue} expr The expression to aggregate.
|
|
220
220
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
221
221
|
*/
|
|
222
|
-
export function sum(expr:
|
|
222
|
+
export function sum(expr: ExprValue): AggregateNode;
|
|
223
223
|
/**
|
|
224
224
|
* Compute a sample variance aggregate.
|
|
225
|
-
* @param {
|
|
225
|
+
* @param {ExprValue} expr The expression to aggregate.
|
|
226
226
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
227
227
|
*/
|
|
228
|
-
export function variance(expr:
|
|
228
|
+
export function variance(expr: ExprValue): AggregateNode;
|
|
229
229
|
/**
|
|
230
230
|
* Compute a population variance aggregate.
|
|
231
|
-
* @param {
|
|
231
|
+
* @param {ExprValue} expr The expression to aggregate.
|
|
232
232
|
* @returns {AggregateNode} A SQL aggregate function call.
|
|
233
233
|
*/
|
|
234
|
-
export function varPop(expr:
|
|
235
|
-
import {
|
|
234
|
+
export function varPop(expr: ExprValue): AggregateNode;
|
|
235
|
+
import type { ExprValue } from '../types.js';
|
|
236
|
+
import type { AggregateNode } from '../ast/aggregate.js';
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Create a new conditional CASE statement. If three arguments are provided,
|
|
3
|
-
* acts like a ternary conditional (if, then else). If no arguments are
|
|
3
|
+
* acts like a ternary conditional (if, then, else). If no arguments are
|
|
4
4
|
* provided, the chained `when` and `else` methods can be used to to complete
|
|
5
5
|
* a conditional statement with WHEN/THEN and ELSE expressions.
|
|
6
|
-
* @param {
|
|
7
|
-
*
|
|
8
|
-
* @param {
|
|
9
|
-
* A THEN value expression.
|
|
10
|
-
* @param {import('../types.js').ExprValue} [other]
|
|
11
|
-
* An ELSE expression.
|
|
6
|
+
* @param {ExprValue} [when] A conditional WHEN expression.
|
|
7
|
+
* @param {ExprValue} [then] A THEN value expression.
|
|
8
|
+
* @param {ExprValue} [other] An ELSE expression.
|
|
12
9
|
* @returns {CaseNode}
|
|
13
10
|
*/
|
|
14
|
-
export function cond(when?:
|
|
11
|
+
export function cond(when?: ExprValue, then?: ExprValue, other?: ExprValue): CaseNode;
|
|
12
|
+
import type { ExprValue } from '../types.js';
|
|
15
13
|
import { CaseNode } from '../ast/case.js';
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Create a column reference.
|
|
3
|
-
* @param {string |
|
|
3
|
+
* @param {string | ParamLike} name The column name,
|
|
4
4
|
* as a string or as a dynamic parameter.
|
|
5
5
|
* @param {string | string[] | TableRefNode} [table] The table reference.
|
|
6
|
-
* @returns {
|
|
6
|
+
* @returns {ColumnRefNode}
|
|
7
7
|
*/
|
|
8
|
-
export function column(name: string |
|
|
8
|
+
export function column(name: string | ParamLike, table?: string | string[] | TableRefNode): ColumnRefNode;
|
|
9
|
+
import type { ParamLike } from '../types.js';
|
|
9
10
|
import { TableRefNode } from '../ast/table-ref.js';
|
|
11
|
+
import type { ColumnRefNode } from '../ast/column-ref.js';
|
|
@@ -7,38 +7,39 @@
|
|
|
7
7
|
export function interval(unit: string, steps: number): IntervalNode;
|
|
8
8
|
/**
|
|
9
9
|
* Given a date/time value, return the milliseconds since the UNIX epoch.
|
|
10
|
-
* @param {
|
|
10
|
+
* @param {ExprValue} expr The date/time expression.
|
|
11
11
|
* @returns {FunctionNode}
|
|
12
12
|
*/
|
|
13
|
-
export function epoch_ms(expr:
|
|
13
|
+
export function epoch_ms(expr: ExprValue): FunctionNode;
|
|
14
14
|
/**
|
|
15
15
|
* Perform data binning according to the provided interval unit and steps.
|
|
16
|
-
* @param {
|
|
16
|
+
* @param {ExprValue} expr The date/time expression to bin.
|
|
17
17
|
* @param {string} unit The datetime interval unit to bin by.
|
|
18
18
|
* @param {number} [steps=1] The number of interval steps.
|
|
19
19
|
* @returns {FunctionNode}
|
|
20
20
|
*/
|
|
21
|
-
export function dateBin(expr:
|
|
21
|
+
export function dateBin(expr: ExprValue, unit: string, steps?: number): FunctionNode;
|
|
22
22
|
/**
|
|
23
23
|
* Map date/times to a month value, all within the same year for comparison.
|
|
24
24
|
* The resulting value is still date-typed.
|
|
25
|
-
* @param {
|
|
25
|
+
* @param {ExprValue} expr The date/time expression.
|
|
26
26
|
* @returns {FunctionNode}
|
|
27
27
|
*/
|
|
28
|
-
export function dateMonth(expr:
|
|
28
|
+
export function dateMonth(expr: ExprValue): FunctionNode;
|
|
29
29
|
/**
|
|
30
30
|
* Map date/times to a month and day value, all within the same year for
|
|
31
31
|
* comparison. The resulting value is still date-typed.
|
|
32
|
-
* @param {
|
|
32
|
+
* @param {ExprValue} expr The date/time expression.
|
|
33
33
|
* @returns {FunctionNode}
|
|
34
34
|
*/
|
|
35
|
-
export function dateMonthDay(expr:
|
|
35
|
+
export function dateMonthDay(expr: ExprValue): FunctionNode;
|
|
36
36
|
/**
|
|
37
37
|
* Map date/times to a day of the month value, all within the same year and month
|
|
38
38
|
* for comparison. The resulting value is still date-typed.
|
|
39
|
-
* @param {
|
|
39
|
+
* @param {ExprValue} expr The date/time expression.
|
|
40
40
|
* @returns {FunctionNode}
|
|
41
41
|
*/
|
|
42
|
-
export function dateDay(expr:
|
|
42
|
+
export function dateDay(expr: ExprValue): FunctionNode;
|
|
43
43
|
import { IntervalNode } from '../ast/interval.js';
|
|
44
|
-
import {
|
|
44
|
+
import type { ExprValue } from '../types.js';
|
|
45
|
+
import type { FunctionNode } from '../ast/function.js';
|
|
@@ -1,93 +1,95 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Return true if the floating point value is not a number, false otherwise.
|
|
3
|
-
* @param {
|
|
4
|
-
* @returns {
|
|
3
|
+
* @param {ExprValue} expr The input number.
|
|
4
|
+
* @returns {FunctionNode}
|
|
5
5
|
*/
|
|
6
|
-
export function isNaN(expr:
|
|
6
|
+
export function isNaN(expr: ExprValue): FunctionNode;
|
|
7
7
|
/**
|
|
8
8
|
* Return true if the floating point value is finite, false otherwise.
|
|
9
|
-
* @param {
|
|
10
|
-
* @returns {
|
|
9
|
+
* @param {ExprValue} expr The input number.
|
|
10
|
+
* @returns {FunctionNode}
|
|
11
11
|
*/
|
|
12
|
-
export function isFinite(expr:
|
|
12
|
+
export function isFinite(expr: ExprValue): FunctionNode;
|
|
13
13
|
/**
|
|
14
14
|
* Return true if the floating point value is infinite, false otherwise.
|
|
15
|
-
* @param {
|
|
16
|
-
* @returns {
|
|
15
|
+
* @param {ExprValue} expr The input number.
|
|
16
|
+
* @returns {FunctionNode}
|
|
17
17
|
*/
|
|
18
|
-
export function isInfinite(expr:
|
|
18
|
+
export function isInfinite(expr: ExprValue): FunctionNode;
|
|
19
19
|
/**
|
|
20
20
|
* Selects the largest value.
|
|
21
|
-
* @param {...
|
|
22
|
-
* @returns {
|
|
21
|
+
* @param {...ExprValue} expr The input expressions.
|
|
22
|
+
* @returns {FunctionNode}
|
|
23
23
|
*/
|
|
24
|
-
export function greatest(...expr:
|
|
24
|
+
export function greatest(...expr: ExprValue[]): FunctionNode;
|
|
25
25
|
/**
|
|
26
26
|
* Selects the smallest value.
|
|
27
|
-
* @param {...
|
|
28
|
-
* @returns {
|
|
27
|
+
* @param {...ExprValue} expr The input expressions.
|
|
28
|
+
* @returns {FunctionNode}
|
|
29
29
|
*/
|
|
30
|
-
export function least(...expr:
|
|
30
|
+
export function least(...expr: ExprValue[]): FunctionNode;
|
|
31
31
|
/**
|
|
32
32
|
* Compute the exponentional function `e ** expr`.
|
|
33
|
-
* @param {
|
|
34
|
-
* @returns {
|
|
33
|
+
* @param {ExprValue} expr The input number.
|
|
34
|
+
* @returns {FunctionNode}
|
|
35
35
|
*/
|
|
36
|
-
export function exp(expr:
|
|
36
|
+
export function exp(expr: ExprValue): FunctionNode;
|
|
37
37
|
/**
|
|
38
38
|
* Compute a base 10 logarithm.
|
|
39
|
-
* @param {
|
|
40
|
-
* @returns {
|
|
39
|
+
* @param {ExprValue} expr The input number.
|
|
40
|
+
* @returns {FunctionNode}
|
|
41
41
|
*/
|
|
42
|
-
export function log(expr:
|
|
42
|
+
export function log(expr: ExprValue): FunctionNode;
|
|
43
43
|
/**
|
|
44
44
|
* Compute a natural logarithm.
|
|
45
|
-
* @param {
|
|
46
|
-
* @returns {
|
|
45
|
+
* @param {ExprValue} expr The input number.
|
|
46
|
+
* @returns {FunctionNode}
|
|
47
47
|
*/
|
|
48
|
-
export function ln(expr:
|
|
48
|
+
export function ln(expr: ExprValue): FunctionNode;
|
|
49
49
|
/**
|
|
50
50
|
* Compute the sign of a number.
|
|
51
|
-
* @param {
|
|
52
|
-
* @returns {
|
|
51
|
+
* @param {ExprValue} expr The input number.
|
|
52
|
+
* @returns {FunctionNode}
|
|
53
53
|
*/
|
|
54
|
-
export function sign(expr:
|
|
54
|
+
export function sign(expr: ExprValue): FunctionNode;
|
|
55
55
|
/**
|
|
56
56
|
* Compute the absolute value of a number.
|
|
57
|
-
* @param {
|
|
58
|
-
* @returns {
|
|
57
|
+
* @param {ExprValue} expr The input number.
|
|
58
|
+
* @returns {FunctionNode}
|
|
59
59
|
*/
|
|
60
|
-
export function abs(expr:
|
|
60
|
+
export function abs(expr: ExprValue): FunctionNode;
|
|
61
61
|
/**
|
|
62
62
|
* Compute the square root of a number.
|
|
63
|
-
* @param {
|
|
64
|
-
* @returns {
|
|
63
|
+
* @param {ExprValue} expr The input number.
|
|
64
|
+
* @returns {FunctionNode}
|
|
65
65
|
*/
|
|
66
|
-
export function sqrt(expr:
|
|
66
|
+
export function sqrt(expr: ExprValue): FunctionNode;
|
|
67
67
|
/**
|
|
68
68
|
* Rounds the number up.
|
|
69
|
-
* @param {
|
|
70
|
-
* @returns {
|
|
69
|
+
* @param {ExprValue} expr The input number.
|
|
70
|
+
* @returns {FunctionNode}
|
|
71
71
|
*/
|
|
72
|
-
export function ceil(expr:
|
|
72
|
+
export function ceil(expr: ExprValue): FunctionNode;
|
|
73
73
|
/**
|
|
74
74
|
* Rounds the number down.
|
|
75
|
-
* @param {
|
|
76
|
-
* @returns {
|
|
75
|
+
* @param {ExprValue} expr The input number.
|
|
76
|
+
* @returns {FunctionNode}
|
|
77
77
|
*/
|
|
78
|
-
export function floor(expr:
|
|
78
|
+
export function floor(expr: ExprValue): FunctionNode;
|
|
79
79
|
/**
|
|
80
80
|
* Round to the given decimal places.
|
|
81
|
-
* @param {
|
|
82
|
-
* @param {
|
|
81
|
+
* @param {ExprValue} expr The input number.
|
|
82
|
+
* @param {ExprValue} [places] The decimal places.
|
|
83
83
|
* Negative values are allowed, to round to tens, hundreds, etc.
|
|
84
84
|
* If unspecified, defaults to zero.
|
|
85
|
-
* @returns {
|
|
85
|
+
* @returns {FunctionNode}
|
|
86
86
|
*/
|
|
87
|
-
export function round(expr:
|
|
87
|
+
export function round(expr: ExprValue, places?: ExprValue): FunctionNode;
|
|
88
88
|
/**
|
|
89
89
|
* Truncates the number.
|
|
90
|
-
* @param {
|
|
91
|
-
* @returns {
|
|
90
|
+
* @param {ExprValue} expr The input number.
|
|
91
|
+
* @returns {FunctionNode}
|
|
92
92
|
*/
|
|
93
|
-
export function trunc(expr:
|
|
93
|
+
export function trunc(expr: ExprValue): FunctionNode;
|
|
94
|
+
import type { ExprValue } from '../types.js';
|
|
95
|
+
import type { FunctionNode } from '../ast/function.js';
|