df-script 1.4.0 → 1.5.0
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/README.md +83 -34
- package/dist/api.d.ts +16 -8
- package/dist/api.js +11 -3
- package/dist/columnExpressions/ColumnExpr.d.ts +26 -364
- package/dist/columnExpressions/ColumnExpr.js +199 -3
- package/dist/columnExpressions/ExprBase.d.ts +8 -11
- package/dist/columnExpressions/ExprBase.js +20 -61
- package/dist/columnExpressions/constants.d.ts +2 -0
- package/dist/columnExpressions/constants.js +3 -1
- package/dist/columnExpressions/functions/coalesce.js +8 -4
- package/dist/columnExpressions/functions/element.d.ts +5 -0
- package/dist/columnExpressions/functions/element.js +11 -0
- package/dist/columnExpressions/functions/implode.d.ts +3 -0
- package/dist/columnExpressions/functions/implode.js +7 -0
- package/dist/columnExpressions/functions/lit.d.ts +3 -1
- package/dist/columnExpressions/functions/lit.js +8 -13
- package/dist/columnExpressions/functions/repeat.d.ts +47 -0
- package/dist/columnExpressions/functions/repeat.js +131 -0
- package/dist/columnExpressions/functions/seq_range.d.ts +31 -0
- package/dist/columnExpressions/functions/seq_range.js +91 -0
- package/dist/columnExpressions/functions/when.js +8 -4
- package/dist/columnExpressions/index.d.ts +5 -2
- package/dist/columnExpressions/index.js +5 -48
- package/dist/columnExpressions/mixins/AggregationExpr.d.ts +25 -50
- package/dist/columnExpressions/mixins/AggregationExpr.js +69 -165
- package/dist/columnExpressions/mixins/ArithmeticExpr.d.ts +41 -66
- package/dist/columnExpressions/mixins/ArithmeticExpr.js +126 -138
- package/dist/columnExpressions/mixins/BooleanExpr.d.ts +40 -0
- package/dist/columnExpressions/mixins/BooleanExpr.js +67 -0
- package/dist/columnExpressions/mixins/ComparisonExpr.d.ts +31 -60
- package/dist/columnExpressions/mixins/ComparisonExpr.js +231 -370
- package/dist/columnExpressions/mixins/ListExpr.d.ts +15 -39
- package/dist/columnExpressions/mixins/ListExpr.js +124 -148
- package/dist/columnExpressions/mixins/LogicalExpr.d.ts +7 -33
- package/dist/columnExpressions/mixins/LogicalExpr.js +48 -49
- package/dist/columnExpressions/mixins/ManipulationExpr.d.ts +6 -31
- package/dist/columnExpressions/mixins/ManipulationExpr.js +61 -25
- package/dist/columnExpressions/mixins/NumericExpr.d.ts +92 -0
- package/dist/columnExpressions/mixins/NumericExpr.js +259 -0
- package/dist/columnExpressions/mixins/StringExpr.d.ts +5 -30
- package/dist/columnExpressions/mixins/StringExpr.js +37 -49
- package/dist/columnExpressions/mixins/StructExpr.d.ts +16 -0
- package/dist/columnExpressions/mixins/StructExpr.js +139 -0
- package/dist/columnExpressions/mixins/TemporalExpr.d.ts +4 -30
- package/dist/columnExpressions/mixins/TemporalExpr.js +28 -29
- package/dist/columnExpressions/mixins/WindowExpr.d.ts +27 -49
- package/dist/columnExpressions/mixins/WindowExpr.js +144 -274
- package/dist/columnExpressions/utils.d.ts +4 -0
- package/dist/columnExpressions/utils.js +45 -0
- package/dist/dataframe/constants.d.ts +3 -0
- package/dist/dataframe/constants.js +4 -1
- package/dist/dataframe/dataframe.d.ts +27 -10
- package/dist/dataframe/dataframe.js +461 -220
- package/dist/dataframe/grouped/grouped.d.ts +2 -3
- package/dist/dataframe/grouped/grouped.js +17 -16
- package/dist/dataframe/types.d.ts +65 -1
- package/dist/dataframe/utils.d.ts +11 -3
- package/dist/dataframe/utils.js +101 -9
- package/dist/datatypes/DataType.d.ts +2 -1
- package/dist/datatypes/DataType.js +29 -0
- package/dist/datatypes/index.d.ts +2 -2
- package/dist/datatypes/types.d.ts +37 -36
- package/dist/datatypes/types.js +15 -11
- package/dist/exceptions/index.d.ts +2 -0
- package/dist/exceptions/index.js +4 -1
- package/dist/exceptions/utils.d.ts +1 -0
- package/dist/exceptions/utils.js +19 -0
- package/dist/functions/concat.d.ts +1 -2
- package/dist/functions/concat.js +24 -12
- package/dist/functions/index.d.ts +3 -1
- package/dist/functions/index.js +7 -15
- package/dist/functions/read_csv.d.ts +8 -0
- package/dist/functions/read_csv.js +53 -0
- package/dist/functions/read_json.d.ts +10 -0
- package/dist/functions/read_json.js +21 -0
- package/dist/functions/transpose.d.ts +7 -0
- package/dist/functions/transpose.js +84 -0
- package/dist/index.js +6 -1
- package/dist/types.d.ts +31 -5
- package/dist/utils/csv.d.ts +77 -0
- package/dist/utils/csv.js +313 -0
- package/dist/utils/date.js +5 -6
- package/dist/utils/guards.d.ts +0 -2
- package/dist/utils/guards.js +0 -31
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/json.d.ts +120 -2
- package/dist/utils/json.js +204 -20
- package/dist/utils/list.d.ts +173 -1
- package/dist/utils/list.js +255 -22
- package/dist/utils/number.d.ts +61 -28
- package/dist/utils/number.js +248 -70
- package/dist/utils/string.d.ts +5 -0
- package/dist/utils/string.js +89 -0
- package/package.json +5 -1
|
@@ -14,9 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.resolveColumnSelectors = resolveColumnSelectors;
|
|
18
|
-
const ColumnExpr_1 = require("./ColumnExpr");
|
|
19
|
-
const constants_1 = require("./constants");
|
|
20
17
|
__exportStar(require("./constants"), exports);
|
|
21
18
|
__exportStar(require("./types"), exports);
|
|
22
19
|
__exportStar(require("./ExprBase"), exports);
|
|
@@ -28,54 +25,14 @@ __exportStar(require("./mixins/AggregationExpr"), exports);
|
|
|
28
25
|
__exportStar(require("./mixins/WindowExpr"), exports);
|
|
29
26
|
__exportStar(require("./mixins/TemporalExpr"), exports);
|
|
30
27
|
__exportStar(require("./mixins/ListExpr"), exports);
|
|
28
|
+
__exportStar(require("./mixins/StructExpr"), exports);
|
|
31
29
|
__exportStar(require("./ColumnExpr"), exports);
|
|
32
30
|
__exportStar(require("./functions/lit"), exports);
|
|
33
31
|
__exportStar(require("./functions/all"), exports);
|
|
34
32
|
__exportStar(require("./functions/exclude"), exports);
|
|
35
33
|
__exportStar(require("./functions/coalesce"), exports);
|
|
36
34
|
__exportStar(require("./functions/when"), exports);
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
if (typeof expr === "string") {
|
|
42
|
-
expanded.push(new ColumnExpr_1.ColumnExpr(expr));
|
|
43
|
-
}
|
|
44
|
-
else if (expr instanceof ColumnExpr_1.ColumnExpr && expr.colName === constants_1.ALL_COLUMNS_MARKER) {
|
|
45
|
-
const excluded = new Set(expr.excludedCols);
|
|
46
|
-
for (const key of allKeys) {
|
|
47
|
-
if (!excludeSet.has(key) && !excluded.has(key)) {
|
|
48
|
-
const concrete = new ColumnExpr_1.ColumnExpr(key);
|
|
49
|
-
concrete.ops = [...expr.ops];
|
|
50
|
-
concrete.aggFn = expr.aggFn;
|
|
51
|
-
concrete.partitionOpsIndex = expr.partitionOpsIndex;
|
|
52
|
-
concrete.groupingOpsIndex = expr.groupingOpsIndex;
|
|
53
|
-
concrete.partitionBy = expr.partitionBy;
|
|
54
|
-
if (expr.evaluateWindow) {
|
|
55
|
-
concrete.evaluateWindow = expr.evaluateWindow;
|
|
56
|
-
}
|
|
57
|
-
if (expr.outputName && expr.outputName !== constants_1.ALL_COLUMNS_MARKER) {
|
|
58
|
-
concrete.outputName = expr.outputName;
|
|
59
|
-
}
|
|
60
|
-
expanded.push(concrete);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
else if (expr && typeof expr === 'object' && 'evaluate' in expr && !expr.colName) {
|
|
65
|
-
for (const key of allKeys) {
|
|
66
|
-
if (!excludeSet.has(key)) {
|
|
67
|
-
const concrete = new ColumnExpr_1.ColumnExpr(key);
|
|
68
|
-
concrete.ops = [...expr.ops];
|
|
69
|
-
concrete.aggFn = expr.aggFn;
|
|
70
|
-
concrete.groupingOpsIndex = expr.groupingOpsIndex;
|
|
71
|
-
concrete.partitionOpsIndex = expr.partitionOpsIndex;
|
|
72
|
-
expanded.push(concrete);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
expanded.push(expr);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
return expanded;
|
|
81
|
-
}
|
|
35
|
+
__exportStar(require("./functions/implode"), exports);
|
|
36
|
+
__exportStar(require("./functions/seq_range"), exports);
|
|
37
|
+
__exportStar(require("./functions/element"), exports);
|
|
38
|
+
__exportStar(require("./utils"), exports);
|
|
@@ -1,50 +1,25 @@
|
|
|
1
|
-
import type { AggFn } from "../../types";
|
|
2
|
-
import
|
|
3
|
-
export declare
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
ops: import("../../types").OpFn[];
|
|
27
|
-
colName?: string;
|
|
28
|
-
outputName?: string;
|
|
29
|
-
isLiteral?: boolean;
|
|
30
|
-
literalValue?: any;
|
|
31
|
-
groupingOpsIndex?: number;
|
|
32
|
-
partitionOpsIndex?: number;
|
|
33
|
-
partitionBy?: (string | import("../../types").IExpr)[] | null;
|
|
34
|
-
windowOp?: {
|
|
35
|
-
type: string;
|
|
36
|
-
[key: string]: any;
|
|
37
|
-
} | null;
|
|
38
|
-
isWindow?: boolean;
|
|
39
|
-
alias(name: string): /*elided*/ any;
|
|
40
|
-
cast(dataType: any): /*elided*/ any;
|
|
41
|
-
_resolve(val: any, columns: import("../../types").ColumnDict, height: number): import("../../types").ColumnData | any;
|
|
42
|
-
evaluate(columns: import("../../types").ColumnDict, height: number): import("../../types").ColumnData;
|
|
43
|
-
evaluatePreGrouping(columns: import("../../types").ColumnDict, height: number): import("../../types").ColumnData;
|
|
44
|
-
evaluatePostGrouping(aggregatedArray: any[], columns: import("../../types").ColumnDict): import("../../types").ColumnData;
|
|
45
|
-
evaluatePrePartition(columns: import("../../types").ColumnDict, height: number): import("../../types").ColumnData;
|
|
46
|
-
evaluatePostPartition(aggregatedArray: any[], columns: import("../../types").ColumnDict): import("../../types").ColumnData;
|
|
47
|
-
evaluateWindow?(groupPreValues: any[], partitionIndices: number[], currentIndex: number): any;
|
|
48
|
-
debug(label?: string): /*elided*/ any;
|
|
49
|
-
};
|
|
50
|
-
} & TBase;
|
|
1
|
+
import type { AggFn, UniqueListStatsOptions } from "../../types";
|
|
2
|
+
import { ExprBase } from "../ExprBase";
|
|
3
|
+
export declare class AggregationExpr extends ExprBase {
|
|
4
|
+
_deriveAgg(fn: AggFn<any>): this;
|
|
5
|
+
all(): this;
|
|
6
|
+
all_null(): this;
|
|
7
|
+
any(): this;
|
|
8
|
+
any_null(): this;
|
|
9
|
+
avg(): this;
|
|
10
|
+
count(options?: {
|
|
11
|
+
includeNulls?: boolean;
|
|
12
|
+
}): this;
|
|
13
|
+
first(): this;
|
|
14
|
+
implode(): this;
|
|
15
|
+
last(): this;
|
|
16
|
+
max(): this;
|
|
17
|
+
mean(): this;
|
|
18
|
+
median(): this;
|
|
19
|
+
min(): this;
|
|
20
|
+
mode(): this;
|
|
21
|
+
n_unique(options?: UniqueListStatsOptions): this;
|
|
22
|
+
quantile(q: number): this;
|
|
23
|
+
std(): this;
|
|
24
|
+
sum(): this;
|
|
25
|
+
}
|
|
@@ -4,169 +4,73 @@ exports.AggregationExpr = void 0;
|
|
|
4
4
|
const ExprBase_1 = require("../ExprBase");
|
|
5
5
|
const exceptions_1 = require("../../exceptions");
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
return null;
|
|
77
|
-
const len = v.length;
|
|
78
|
-
const nums = [];
|
|
79
|
-
for (let i = 0; i < len; i++) {
|
|
80
|
-
const val = v[i];
|
|
81
|
-
if (val != null) {
|
|
82
|
-
nums.push(val);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
const numsLen = nums.length;
|
|
86
|
-
if (numsLen === 0)
|
|
87
|
-
return null;
|
|
88
|
-
nums.sort((a, b) => a - b);
|
|
89
|
-
const mid = Math.floor(numsLen / 2);
|
|
90
|
-
return numsLen % 2 !== 0
|
|
91
|
-
? nums[mid]
|
|
92
|
-
: (nums[mid - 1] + nums[mid]) / 2;
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
min() {
|
|
96
|
-
return this._deriveAgg(v => (0, utils_1.getListStats)(v).min);
|
|
97
|
-
}
|
|
98
|
-
mode() {
|
|
99
|
-
return this._deriveAgg(v => {
|
|
100
|
-
if (!(0, utils_1.isArrayOrTypedArray)(v))
|
|
101
|
-
return null;
|
|
102
|
-
const len = v.length;
|
|
103
|
-
const counts = new Map();
|
|
104
|
-
let maxCount = 0;
|
|
105
|
-
for (let i = 0; i < len; i++) {
|
|
106
|
-
const val = v[i];
|
|
107
|
-
if (val == null)
|
|
108
|
-
continue;
|
|
109
|
-
const c = (counts.get(val) ?? 0) + 1;
|
|
110
|
-
counts.set(val, c);
|
|
111
|
-
if (c > maxCount)
|
|
112
|
-
maxCount = c;
|
|
113
|
-
}
|
|
114
|
-
if (maxCount === 0)
|
|
115
|
-
return null;
|
|
116
|
-
const modes = [];
|
|
117
|
-
for (const [val, c] of counts.entries()) {
|
|
118
|
-
if (c === maxCount) {
|
|
119
|
-
modes.push(val);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
if (modes.length === 0)
|
|
123
|
-
return null;
|
|
124
|
-
modes.sort((a, b) => {
|
|
125
|
-
if (a == null && b == null)
|
|
126
|
-
return 0;
|
|
127
|
-
if (a == null)
|
|
128
|
-
return 1;
|
|
129
|
-
if (b == null)
|
|
130
|
-
return -1;
|
|
131
|
-
if (a < b)
|
|
132
|
-
return -1;
|
|
133
|
-
if (a > b)
|
|
134
|
-
return 1;
|
|
135
|
-
return 0;
|
|
136
|
-
});
|
|
137
|
-
return modes[0];
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
n_unique() {
|
|
141
|
-
return this._deriveAgg(v => new Set(v).size);
|
|
142
|
-
}
|
|
143
|
-
quantile(q) {
|
|
144
|
-
if (q < 0 || q > 1)
|
|
145
|
-
throw new exceptions_1.ComputeError("Quantile q must be between 0 and 1");
|
|
146
|
-
return this._deriveAgg(v => {
|
|
147
|
-
const f = [];
|
|
148
|
-
for (let i = 0; i < v.length; i++) {
|
|
149
|
-
if (v[i] != null)
|
|
150
|
-
f.push(v[i]);
|
|
151
|
-
}
|
|
152
|
-
const fLen = f.length;
|
|
153
|
-
if (!fLen)
|
|
154
|
-
return null;
|
|
155
|
-
f.sort((a, b) => a - b);
|
|
156
|
-
const idx = (fLen - 1) * q;
|
|
157
|
-
const low = Math.floor(idx);
|
|
158
|
-
const high = Math.ceil(idx);
|
|
159
|
-
if (low === high)
|
|
160
|
-
return f[low];
|
|
161
|
-
return f[low] + (idx - low) * (f[high] - f[low]);
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
std() {
|
|
165
|
-
return this._deriveAgg(v => (0, utils_1.getListStats)(v).std);
|
|
166
|
-
}
|
|
167
|
-
sum() {
|
|
168
|
-
return this._deriveAgg(v => (0, utils_1.getListStats)(v).sum);
|
|
169
|
-
}
|
|
170
|
-
};
|
|
171
|
-
};
|
|
7
|
+
class AggregationExpr extends ExprBase_1.ExprBase {
|
|
8
|
+
_deriveAgg(fn) {
|
|
9
|
+
const newInst = (0, ExprBase_1.derive)(this);
|
|
10
|
+
newInst.aggFn = fn;
|
|
11
|
+
newInst.groupingOpsIndex = this.ops.length;
|
|
12
|
+
newInst.partitionOpsIndex = this.ops.length;
|
|
13
|
+
return newInst;
|
|
14
|
+
}
|
|
15
|
+
all() {
|
|
16
|
+
return this._deriveAgg(v => (0, utils_1.isArrayOfType)(v, (x) => !!x, { mode: "every" }));
|
|
17
|
+
}
|
|
18
|
+
all_null() {
|
|
19
|
+
return this._deriveAgg(v => (0, utils_1.isArrayOfType)(v, "nullish", { mode: "every" }));
|
|
20
|
+
}
|
|
21
|
+
any() {
|
|
22
|
+
return this._deriveAgg(v => (0, utils_1.isArrayOfType)(v, (x) => !!x, { mode: "some" }));
|
|
23
|
+
}
|
|
24
|
+
any_null() {
|
|
25
|
+
return this._deriveAgg(v => (0, utils_1.isArrayOfType)(v, "nullish", { mode: "some" }));
|
|
26
|
+
}
|
|
27
|
+
avg() {
|
|
28
|
+
return this._deriveAgg(v => (0, utils_1.getListStats)(v).mean);
|
|
29
|
+
}
|
|
30
|
+
count(options = {}) {
|
|
31
|
+
if (options.includeNulls)
|
|
32
|
+
return this._deriveAgg(v => v.length);
|
|
33
|
+
return this._deriveAgg(v => (0, utils_1.getListStats)(v).count);
|
|
34
|
+
}
|
|
35
|
+
first() {
|
|
36
|
+
return this._deriveAgg(v => v[0] ?? null);
|
|
37
|
+
}
|
|
38
|
+
implode() {
|
|
39
|
+
return this._deriveAgg(v => v);
|
|
40
|
+
}
|
|
41
|
+
last() {
|
|
42
|
+
return this._deriveAgg(v => v[v.length - 1] ?? null);
|
|
43
|
+
}
|
|
44
|
+
max() {
|
|
45
|
+
return this._deriveAgg(v => (0, utils_1.getListStats)(v).max);
|
|
46
|
+
}
|
|
47
|
+
mean() {
|
|
48
|
+
return this.avg();
|
|
49
|
+
}
|
|
50
|
+
median() {
|
|
51
|
+
return this._deriveAgg(v => (0, utils_1.computeMedian)(v));
|
|
52
|
+
}
|
|
53
|
+
min() {
|
|
54
|
+
return this._deriveAgg(v => (0, utils_1.getListStats)(v).min);
|
|
55
|
+
}
|
|
56
|
+
mode() {
|
|
57
|
+
return this._deriveAgg(v => (0, utils_1.computeMode)(v));
|
|
58
|
+
}
|
|
59
|
+
n_unique(options = {}) {
|
|
60
|
+
return this._deriveAgg(v => {
|
|
61
|
+
return (0, utils_1.getUniqueListStats)(v, options).count;
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
quantile(q) {
|
|
65
|
+
if (q < 0 || q > 1)
|
|
66
|
+
throw new exceptions_1.ComputeError("Quantile q must be between 0 and 1");
|
|
67
|
+
return this._deriveAgg(v => (0, utils_1.computeQuantile)(v, q));
|
|
68
|
+
}
|
|
69
|
+
std() {
|
|
70
|
+
return this._deriveAgg(v => (0, utils_1.getListStats)(v).std);
|
|
71
|
+
}
|
|
72
|
+
sum() {
|
|
73
|
+
return this._deriveAgg(v => (0, utils_1.getListStats)(v).sum);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
172
76
|
exports.AggregationExpr = AggregationExpr;
|
|
@@ -1,67 +1,42 @@
|
|
|
1
1
|
import type { IExpr } from "../../types";
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
colName?: string;
|
|
44
|
-
outputName?: string;
|
|
45
|
-
isLiteral?: boolean;
|
|
46
|
-
literalValue?: any;
|
|
47
|
-
aggFn?: import("../../types").AggFn<any> | null;
|
|
48
|
-
groupingOpsIndex?: number;
|
|
49
|
-
partitionOpsIndex?: number;
|
|
50
|
-
partitionBy?: (string | IExpr)[] | null;
|
|
51
|
-
windowOp?: {
|
|
52
|
-
type: string;
|
|
53
|
-
[key: string]: any;
|
|
54
|
-
} | null;
|
|
55
|
-
isWindow?: boolean;
|
|
56
|
-
alias(name: string): /*elided*/ any;
|
|
57
|
-
cast(dataType: any): /*elided*/ any;
|
|
58
|
-
_resolve(val: any, columns: import("../../types").ColumnDict, height: number): import("../../types").ColumnData | any;
|
|
59
|
-
evaluate(columns: import("../../types").ColumnDict, height: number): import("../../types").ColumnData;
|
|
60
|
-
evaluatePreGrouping(columns: import("../../types").ColumnDict, height: number): import("../../types").ColumnData;
|
|
61
|
-
evaluatePostGrouping(aggregatedArray: any[], columns: import("../../types").ColumnDict): import("../../types").ColumnData;
|
|
62
|
-
evaluatePrePartition(columns: import("../../types").ColumnDict, height: number): import("../../types").ColumnData;
|
|
63
|
-
evaluatePostPartition(aggregatedArray: any[], columns: import("../../types").ColumnDict): import("../../types").ColumnData;
|
|
64
|
-
evaluateWindow?(groupPreValues: any[], partitionIndices: number[], currentIndex: number): any;
|
|
65
|
-
debug(label?: string): /*elided*/ any;
|
|
66
|
-
};
|
|
67
|
-
} & TBase;
|
|
2
|
+
import type { RandomOptions } from "../types";
|
|
3
|
+
import { ExprBase } from "../ExprBase";
|
|
4
|
+
export declare class ArithmeticExpr extends ExprBase {
|
|
5
|
+
abs(): this;
|
|
6
|
+
acos(): this;
|
|
7
|
+
acosh(): this;
|
|
8
|
+
add(val: number | IExpr | null): this;
|
|
9
|
+
asin(): this;
|
|
10
|
+
asinh(): this;
|
|
11
|
+
atan(): this;
|
|
12
|
+
atanh(): this;
|
|
13
|
+
cbrt(): this;
|
|
14
|
+
ceil(): this;
|
|
15
|
+
clip(lower?: number | null, upper?: number | null): this;
|
|
16
|
+
cos(): this;
|
|
17
|
+
cosh(): this;
|
|
18
|
+
degrees(): this;
|
|
19
|
+
div(val: number | IExpr | null): this;
|
|
20
|
+
exp(): this;
|
|
21
|
+
expm1(): this;
|
|
22
|
+
floor(): this;
|
|
23
|
+
floordiv(val: number | IExpr | null): this;
|
|
24
|
+
hypot(val: number | IExpr | null): this;
|
|
25
|
+
log(base?: number): this;
|
|
26
|
+
log1p(): this;
|
|
27
|
+
mod(val: number | IExpr | null): this;
|
|
28
|
+
mul(val: number | IExpr | null): this;
|
|
29
|
+
negate(): this;
|
|
30
|
+
pow(val: number | IExpr | null): this;
|
|
31
|
+
radians(): this;
|
|
32
|
+
rand(seed?: number, { min, max, integer }?: RandomOptions): this;
|
|
33
|
+
round(decimals?: number): this;
|
|
34
|
+
sign(): this;
|
|
35
|
+
sin(): this;
|
|
36
|
+
sinh(): this;
|
|
37
|
+
sqrt(): this;
|
|
38
|
+
sub(val: number | IExpr | null): this;
|
|
39
|
+
tan(): this;
|
|
40
|
+
tanh(): this;
|
|
41
|
+
trunc(): this;
|
|
42
|
+
}
|