df-script 1.4.0 → 1.6.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.
Files changed (142) hide show
  1. package/README.md +203 -38
  2. package/dist/api.d.ts +16 -8
  3. package/dist/columnExpressions/ColumnExpr.d.ts +26 -364
  4. package/dist/columnExpressions/ExprBase.d.ts +8 -11
  5. package/dist/columnExpressions/constants.d.ts +2 -0
  6. package/dist/columnExpressions/functions/coalesce.d.ts +2 -2
  7. package/dist/columnExpressions/functions/element.d.ts +5 -0
  8. package/dist/columnExpressions/functions/implode.d.ts +3 -0
  9. package/dist/columnExpressions/functions/lit.d.ts +3 -1
  10. package/dist/columnExpressions/functions/seq_range.d.ts +31 -0
  11. package/dist/columnExpressions/functions/when.d.ts +2 -2
  12. package/dist/columnExpressions/index.d.ts +6 -3
  13. package/dist/columnExpressions/mixins/AggregationExpr.d.ts +25 -50
  14. package/dist/columnExpressions/mixins/ArithmeticExpr.d.ts +43 -67
  15. package/dist/columnExpressions/mixins/ArrayExpr.d.ts +39 -0
  16. package/dist/columnExpressions/mixins/ComparisonExpr.d.ts +31 -60
  17. package/dist/columnExpressions/mixins/ListExpr.d.ts +16 -40
  18. package/dist/columnExpressions/mixins/LogicalExpr.d.ts +7 -33
  19. package/dist/columnExpressions/mixins/ManipulationExpr.d.ts +6 -31
  20. package/dist/columnExpressions/mixins/StringExpr.d.ts +7 -32
  21. package/dist/columnExpressions/mixins/StructExpr.d.ts +16 -0
  22. package/dist/columnExpressions/mixins/TemporalExpr.d.ts +4 -30
  23. package/dist/columnExpressions/mixins/WindowExpr.d.ts +27 -49
  24. package/dist/columnExpressions/types.d.ts +1 -0
  25. package/dist/columnExpressions/utils.d.ts +4 -0
  26. package/dist/constants.d.ts +11 -0
  27. package/dist/dataframe/constants.d.ts +3 -0
  28. package/dist/dataframe/dataframe.d.ts +28 -11
  29. package/dist/dataframe/grouped/grouped.d.ts +2 -3
  30. package/dist/dataframe/types.d.ts +65 -1
  31. package/dist/dataframe/utils.d.ts +11 -3
  32. package/dist/datatypes/DataType.d.ts +2 -1
  33. package/dist/datatypes/index.d.ts +4 -3
  34. package/dist/datatypes/types.d.ts +42 -41
  35. package/dist/exceptions/index.d.ts +2 -0
  36. package/dist/exceptions/utils.d.ts +1 -0
  37. package/dist/functions/concat.d.ts +1 -2
  38. package/dist/functions/index.d.ts +3 -1
  39. package/dist/functions/read_csv.d.ts +8 -0
  40. package/dist/functions/read_json.d.ts +10 -0
  41. package/dist/index.js +6 -1
  42. package/dist/types.d.ts +34 -6
  43. package/dist/utils/array.d.ts +217 -0
  44. package/dist/utils/binary.d.ts +3 -0
  45. package/dist/utils/csv.d.ts +77 -0
  46. package/dist/utils/date.d.ts +21 -35
  47. package/dist/utils/guards.d.ts +11 -12
  48. package/dist/utils/index.d.ts +5 -2
  49. package/dist/utils/json.d.ts +120 -2
  50. package/dist/utils/list.d.ts +196 -2
  51. package/dist/utils/number.d.ts +47 -29
  52. package/dist/utils/object.d.ts +26 -0
  53. package/dist/utils/string.d.ts +7 -4
  54. package/package.json +6 -2
  55. package/dist/api.js +0 -18
  56. package/dist/bundle.min.js +0 -1
  57. package/dist/columnExpressions/ColumnExpr.js +0 -23
  58. package/dist/columnExpressions/ExprBase.js +0 -133
  59. package/dist/columnExpressions/constants.js +0 -5
  60. package/dist/columnExpressions/functions/all.js +0 -11
  61. package/dist/columnExpressions/functions/coalesce.js +0 -40
  62. package/dist/columnExpressions/functions/exclude.js +0 -13
  63. package/dist/columnExpressions/functions/lit.js +0 -22
  64. package/dist/columnExpressions/functions/when.js +0 -81
  65. package/dist/columnExpressions/index.js +0 -81
  66. package/dist/columnExpressions/mixins/AggregationExpr.js +0 -172
  67. package/dist/columnExpressions/mixins/ArithmeticExpr.js +0 -143
  68. package/dist/columnExpressions/mixins/ComparisonExpr.js +0 -389
  69. package/dist/columnExpressions/mixins/ListExpr.js +0 -248
  70. package/dist/columnExpressions/mixins/LogicalExpr.js +0 -54
  71. package/dist/columnExpressions/mixins/ManipulationExpr.js +0 -35
  72. package/dist/columnExpressions/mixins/StringExpr.js +0 -249
  73. package/dist/columnExpressions/mixins/TemporalExpr.js +0 -127
  74. package/dist/columnExpressions/mixins/WindowExpr.js +0 -281
  75. package/dist/columnExpressions/types.js +0 -2
  76. package/dist/dataframe/constants.js +0 -4
  77. package/dist/dataframe/dataframe.js +0 -749
  78. package/dist/dataframe/grouped/grouped.js +0 -113
  79. package/dist/dataframe/index.js +0 -20
  80. package/dist/dataframe/types.js +0 -2
  81. package/dist/dataframe/utils.js +0 -215
  82. package/dist/datatypes/DataType.js +0 -47
  83. package/dist/datatypes/index.js +0 -46
  84. package/dist/datatypes/types/Binary.d.ts +0 -9
  85. package/dist/datatypes/types/Binary.js +0 -18
  86. package/dist/datatypes/types/Boolean.d.ts +0 -9
  87. package/dist/datatypes/types/Boolean.js +0 -19
  88. package/dist/datatypes/types/Date.d.ts +0 -8
  89. package/dist/datatypes/types/Date.js +0 -21
  90. package/dist/datatypes/types/Datetime.d.ts +0 -8
  91. package/dist/datatypes/types/Datetime.js +0 -17
  92. package/dist/datatypes/types/Decimal.d.ts +0 -10
  93. package/dist/datatypes/types/Decimal.js +0 -28
  94. package/dist/datatypes/types/Duration.d.ts +0 -8
  95. package/dist/datatypes/types/Duration.js +0 -17
  96. package/dist/datatypes/types/Float32.d.ts +0 -8
  97. package/dist/datatypes/types/Float32.js +0 -17
  98. package/dist/datatypes/types/Float64.d.ts +0 -8
  99. package/dist/datatypes/types/Float64.js +0 -17
  100. package/dist/datatypes/types/Int16.d.ts +0 -8
  101. package/dist/datatypes/types/Int16.js +0 -17
  102. package/dist/datatypes/types/Int32.d.ts +0 -8
  103. package/dist/datatypes/types/Int32.js +0 -17
  104. package/dist/datatypes/types/Int64.d.ts +0 -8
  105. package/dist/datatypes/types/Int64.js +0 -17
  106. package/dist/datatypes/types/Int8.d.ts +0 -8
  107. package/dist/datatypes/types/Int8.js +0 -17
  108. package/dist/datatypes/types/List.d.ts +0 -10
  109. package/dist/datatypes/types/List.js +0 -31
  110. package/dist/datatypes/types/Null.d.ts +0 -9
  111. package/dist/datatypes/types/Null.js +0 -17
  112. package/dist/datatypes/types/Object.d.ts +0 -9
  113. package/dist/datatypes/types/Object.js +0 -17
  114. package/dist/datatypes/types/Struct.d.ts +0 -14
  115. package/dist/datatypes/types/Struct.js +0 -39
  116. package/dist/datatypes/types/Time.d.ts +0 -8
  117. package/dist/datatypes/types/Time.js +0 -29
  118. package/dist/datatypes/types/UInt16.d.ts +0 -8
  119. package/dist/datatypes/types/UInt16.js +0 -17
  120. package/dist/datatypes/types/UInt32.d.ts +0 -8
  121. package/dist/datatypes/types/UInt32.js +0 -17
  122. package/dist/datatypes/types/UInt64.d.ts +0 -8
  123. package/dist/datatypes/types/UInt64.js +0 -17
  124. package/dist/datatypes/types/UInt8.d.ts +0 -8
  125. package/dist/datatypes/types/UInt8.js +0 -17
  126. package/dist/datatypes/types/Utf8.d.ts +0 -10
  127. package/dist/datatypes/types/Utf8.js +0 -20
  128. package/dist/datatypes/types.js +0 -286
  129. package/dist/exceptions/index.js +0 -43
  130. package/dist/exceptions/utils.js +0 -9
  131. package/dist/functions/concat.js +0 -248
  132. package/dist/functions/index.js +0 -17
  133. package/dist/types.js +0 -2
  134. package/dist/utils/boolean.d.ts +0 -1
  135. package/dist/utils/boolean.js +0 -18
  136. package/dist/utils/date.js +0 -349
  137. package/dist/utils/guards.js +0 -143
  138. package/dist/utils/index.js +0 -21
  139. package/dist/utils/json.js +0 -33
  140. package/dist/utils/list.js +0 -128
  141. package/dist/utils/number.js +0 -223
  142. package/dist/utils/string.js +0 -120
@@ -1,127 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TemporalExpr = exports.DateTimeExprNamespace = void 0;
4
- const ExprBase_1 = require("../ExprBase");
5
- const utils_1 = require("../../utils");
6
- class DateTimeExprNamespace {
7
- expr;
8
- constructor(expr) {
9
- this.expr = expr;
10
- }
11
- _deriveDate(fn) {
12
- return (0, ExprBase_1.derive)(this.expr, (0, ExprBase_1.kleeneUnary)((v) => {
13
- const d = (0, utils_1.toValidDate)(v);
14
- return d ? fn(d) : null;
15
- }));
16
- }
17
- _deriveDuration(fn) {
18
- return (0, ExprBase_1.derive)(this.expr, (0, ExprBase_1.kleeneUnary)((v) => {
19
- return typeof v === "number" ? fn(v) : null;
20
- }));
21
- }
22
- century() {
23
- return this._deriveDate(utils_1.getCentury);
24
- }
25
- date() {
26
- return this._deriveDate((d) => new Date(Date.UTC(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate())));
27
- }
28
- datetime() {
29
- return this._deriveDate((d) => d);
30
- }
31
- day() {
32
- return this._deriveDate((d) => d.getUTCDate());
33
- }
34
- epoch(unit = "ms") {
35
- return this._deriveDate((d) => (0, utils_1.toEpoch)(d, unit));
36
- }
37
- hour() {
38
- return this._deriveDate((d) => d.getUTCHours());
39
- }
40
- is_leap_year() {
41
- return this._deriveDate(utils_1.isLeapYear);
42
- }
43
- microsecond() {
44
- return this._deriveDate((d) => d.getUTCMilliseconds() * utils_1.US_PER_MS);
45
- }
46
- millennium() {
47
- return this._deriveDate(utils_1.getMillennium);
48
- }
49
- millisecond() {
50
- return this._deriveDate((d) => d.getUTCMilliseconds());
51
- }
52
- minute() {
53
- return this._deriveDate((d) => d.getUTCMinutes());
54
- }
55
- month() {
56
- return this._deriveDate((d) => d.getUTCMonth() + 1);
57
- }
58
- month_end() {
59
- return this._deriveDate((d) => (0, utils_1.getMonthOffset)(d, 1, 0));
60
- }
61
- month_start() {
62
- return this._deriveDate((d) => (0, utils_1.getMonthOffset)(d, 0, 1));
63
- }
64
- nanosecond() {
65
- return this._deriveDate((d) => d.getUTCMilliseconds() * utils_1.NS_PER_MS);
66
- }
67
- ordinal_day() {
68
- return this._deriveDate(utils_1.getOrdinalDay);
69
- }
70
- quarter() {
71
- return this._deriveDate(utils_1.getQuarter);
72
- }
73
- second() {
74
- return this._deriveDate((d) => d.getUTCSeconds());
75
- }
76
- strftime(format, locale) {
77
- return this._deriveDate((d) => (0, utils_1.strftime)(d, format, locale));
78
- }
79
- time() {
80
- return this._deriveDate((d) => d.toISOString().split("T")[1].slice(0, 12));
81
- }
82
- timestamp(unit = "ms") {
83
- return this.epoch(unit);
84
- }
85
- to_string(format, locale) {
86
- return this.strftime(format, locale);
87
- }
88
- total_days() {
89
- return this._deriveDuration((v) => v / utils_1.MS_PER_DAY);
90
- }
91
- total_hours() {
92
- return this._deriveDuration((v) => v / utils_1.MS_PER_HOUR);
93
- }
94
- total_microseconds() {
95
- return this._deriveDuration((v) => v * utils_1.US_PER_MS);
96
- }
97
- total_milliseconds() {
98
- return this._deriveDuration((v) => v);
99
- }
100
- total_minutes() {
101
- return this._deriveDuration((v) => v / utils_1.MS_PER_MINUTE);
102
- }
103
- total_nanoseconds() {
104
- return this._deriveDuration((v) => v * utils_1.NS_PER_MS);
105
- }
106
- total_seconds() {
107
- return this._deriveDuration((v) => v / utils_1.MS_PER_SECOND);
108
- }
109
- week() {
110
- return this._deriveDate(utils_1.getISOWeek);
111
- }
112
- weekday() {
113
- return this._deriveDate((d) => d.getUTCDay() || 7);
114
- }
115
- year() {
116
- return this._deriveDate((d) => d.getUTCFullYear());
117
- }
118
- }
119
- exports.DateTimeExprNamespace = DateTimeExprNamespace;
120
- const TemporalExpr = (Base) => {
121
- return class extends Base {
122
- get dt() {
123
- return new DateTimeExprNamespace(this);
124
- }
125
- };
126
- };
127
- exports.TemporalExpr = TemporalExpr;
@@ -1,281 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WindowExpr = void 0;
4
- const ExprBase_1 = require("../ExprBase");
5
- const utils_1 = require("../../utils");
6
- const WindowExpr = (Base) => {
7
- return class extends Base {
8
- partitionBy = this.partitionBy || null;
9
- _rolling(windowSize, aggFn) {
10
- const newInst = (0, ExprBase_1.derive)(this);
11
- newInst.partitionOpsIndex = this.ops.length;
12
- newInst.groupingOpsIndex = this.ops.length;
13
- newInst.evaluateWindow = function (groupPreValues, _partitionIndices, currentIndex) {
14
- const start = Math.max(0, currentIndex - windowSize + 1);
15
- const end = currentIndex + 1;
16
- const windowVals = groupPreValues.slice(start, end);
17
- return aggFn(windowVals);
18
- };
19
- return newInst;
20
- }
21
- get isWindow() {
22
- return this.partitionBy !== null || this.evaluateWindow !== undefined || this.aggFn !== null;
23
- }
24
- cum_count(reverse = false) {
25
- const newInst = (0, ExprBase_1.derive)(this);
26
- newInst.partitionOpsIndex = this.ops.length;
27
- newInst.groupingOpsIndex = this.ops.length;
28
- newInst.evaluateWindow = function (groupPreValues, _partitionIndices, currentIndex) {
29
- let count = 0;
30
- const start = reverse ? currentIndex : 0;
31
- const end = reverse ? groupPreValues.length - 1 : currentIndex;
32
- for (let i = start; i <= end; i++) {
33
- const val = groupPreValues[i];
34
- if (val != null)
35
- count++;
36
- }
37
- return count;
38
- };
39
- return newInst;
40
- }
41
- cum_max(reverse = false) {
42
- const newInst = (0, ExprBase_1.derive)(this);
43
- newInst.partitionOpsIndex = this.ops.length;
44
- newInst.groupingOpsIndex = this.ops.length;
45
- newInst.evaluateWindow = function (groupPreValues, _partitionIndices, currentIndex) {
46
- let maxVal = null;
47
- const start = reverse ? currentIndex : 0;
48
- const end = reverse ? groupPreValues.length - 1 : currentIndex;
49
- for (let i = start; i <= end; i++) {
50
- const val = groupPreValues[i];
51
- if (val != null) {
52
- if (maxVal === null || val > maxVal) {
53
- maxVal = val;
54
- }
55
- }
56
- }
57
- return maxVal;
58
- };
59
- return newInst;
60
- }
61
- cum_min(reverse = false) {
62
- const newInst = (0, ExprBase_1.derive)(this);
63
- newInst.partitionOpsIndex = this.ops.length;
64
- newInst.groupingOpsIndex = this.ops.length;
65
- newInst.evaluateWindow = function (groupPreValues, _partitionIndices, currentIndex) {
66
- let minVal = null;
67
- const start = reverse ? currentIndex : 0;
68
- const end = reverse ? groupPreValues.length - 1 : currentIndex;
69
- for (let i = start; i <= end; i++) {
70
- const val = groupPreValues[i];
71
- if (val != null) {
72
- if (minVal === null || val < minVal) {
73
- minVal = val;
74
- }
75
- }
76
- }
77
- return minVal;
78
- };
79
- return newInst;
80
- }
81
- cum_prod(reverse = false) {
82
- const newInst = (0, ExprBase_1.derive)(this);
83
- newInst.partitionOpsIndex = this.ops.length;
84
- newInst.groupingOpsIndex = this.ops.length;
85
- newInst.evaluateWindow = function (groupPreValues, _partitionIndices, currentIndex) {
86
- let prod = 1;
87
- let hasValid = false;
88
- const start = reverse ? currentIndex : 0;
89
- const end = reverse ? groupPreValues.length - 1 : currentIndex;
90
- for (let i = start; i <= end; i++) {
91
- const val = groupPreValues[i];
92
- if (val != null) {
93
- prod *= val;
94
- hasValid = true;
95
- }
96
- }
97
- return hasValid ? prod : null;
98
- };
99
- return newInst;
100
- }
101
- cum_sum(reverse = false) {
102
- const newInst = (0, ExprBase_1.derive)(this);
103
- newInst.partitionOpsIndex = this.ops.length;
104
- newInst.groupingOpsIndex = this.ops.length;
105
- newInst.evaluateWindow = function (groupPreValues, _partitionIndices, currentIndex) {
106
- let sum = 0;
107
- const start = reverse ? currentIndex : 0;
108
- const end = reverse ? groupPreValues.length - 1 : currentIndex;
109
- for (let i = start; i <= end; i++) {
110
- const val = groupPreValues[i];
111
- if (val != null)
112
- sum += val;
113
- }
114
- return sum;
115
- };
116
- return newInst;
117
- }
118
- dense_rank() {
119
- const newInst = (0, ExprBase_1.derive)(this);
120
- newInst.partitionOpsIndex = this.ops.length;
121
- newInst.groupingOpsIndex = this.ops.length;
122
- newInst.evaluateWindow = function (groupPreValues, _partitionIndices, currentIndex) {
123
- const sortedUnique = Array.from(new Set(groupPreValues)).sort((a, b) => a - b);
124
- const valueToRank = new Map();
125
- for (let idx = 0; idx < sortedUnique.length; idx++) {
126
- valueToRank.set(sortedUnique[idx], idx + 1);
127
- }
128
- const currentVal = groupPreValues[currentIndex];
129
- return valueToRank.get(currentVal) ?? null;
130
- };
131
- return newInst;
132
- }
133
- lag(offset = 1, defaultVal = null) {
134
- const newInst = (0, ExprBase_1.derive)(this);
135
- newInst.partitionOpsIndex = this.ops.length;
136
- newInst.groupingOpsIndex = this.ops.length;
137
- newInst.evaluateWindow = function (groupPreValues, _partitionIndices, currentIndex) {
138
- let val = defaultVal;
139
- if (currentIndex - offset >= 0) {
140
- val = groupPreValues[currentIndex - offset];
141
- }
142
- return val;
143
- };
144
- return newInst;
145
- }
146
- lead(offset = 1, defaultVal = null) {
147
- const newInst = (0, ExprBase_1.derive)(this);
148
- newInst.partitionOpsIndex = this.ops.length;
149
- newInst.groupingOpsIndex = this.ops.length;
150
- newInst.evaluateWindow = function (groupPreValues, _partitionIndices, currentIndex) {
151
- let val = defaultVal;
152
- if (currentIndex + offset < groupPreValues.length) {
153
- val = groupPreValues[currentIndex + offset];
154
- }
155
- return val;
156
- };
157
- return newInst;
158
- }
159
- over(columns) {
160
- const newInst = (0, ExprBase_1.derive)(this);
161
- const cols = Array.isArray(columns) ? columns : [columns];
162
- newInst.partitionBy = cols;
163
- return newInst;
164
- }
165
- rank() {
166
- const newInst = (0, ExprBase_1.derive)(this);
167
- newInst.partitionOpsIndex = this.ops.length;
168
- newInst.groupingOpsIndex = this.ops.length;
169
- newInst.evaluateWindow = function (groupPreValues, _partitionIndices, currentIndex) {
170
- const sorted = [...groupPreValues].sort((a, b) => a - b);
171
- const valueToRank = new Map();
172
- for (let i = 0; i < sorted.length; i++) {
173
- const v = sorted[i];
174
- if (!valueToRank.has(v)) {
175
- valueToRank.set(v, i + 1);
176
- }
177
- }
178
- const currentVal = groupPreValues[currentIndex];
179
- return valueToRank.get(currentVal) ?? null;
180
- };
181
- return newInst;
182
- }
183
- rolling_max(windowSize) {
184
- return this._rolling(windowSize, v => (0, utils_1.getListStats)(v).max);
185
- }
186
- rolling_mean(windowSize) {
187
- return this._rolling(windowSize, v => (0, utils_1.getListStats)(v).mean);
188
- }
189
- rolling_median(windowSize) {
190
- return this._rolling(windowSize, v => {
191
- if (!(0, utils_1.isArrayOfType)(v, "number", { allowNulls: true }))
192
- return null;
193
- const len = v.length;
194
- const nums = [];
195
- for (let i = 0; i < len; i++) {
196
- const val = v[i];
197
- if (val != null) {
198
- nums.push(val);
199
- }
200
- }
201
- const numsLen = nums.length;
202
- if (numsLen === 0)
203
- return null;
204
- nums.sort((a, b) => a - b);
205
- const mid = Math.floor(numsLen / 2);
206
- return numsLen % 2 !== 0
207
- ? nums[mid]
208
- : (nums[mid - 1] + nums[mid]) / 2;
209
- });
210
- }
211
- rolling_min(windowSize) {
212
- return this._rolling(windowSize, v => (0, utils_1.getListStats)(v).min);
213
- }
214
- rolling_quantile(quantile, windowSize) {
215
- return this._rolling(windowSize, v => {
216
- const f = [];
217
- for (let i = 0; i < v.length; i++) {
218
- if (v[i] != null)
219
- f.push(v[i]);
220
- }
221
- const n = f.length;
222
- if (n === 0)
223
- return null;
224
- f.sort((a, b) => a - b);
225
- const idx = quantile * (n - 1);
226
- const low = Math.floor(idx);
227
- const high = Math.ceil(idx);
228
- if (low === high)
229
- return f[low];
230
- return f[low] + (idx - low) * (f[high] - f[low]);
231
- });
232
- }
233
- rolling_rank(windowSize) {
234
- const newInst = (0, ExprBase_1.derive)(this);
235
- newInst.partitionOpsIndex = this.ops.length;
236
- newInst.groupingOpsIndex = this.ops.length;
237
- newInst.evaluateWindow = function (groupPreValues, _partitionIndices, currentIndex) {
238
- const start = Math.max(0, currentIndex - windowSize + 1);
239
- const end = currentIndex + 1;
240
- const vals = groupPreValues.slice(start, end);
241
- const currentVal = groupPreValues[currentIndex];
242
- if (currentVal == null)
243
- return null;
244
- const nonNullVals = [];
245
- for (let j = 0; j < vals.length; j++) {
246
- if (vals[j] != null)
247
- nonNullVals.push(vals[j]);
248
- }
249
- if (nonNullVals.length === 0)
250
- return null;
251
- const sorted = [...nonNullVals].sort((a, b) => a - b);
252
- const valueToRank = new Map();
253
- for (let i = 0; i < sorted.length; i++) {
254
- const v = sorted[i];
255
- if (!valueToRank.has(v)) {
256
- valueToRank.set(v, i + 1);
257
- }
258
- }
259
- return valueToRank.get(currentVal) ?? null;
260
- };
261
- return newInst;
262
- }
263
- rolling_std(windowSize) {
264
- return this._rolling(windowSize, v => (0, utils_1.getListStats)(v).std);
265
- }
266
- rolling_sum(windowSize) {
267
- return this._rolling(windowSize, v => (0, utils_1.getListStats)(v).sum);
268
- }
269
- row_number() {
270
- const newInst = (0, ExprBase_1.derive)(this);
271
- newInst.partitionOpsIndex = this.ops.length;
272
- newInst.groupingOpsIndex = this.ops.length;
273
- newInst.evaluateWindow = function (_groupPreValues, _partitionIndices, currentIndex) {
274
- return currentIndex + 1;
275
- };
276
- newInst.outputName = "row_number";
277
- return newInst;
278
- }
279
- };
280
- };
281
- exports.WindowExpr = WindowExpr;
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.KEY_SEPARATOR = void 0;
4
- exports.KEY_SEPARATOR = "\x00";