df-script 1.4.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 (134) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +269 -0
  3. package/dist/api.d.ts +39 -0
  4. package/dist/api.js +18 -0
  5. package/dist/bundle.min.js +1 -0
  6. package/dist/columnExpressions/ColumnExpr.d.ts +368 -0
  7. package/dist/columnExpressions/ColumnExpr.js +23 -0
  8. package/dist/columnExpressions/ExprBase.d.ts +24 -0
  9. package/dist/columnExpressions/ExprBase.js +133 -0
  10. package/dist/columnExpressions/constants.d.ts +2 -0
  11. package/dist/columnExpressions/constants.js +5 -0
  12. package/dist/columnExpressions/functions/all.d.ts +5 -0
  13. package/dist/columnExpressions/functions/all.js +11 -0
  14. package/dist/columnExpressions/functions/coalesce.d.ts +3 -0
  15. package/dist/columnExpressions/functions/coalesce.js +40 -0
  16. package/dist/columnExpressions/functions/exclude.d.ts +5 -0
  17. package/dist/columnExpressions/functions/exclude.js +13 -0
  18. package/dist/columnExpressions/functions/lit.d.ts +5 -0
  19. package/dist/columnExpressions/functions/lit.js +22 -0
  20. package/dist/columnExpressions/functions/when.d.ts +24 -0
  21. package/dist/columnExpressions/functions/when.js +81 -0
  22. package/dist/columnExpressions/index.d.ts +19 -0
  23. package/dist/columnExpressions/index.js +81 -0
  24. package/dist/columnExpressions/mixins/AggregationExpr.d.ts +50 -0
  25. package/dist/columnExpressions/mixins/AggregationExpr.js +172 -0
  26. package/dist/columnExpressions/mixins/ArithmeticExpr.d.ts +67 -0
  27. package/dist/columnExpressions/mixins/ArithmeticExpr.js +143 -0
  28. package/dist/columnExpressions/mixins/ComparisonExpr.d.ts +60 -0
  29. package/dist/columnExpressions/mixins/ComparisonExpr.js +389 -0
  30. package/dist/columnExpressions/mixins/ListExpr.d.ts +63 -0
  31. package/dist/columnExpressions/mixins/ListExpr.js +248 -0
  32. package/dist/columnExpressions/mixins/LogicalExpr.d.ts +33 -0
  33. package/dist/columnExpressions/mixins/LogicalExpr.js +54 -0
  34. package/dist/columnExpressions/mixins/ManipulationExpr.d.ts +31 -0
  35. package/dist/columnExpressions/mixins/ManipulationExpr.js +35 -0
  36. package/dist/columnExpressions/mixins/StringExpr.d.ts +79 -0
  37. package/dist/columnExpressions/mixins/StringExpr.js +249 -0
  38. package/dist/columnExpressions/mixins/TemporalExpr.d.ts +69 -0
  39. package/dist/columnExpressions/mixins/TemporalExpr.js +127 -0
  40. package/dist/columnExpressions/mixins/WindowExpr.d.ts +50 -0
  41. package/dist/columnExpressions/mixins/WindowExpr.js +281 -0
  42. package/dist/columnExpressions/types.d.ts +7 -0
  43. package/dist/columnExpressions/types.js +2 -0
  44. package/dist/dataframe/constants.d.ts +1 -0
  45. package/dist/dataframe/constants.js +4 -0
  46. package/dist/dataframe/dataframe.d.ts +42 -0
  47. package/dist/dataframe/dataframe.js +749 -0
  48. package/dist/dataframe/grouped/grouped.d.ts +15 -0
  49. package/dist/dataframe/grouped/grouped.js +113 -0
  50. package/dist/dataframe/index.d.ts +4 -0
  51. package/dist/dataframe/index.js +20 -0
  52. package/dist/dataframe/types.d.ts +33 -0
  53. package/dist/dataframe/types.js +2 -0
  54. package/dist/dataframe/utils.d.ts +11 -0
  55. package/dist/dataframe/utils.js +215 -0
  56. package/dist/datatypes/DataType.d.ts +40 -0
  57. package/dist/datatypes/DataType.js +47 -0
  58. package/dist/datatypes/index.d.ts +29 -0
  59. package/dist/datatypes/index.js +46 -0
  60. package/dist/datatypes/types/Binary.d.ts +9 -0
  61. package/dist/datatypes/types/Binary.js +18 -0
  62. package/dist/datatypes/types/Boolean.d.ts +9 -0
  63. package/dist/datatypes/types/Boolean.js +19 -0
  64. package/dist/datatypes/types/Date.d.ts +8 -0
  65. package/dist/datatypes/types/Date.js +21 -0
  66. package/dist/datatypes/types/Datetime.d.ts +8 -0
  67. package/dist/datatypes/types/Datetime.js +17 -0
  68. package/dist/datatypes/types/Decimal.d.ts +10 -0
  69. package/dist/datatypes/types/Decimal.js +28 -0
  70. package/dist/datatypes/types/Duration.d.ts +8 -0
  71. package/dist/datatypes/types/Duration.js +17 -0
  72. package/dist/datatypes/types/Float32.d.ts +8 -0
  73. package/dist/datatypes/types/Float32.js +17 -0
  74. package/dist/datatypes/types/Float64.d.ts +8 -0
  75. package/dist/datatypes/types/Float64.js +17 -0
  76. package/dist/datatypes/types/Int16.d.ts +8 -0
  77. package/dist/datatypes/types/Int16.js +17 -0
  78. package/dist/datatypes/types/Int32.d.ts +8 -0
  79. package/dist/datatypes/types/Int32.js +17 -0
  80. package/dist/datatypes/types/Int64.d.ts +8 -0
  81. package/dist/datatypes/types/Int64.js +17 -0
  82. package/dist/datatypes/types/Int8.d.ts +8 -0
  83. package/dist/datatypes/types/Int8.js +17 -0
  84. package/dist/datatypes/types/List.d.ts +10 -0
  85. package/dist/datatypes/types/List.js +31 -0
  86. package/dist/datatypes/types/Null.d.ts +9 -0
  87. package/dist/datatypes/types/Null.js +17 -0
  88. package/dist/datatypes/types/Object.d.ts +9 -0
  89. package/dist/datatypes/types/Object.js +17 -0
  90. package/dist/datatypes/types/Struct.d.ts +14 -0
  91. package/dist/datatypes/types/Struct.js +39 -0
  92. package/dist/datatypes/types/Time.d.ts +8 -0
  93. package/dist/datatypes/types/Time.js +29 -0
  94. package/dist/datatypes/types/UInt16.d.ts +8 -0
  95. package/dist/datatypes/types/UInt16.js +17 -0
  96. package/dist/datatypes/types/UInt32.d.ts +8 -0
  97. package/dist/datatypes/types/UInt32.js +17 -0
  98. package/dist/datatypes/types/UInt64.d.ts +8 -0
  99. package/dist/datatypes/types/UInt64.js +17 -0
  100. package/dist/datatypes/types/UInt8.d.ts +8 -0
  101. package/dist/datatypes/types/UInt8.js +17 -0
  102. package/dist/datatypes/types/Utf8.d.ts +10 -0
  103. package/dist/datatypes/types/Utf8.js +20 -0
  104. package/dist/datatypes/types.d.ts +172 -0
  105. package/dist/datatypes/types.js +286 -0
  106. package/dist/exceptions/index.d.ts +13 -0
  107. package/dist/exceptions/index.js +43 -0
  108. package/dist/exceptions/utils.d.ts +2 -0
  109. package/dist/exceptions/utils.js +9 -0
  110. package/dist/functions/concat.d.ts +4 -0
  111. package/dist/functions/concat.js +248 -0
  112. package/dist/functions/index.d.ts +1 -0
  113. package/dist/functions/index.js +17 -0
  114. package/dist/index.d.ts +7 -0
  115. package/dist/index.js +1 -0
  116. package/dist/types.d.ts +47 -0
  117. package/dist/types.js +2 -0
  118. package/dist/utils/boolean.d.ts +1 -0
  119. package/dist/utils/boolean.js +18 -0
  120. package/dist/utils/date.d.ts +57 -0
  121. package/dist/utils/date.js +349 -0
  122. package/dist/utils/guards.d.ts +14 -0
  123. package/dist/utils/guards.js +143 -0
  124. package/dist/utils/index.d.ts +5 -0
  125. package/dist/utils/index.js +21 -0
  126. package/dist/utils/json.d.ts +2 -0
  127. package/dist/utils/json.js +33 -0
  128. package/dist/utils/list.d.ts +23 -0
  129. package/dist/utils/list.js +128 -0
  130. package/dist/utils/number.d.ts +86 -0
  131. package/dist/utils/number.js +223 -0
  132. package/dist/utils/string.d.ts +52 -0
  133. package/dist/utils/string.js +120 -0
  134. package/package.json +34 -0
@@ -0,0 +1,368 @@
1
+ import { ExprBase } from "./ExprBase";
2
+ declare const ColumnExpr_base: {
3
+ new (...args: any[]): {
4
+ get list(): import("./mixins/ListExpr").ListExprNamespace;
5
+ ops: import("..").OpFn[];
6
+ colName?: string;
7
+ outputName?: string;
8
+ isLiteral?: boolean;
9
+ literalValue?: any;
10
+ aggFn?: import("..").AggFn<any> | null;
11
+ groupingOpsIndex?: number;
12
+ partitionOpsIndex?: number;
13
+ partitionBy?: (string | import("..").IExpr)[] | null;
14
+ windowOp?: {
15
+ type: string;
16
+ [key: string]: any;
17
+ } | null;
18
+ isWindow?: boolean;
19
+ alias(name: string): /*elided*/ any;
20
+ cast(dataType: any): /*elided*/ any;
21
+ _resolve(val: any, columns: import("..").ColumnDict, height: number): import("..").ColumnData | any;
22
+ evaluate(columns: import("..").ColumnDict, height: number): import("..").ColumnData;
23
+ evaluatePreGrouping(columns: import("..").ColumnDict, height: number): import("..").ColumnData;
24
+ evaluatePostGrouping(aggregatedArray: any[], columns: import("..").ColumnDict): import("..").ColumnData;
25
+ evaluatePrePartition(columns: import("..").ColumnDict, height: number): import("..").ColumnData;
26
+ evaluatePostPartition(aggregatedArray: any[], columns: import("..").ColumnDict): import("..").ColumnData;
27
+ evaluateWindow?(groupPreValues: any[], partitionIndices: number[], currentIndex: number): any;
28
+ debug(label?: string): /*elided*/ any;
29
+ };
30
+ } & {
31
+ new (...args: any[]): {
32
+ get dt(): import("./mixins/TemporalExpr").DateTimeExprNamespace;
33
+ ops: import("..").OpFn[];
34
+ colName?: string;
35
+ outputName?: string;
36
+ isLiteral?: boolean;
37
+ literalValue?: any;
38
+ aggFn?: import("..").AggFn<any> | null;
39
+ groupingOpsIndex?: number;
40
+ partitionOpsIndex?: number;
41
+ partitionBy?: (string | import("..").IExpr)[] | null;
42
+ windowOp?: {
43
+ type: string;
44
+ [key: string]: any;
45
+ } | null;
46
+ isWindow?: boolean;
47
+ alias(name: string): /*elided*/ any;
48
+ cast(dataType: any): /*elided*/ any;
49
+ _resolve(val: any, columns: import("..").ColumnDict, height: number): import("..").ColumnData | any;
50
+ evaluate(columns: import("..").ColumnDict, height: number): import("..").ColumnData;
51
+ evaluatePreGrouping(columns: import("..").ColumnDict, height: number): import("..").ColumnData;
52
+ evaluatePostGrouping(aggregatedArray: any[], columns: import("..").ColumnDict): import("..").ColumnData;
53
+ evaluatePrePartition(columns: import("..").ColumnDict, height: number): import("..").ColumnData;
54
+ evaluatePostPartition(aggregatedArray: any[], columns: import("..").ColumnDict): import("..").ColumnData;
55
+ evaluateWindow?(groupPreValues: any[], partitionIndices: number[], currentIndex: number): any;
56
+ debug(label?: string): /*elided*/ any;
57
+ };
58
+ } & {
59
+ new (...args: any[]): {
60
+ and(other: any): /*elided*/ any;
61
+ not(): /*elided*/ any;
62
+ or(other: any): /*elided*/ any;
63
+ xor(other: any): /*elided*/ any;
64
+ ops: import("..").OpFn[];
65
+ colName?: string;
66
+ outputName?: string;
67
+ isLiteral?: boolean;
68
+ literalValue?: any;
69
+ aggFn?: import("..").AggFn<any> | null;
70
+ groupingOpsIndex?: number;
71
+ partitionOpsIndex?: number;
72
+ partitionBy?: (string | import("..").IExpr)[] | null;
73
+ windowOp?: {
74
+ type: string;
75
+ [key: string]: any;
76
+ } | null;
77
+ isWindow?: boolean;
78
+ alias(name: string): /*elided*/ any;
79
+ cast(dataType: any): /*elided*/ any;
80
+ _resolve(val: any, columns: import("..").ColumnDict, height: number): import("..").ColumnData | any;
81
+ evaluate(columns: import("..").ColumnDict, height: number): import("..").ColumnData;
82
+ evaluatePreGrouping(columns: import("..").ColumnDict, height: number): import("..").ColumnData;
83
+ evaluatePostGrouping(aggregatedArray: any[], columns: import("..").ColumnDict): import("..").ColumnData;
84
+ evaluatePrePartition(columns: import("..").ColumnDict, height: number): import("..").ColumnData;
85
+ evaluatePostPartition(aggregatedArray: any[], columns: import("..").ColumnDict): import("..").ColumnData;
86
+ evaluateWindow?(groupPreValues: any[], partitionIndices: number[], currentIndex: number): any;
87
+ debug(label?: string): /*elided*/ any;
88
+ };
89
+ } & {
90
+ new (...args: any[]): {
91
+ get str(): import("./mixins/StringExpr").StringExprNamespace;
92
+ ops: import("..").OpFn[];
93
+ colName?: string;
94
+ outputName?: string;
95
+ isLiteral?: boolean;
96
+ literalValue?: any;
97
+ aggFn?: import("..").AggFn<any> | null;
98
+ groupingOpsIndex?: number;
99
+ partitionOpsIndex?: number;
100
+ partitionBy?: (string | import("..").IExpr)[] | null;
101
+ windowOp?: {
102
+ type: string;
103
+ [key: string]: any;
104
+ } | null;
105
+ isWindow?: boolean;
106
+ alias(name: string): /*elided*/ any;
107
+ cast(dataType: any): /*elided*/ any;
108
+ _resolve(val: any, columns: import("..").ColumnDict, height: number): import("..").ColumnData | any;
109
+ evaluate(columns: import("..").ColumnDict, height: number): import("..").ColumnData;
110
+ evaluatePreGrouping(columns: import("..").ColumnDict, height: number): import("..").ColumnData;
111
+ evaluatePostGrouping(aggregatedArray: any[], columns: import("..").ColumnDict): import("..").ColumnData;
112
+ evaluatePrePartition(columns: import("..").ColumnDict, height: number): import("..").ColumnData;
113
+ evaluatePostPartition(aggregatedArray: any[], columns: import("..").ColumnDict): import("..").ColumnData;
114
+ evaluateWindow?(groupPreValues: any[], partitionIndices: number[], currentIndex: number): any;
115
+ debug(label?: string): /*elided*/ any;
116
+ };
117
+ } & {
118
+ new (...args: any[]): {
119
+ partitionBy: (string | import("..").IExpr)[] | null;
120
+ _rolling(windowSize: number, aggFn: (vals: any[]) => any): /*elided*/ any;
121
+ get isWindow(): boolean;
122
+ cum_count(reverse?: boolean): /*elided*/ any;
123
+ cum_max(reverse?: boolean): /*elided*/ any;
124
+ cum_min(reverse?: boolean): /*elided*/ any;
125
+ cum_prod(reverse?: boolean): /*elided*/ any;
126
+ cum_sum(reverse?: boolean): /*elided*/ any;
127
+ dense_rank(): /*elided*/ any;
128
+ lag(offset?: number, defaultVal?: any): /*elided*/ any;
129
+ lead(offset?: number, defaultVal?: any): /*elided*/ any;
130
+ over(columns: string | import("..").IExpr | (string | import("..").IExpr)[]): /*elided*/ any;
131
+ rank(): /*elided*/ any;
132
+ rolling_max(windowSize: number): /*elided*/ any;
133
+ rolling_mean(windowSize: number): /*elided*/ any;
134
+ rolling_median(windowSize: number): /*elided*/ any;
135
+ rolling_min(windowSize: number): /*elided*/ any;
136
+ rolling_quantile(quantile: number, windowSize: number): /*elided*/ any;
137
+ rolling_rank(windowSize: number): /*elided*/ any;
138
+ rolling_std(windowSize: number): /*elided*/ any;
139
+ rolling_sum(windowSize: number): /*elided*/ any;
140
+ row_number(): /*elided*/ any;
141
+ ops: import("..").OpFn[];
142
+ colName?: string;
143
+ outputName?: string;
144
+ isLiteral?: boolean;
145
+ literalValue?: any;
146
+ aggFn?: import("..").AggFn<any> | null;
147
+ groupingOpsIndex?: number;
148
+ partitionOpsIndex?: number;
149
+ windowOp?: {
150
+ type: string;
151
+ [key: string]: any;
152
+ } | null;
153
+ alias(name: string): /*elided*/ any;
154
+ cast(dataType: any): /*elided*/ any;
155
+ _resolve(val: any, columns: import("..").ColumnDict, height: number): import("..").ColumnData | any;
156
+ evaluate(columns: import("..").ColumnDict, height: number): import("..").ColumnData;
157
+ evaluatePreGrouping(columns: import("..").ColumnDict, height: number): import("..").ColumnData;
158
+ evaluatePostGrouping(aggregatedArray: any[], columns: import("..").ColumnDict): import("..").ColumnData;
159
+ evaluatePrePartition(columns: import("..").ColumnDict, height: number): import("..").ColumnData;
160
+ evaluatePostPartition(aggregatedArray: any[], columns: import("..").ColumnDict): import("..").ColumnData;
161
+ evaluateWindow?(groupPreValues: any[], partitionIndices: number[], currentIndex: number): any;
162
+ debug(label?: string): /*elided*/ any;
163
+ };
164
+ } & {
165
+ new (...args: any[]): {
166
+ aggFn: import("..").AggFn<any> | null;
167
+ _deriveAgg(fn: import("..").AggFn<any>): /*elided*/ any;
168
+ all(): /*elided*/ any;
169
+ all_null(): /*elided*/ any;
170
+ any(): /*elided*/ any;
171
+ any_null(): /*elided*/ any;
172
+ avg(): /*elided*/ any;
173
+ count(options?: {
174
+ includeNulls?: boolean;
175
+ }): /*elided*/ any;
176
+ first(): /*elided*/ any;
177
+ last(): /*elided*/ any;
178
+ max(): /*elided*/ any;
179
+ mean(): /*elided*/ any;
180
+ median(): /*elided*/ any;
181
+ min(): /*elided*/ any;
182
+ mode(): /*elided*/ any;
183
+ n_unique(): /*elided*/ any;
184
+ quantile(q: number): /*elided*/ any;
185
+ std(): /*elided*/ any;
186
+ sum(): /*elided*/ any;
187
+ ops: import("..").OpFn[];
188
+ colName?: string;
189
+ outputName?: string;
190
+ isLiteral?: boolean;
191
+ literalValue?: any;
192
+ groupingOpsIndex?: number;
193
+ partitionOpsIndex?: number;
194
+ partitionBy?: (string | import("..").IExpr)[] | null;
195
+ windowOp?: {
196
+ type: string;
197
+ [key: string]: any;
198
+ } | null;
199
+ isWindow?: boolean;
200
+ alias(name: string): /*elided*/ any;
201
+ cast(dataType: any): /*elided*/ any;
202
+ _resolve(val: any, columns: import("..").ColumnDict, height: number): import("..").ColumnData | any;
203
+ evaluate(columns: import("..").ColumnDict, height: number): import("..").ColumnData;
204
+ evaluatePreGrouping(columns: import("..").ColumnDict, height: number): import("..").ColumnData;
205
+ evaluatePostGrouping(aggregatedArray: any[], columns: import("..").ColumnDict): import("..").ColumnData;
206
+ evaluatePrePartition(columns: import("..").ColumnDict, height: number): import("..").ColumnData;
207
+ evaluatePostPartition(aggregatedArray: any[], columns: import("..").ColumnDict): import("..").ColumnData;
208
+ evaluateWindow?(groupPreValues: any[], partitionIndices: number[], currentIndex: number): any;
209
+ debug(label?: string): /*elided*/ any;
210
+ };
211
+ } & {
212
+ new (...args: any[]): {
213
+ between(lower: any, upper: any, closed?: "both" | "left" | "right" | "none"): /*elided*/ any;
214
+ eq(val: any): /*elided*/ any;
215
+ eq_missing(val: any): /*elided*/ any;
216
+ ge(val: any): /*elided*/ any;
217
+ gt(val: any): /*elided*/ any;
218
+ has_nulls(): any;
219
+ is_close(other: any, options?: {
220
+ abs_tol?: number;
221
+ rel_tol?: number;
222
+ nans_equal?: boolean;
223
+ }): /*elided*/ any;
224
+ is_duplicated(): /*elided*/ any;
225
+ is_empty(options?: {
226
+ ignoreNulls?: boolean;
227
+ }): /*elided*/ any;
228
+ is_finite(): /*elided*/ any;
229
+ is_first_distinct(): /*elided*/ any;
230
+ is_in(values: any[] | any): /*elided*/ any;
231
+ is_infinite(): /*elided*/ any;
232
+ is_last_distinct(): /*elided*/ any;
233
+ is_n_distinct(n: number): any;
234
+ is_nan(): /*elided*/ any;
235
+ is_not_nan(): /*elided*/ any;
236
+ is_not_null(): /*elided*/ any;
237
+ is_null(): /*elided*/ any;
238
+ is_unique(): /*elided*/ any;
239
+ le(val: any): /*elided*/ any;
240
+ lt(val: any): /*elided*/ any;
241
+ ne(val: any): /*elided*/ any;
242
+ ne_missing(val: any): /*elided*/ any;
243
+ not_in(values: any[] | any): /*elided*/ any;
244
+ ops: import("..").OpFn[];
245
+ colName?: string;
246
+ outputName?: string;
247
+ isLiteral?: boolean;
248
+ literalValue?: any;
249
+ aggFn?: import("..").AggFn<any> | null;
250
+ groupingOpsIndex?: number;
251
+ partitionOpsIndex?: number;
252
+ partitionBy?: (string | import("..").IExpr)[] | null;
253
+ windowOp?: {
254
+ type: string;
255
+ [key: string]: any;
256
+ } | null;
257
+ isWindow?: boolean;
258
+ alias(name: string): /*elided*/ any;
259
+ cast(dataType: any): /*elided*/ any;
260
+ _resolve(val: any, columns: import("..").ColumnDict, height: number): import("..").ColumnData | any;
261
+ evaluate(columns: import("..").ColumnDict, height: number): import("..").ColumnData;
262
+ evaluatePreGrouping(columns: import("..").ColumnDict, height: number): import("..").ColumnData;
263
+ evaluatePostGrouping(aggregatedArray: any[], columns: import("..").ColumnDict): import("..").ColumnData;
264
+ evaluatePrePartition(columns: import("..").ColumnDict, height: number): import("..").ColumnData;
265
+ evaluatePostPartition(aggregatedArray: any[], columns: import("..").ColumnDict): import("..").ColumnData;
266
+ evaluateWindow?(groupPreValues: any[], partitionIndices: number[], currentIndex: number): any;
267
+ debug(label?: string): /*elided*/ any;
268
+ };
269
+ } & {
270
+ new (...args: any[]): {
271
+ abs(): /*elided*/ any;
272
+ acos(): /*elided*/ any;
273
+ acosh(): /*elided*/ any;
274
+ add(val: number | import("..").IExpr | null): /*elided*/ any;
275
+ asin(): /*elided*/ any;
276
+ asinh(): /*elided*/ any;
277
+ atan(): /*elided*/ any;
278
+ atanh(): /*elided*/ any;
279
+ cbrt(): /*elided*/ any;
280
+ ceil(): /*elided*/ any;
281
+ clip(lower?: number | null, upper?: number | null): /*elided*/ any;
282
+ cos(): /*elided*/ any;
283
+ cosh(): /*elided*/ any;
284
+ degrees(): /*elided*/ any;
285
+ div(val: number | import("..").IExpr | null): /*elided*/ any;
286
+ exp(): /*elided*/ any;
287
+ expm1(): /*elided*/ any;
288
+ floor(): /*elided*/ any;
289
+ floordiv(val: number | import("..").IExpr | null): /*elided*/ any;
290
+ hypot(val: number | import("..").IExpr | null): /*elided*/ any;
291
+ log(base?: number): /*elided*/ any;
292
+ log1p(): /*elided*/ any;
293
+ mod(val: number | import("..").IExpr | null): /*elided*/ any;
294
+ mul(val: number | import("..").IExpr | null): /*elided*/ any;
295
+ negate(): /*elided*/ any;
296
+ pow(val: number | import("..").IExpr | null): /*elided*/ any;
297
+ radians(): /*elided*/ any;
298
+ rand(seed?: number, { min, max, integer }?: import("./types").RandomOptions): /*elided*/ any;
299
+ round(decimals?: number): /*elided*/ any;
300
+ sign(): /*elided*/ any;
301
+ sin(): /*elided*/ any;
302
+ sinh(): /*elided*/ any;
303
+ sqrt(): /*elided*/ any;
304
+ sub(val: number | import("..").IExpr | null): /*elided*/ any;
305
+ tan(): /*elided*/ any;
306
+ tanh(): /*elided*/ any;
307
+ trunc(): /*elided*/ any;
308
+ ops: import("..").OpFn[];
309
+ colName?: string;
310
+ outputName?: string;
311
+ isLiteral?: boolean;
312
+ literalValue?: any;
313
+ aggFn?: import("..").AggFn<any> | null;
314
+ groupingOpsIndex?: number;
315
+ partitionOpsIndex?: number;
316
+ partitionBy?: (string | import("..").IExpr)[] | null;
317
+ windowOp?: {
318
+ type: string;
319
+ [key: string]: any;
320
+ } | null;
321
+ isWindow?: boolean;
322
+ alias(name: string): /*elided*/ any;
323
+ cast(dataType: any): /*elided*/ any;
324
+ _resolve(val: any, columns: import("..").ColumnDict, height: number): import("..").ColumnData | any;
325
+ evaluate(columns: import("..").ColumnDict, height: number): import("..").ColumnData;
326
+ evaluatePreGrouping(columns: import("..").ColumnDict, height: number): import("..").ColumnData;
327
+ evaluatePostGrouping(aggregatedArray: any[], columns: import("..").ColumnDict): import("..").ColumnData;
328
+ evaluatePrePartition(columns: import("..").ColumnDict, height: number): import("..").ColumnData;
329
+ evaluatePostPartition(aggregatedArray: any[], columns: import("..").ColumnDict): import("..").ColumnData;
330
+ evaluateWindow?(groupPreValues: any[], partitionIndices: number[], currentIndex: number): any;
331
+ debug(label?: string): /*elided*/ any;
332
+ };
333
+ } & {
334
+ new (...args: any[]): {
335
+ fill_null(value: any): /*elided*/ any;
336
+ reverse(): /*elided*/ any;
337
+ ops: import("..").OpFn[];
338
+ colName?: string;
339
+ outputName?: string;
340
+ isLiteral?: boolean;
341
+ literalValue?: any;
342
+ aggFn?: import("..").AggFn<any> | null;
343
+ groupingOpsIndex?: number;
344
+ partitionOpsIndex?: number;
345
+ partitionBy?: (string | import("..").IExpr)[] | null;
346
+ windowOp?: {
347
+ type: string;
348
+ [key: string]: any;
349
+ } | null;
350
+ isWindow?: boolean;
351
+ alias(name: string): /*elided*/ any;
352
+ cast(dataType: any): /*elided*/ any;
353
+ _resolve(val: any, columns: import("..").ColumnDict, height: number): import("..").ColumnData | any;
354
+ evaluate(columns: import("..").ColumnDict, height: number): import("..").ColumnData;
355
+ evaluatePreGrouping(columns: import("..").ColumnDict, height: number): import("..").ColumnData;
356
+ evaluatePostGrouping(aggregatedArray: any[], columns: import("..").ColumnDict): import("..").ColumnData;
357
+ evaluatePrePartition(columns: import("..").ColumnDict, height: number): import("..").ColumnData;
358
+ evaluatePostPartition(aggregatedArray: any[], columns: import("..").ColumnDict): import("..").ColumnData;
359
+ evaluateWindow?(groupPreValues: any[], partitionIndices: number[], currentIndex: number): any;
360
+ debug(label?: string): /*elided*/ any;
361
+ };
362
+ } & typeof ExprBase;
363
+ export declare class ColumnExpr<T> extends ColumnExpr_base {
364
+ colName: string;
365
+ excludedCols: string[];
366
+ constructor(colName: keyof T | string);
367
+ }
368
+ export {};
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ColumnExpr = void 0;
4
+ const ExprBase_1 = require("./ExprBase");
5
+ const ArithmeticExpr_1 = require("./mixins/ArithmeticExpr");
6
+ const ComparisonExpr_1 = require("./mixins/ComparisonExpr");
7
+ const AggregationExpr_1 = require("./mixins/AggregationExpr");
8
+ const WindowExpr_1 = require("./mixins/WindowExpr");
9
+ const StringExpr_1 = require("./mixins/StringExpr");
10
+ const LogicalExpr_1 = require("./mixins/LogicalExpr");
11
+ const TemporalExpr_1 = require("./mixins/TemporalExpr");
12
+ const ListExpr_1 = require("./mixins/ListExpr");
13
+ const ManipulationExpr_1 = require("./mixins/ManipulationExpr");
14
+ class ColumnExpr extends (0, ListExpr_1.ListExpr)((0, TemporalExpr_1.TemporalExpr)((0, LogicalExpr_1.LogicalExpr)((0, StringExpr_1.StringExpr)((0, WindowExpr_1.WindowExpr)((0, AggregationExpr_1.AggregationExpr)((0, ComparisonExpr_1.ComparisonExpr)((0, ArithmeticExpr_1.ArithmeticExpr)((0, ManipulationExpr_1.ManipulationExpr)(ExprBase_1.ExprBase))))))))) {
15
+ colName;
16
+ excludedCols = [];
17
+ constructor(colName) {
18
+ super();
19
+ this.colName = String(colName);
20
+ this.outputName = this.colName;
21
+ }
22
+ }
23
+ exports.ColumnExpr = ColumnExpr;
@@ -0,0 +1,24 @@
1
+ import type { IExpr, OpFn, AggFn, ColumnData, ColumnDict } from "../types";
2
+ import type { DataType } from "../datatypes";
3
+ export declare const kleeneUnary: (fn: (v: any) => any) => (vArray: ColumnData) => any[];
4
+ export declare const kleeneBinary: (expr: IExpr, other: any, fn: (v: any, r: any) => any) => (vArray: ColumnData, columns: ColumnDict) => any[];
5
+ export declare const derive: <T extends IExpr>(instance: T, nextOp?: OpFn) => T;
6
+ export declare class ExprBase implements IExpr {
7
+ ops: OpFn[];
8
+ outputName: string;
9
+ aggFn?: AggFn<any> | null;
10
+ groupingOpsIndex?: number;
11
+ partitionOpsIndex?: number;
12
+ partitionBy: (string | IExpr)[] | null;
13
+ _resolve(val: any, columns: ColumnDict, height: number): any;
14
+ alias(name: string): this;
15
+ cast(dataType: DataType): this;
16
+ debug(label?: string): this;
17
+ evaluate(columns: ColumnDict, height: number): ColumnData;
18
+ private _evaluatePre;
19
+ private _evaluatePost;
20
+ evaluatePrePartition(columns: ColumnDict, height: number): ColumnData;
21
+ evaluatePostPartition(aggregatedArray: any[], columns: ColumnDict): ColumnData;
22
+ evaluatePreGrouping(columns: ColumnDict, height: number): ColumnData;
23
+ evaluatePostGrouping(aggregatedArray: any[], columns: ColumnDict): ColumnData;
24
+ }
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ExprBase = exports.derive = exports.kleeneBinary = exports.kleeneUnary = void 0;
4
+ const utils_1 = require("../utils");
5
+ const constants_1 = require("./constants");
6
+ const kleeneUnary = (fn) => {
7
+ return (vArray) => {
8
+ const height = vArray.length;
9
+ const result = new Array(height);
10
+ for (let i = 0; i < height; i++) {
11
+ const v = vArray[i];
12
+ result[i] = v == null ? null : fn(v);
13
+ }
14
+ return result;
15
+ };
16
+ };
17
+ exports.kleeneUnary = kleeneUnary;
18
+ const kleeneBinary = (expr, other, fn) => {
19
+ return (vArray, columns) => {
20
+ const height = vArray.length;
21
+ const rResolved = expr._resolve(other, columns, height);
22
+ const result = new Array(height);
23
+ if ((0, utils_1.isArrayOrTypedArray)(rResolved)) {
24
+ for (let i = 0; i < height; i++) {
25
+ const v = vArray[i];
26
+ const r = rResolved[i];
27
+ result[i] = (v == null || r == null) ? null : fn(v, r);
28
+ }
29
+ }
30
+ else {
31
+ for (let i = 0; i < height; i++) {
32
+ const v = vArray[i];
33
+ result[i] = (v == null || rResolved == null) ? null : fn(v, rResolved);
34
+ }
35
+ }
36
+ return result;
37
+ };
38
+ };
39
+ exports.kleeneBinary = kleeneBinary;
40
+ const derive = (instance, nextOp) => {
41
+ const Constructor = instance.constructor;
42
+ const newInst = new Constructor(instance.colName || "");
43
+ Object.assign(newInst, instance);
44
+ newInst.ops = nextOp ? [...instance.ops, nextOp] : [...instance.ops];
45
+ return newInst;
46
+ };
47
+ exports.derive = derive;
48
+ class ExprBase {
49
+ ops = [];
50
+ outputName = "";
51
+ aggFn = null;
52
+ groupingOpsIndex;
53
+ partitionOpsIndex;
54
+ partitionBy = null;
55
+ _resolve(val, columns, height) {
56
+ if (val && typeof val === "object" && "evaluate" in val) {
57
+ if (val.isLiteral && val.ops.length === 1) {
58
+ return val.literalValue;
59
+ }
60
+ return val.evaluate(columns, height);
61
+ }
62
+ return val;
63
+ }
64
+ alias(name) {
65
+ const Constructor = this.constructor;
66
+ const newInst = new Constructor(this.colName || "");
67
+ Object.assign(newInst, this);
68
+ newInst.outputName = name;
69
+ return newInst;
70
+ }
71
+ cast(dataType) {
72
+ return (0, exports.derive)(this, (vArray) => {
73
+ const height = vArray.length;
74
+ const result = new Array(height);
75
+ for (let i = 0; i < height; i++) {
76
+ result[i] = dataType.coerce(vArray[i]);
77
+ }
78
+ return result;
79
+ });
80
+ }
81
+ debug(label) {
82
+ return (0, exports.derive)(this, (vArray) => {
83
+ console.log(`[DEBUG] ${label ? label + ': ' : ''}`, vArray);
84
+ return vArray;
85
+ });
86
+ }
87
+ evaluate(columns, height) {
88
+ const name = this.colName;
89
+ let value = name && name !== constants_1.ALL_COLUMNS_MARKER
90
+ ? (columns[name] || new Array(height).fill(null))
91
+ : new Array(height).fill(null);
92
+ const ops = this.ops;
93
+ const len = ops.length;
94
+ for (let i = 0; i < len; i++) {
95
+ value = ops[i](value, columns);
96
+ }
97
+ return value;
98
+ }
99
+ _evaluatePre(opsIndex, columns, height) {
100
+ const name = this.colName;
101
+ let value = name && name !== constants_1.ALL_COLUMNS_MARKER
102
+ ? (columns[name] || new Array(height).fill(null))
103
+ : new Array(height).fill(null);
104
+ const ops = this.ops;
105
+ const idx = opsIndex !== undefined ? opsIndex : ops.length;
106
+ for (let i = 0; i < idx; i++) {
107
+ value = ops[i](value, columns);
108
+ }
109
+ return value;
110
+ }
111
+ _evaluatePost(opsIndex, aggregatedArray, columns) {
112
+ const ops = this.ops;
113
+ const idx = opsIndex !== undefined ? opsIndex : ops.length;
114
+ let value = aggregatedArray;
115
+ for (let i = idx; i < ops.length; i++) {
116
+ value = ops[i](value, columns);
117
+ }
118
+ return value;
119
+ }
120
+ evaluatePrePartition(columns, height) {
121
+ return this._evaluatePre(this.partitionOpsIndex, columns, height);
122
+ }
123
+ evaluatePostPartition(aggregatedArray, columns) {
124
+ return this._evaluatePost(this.partitionOpsIndex, aggregatedArray, columns);
125
+ }
126
+ evaluatePreGrouping(columns, height) {
127
+ return this._evaluatePre(this.groupingOpsIndex, columns, height);
128
+ }
129
+ evaluatePostGrouping(aggregatedArray, columns) {
130
+ return this._evaluatePost(this.groupingOpsIndex, aggregatedArray, columns);
131
+ }
132
+ }
133
+ exports.ExprBase = ExprBase;
@@ -0,0 +1,2 @@
1
+ export declare const ALL_COLUMNS_MARKER = "*";
2
+ export declare const LITERAL_MARKER = "*literal*";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LITERAL_MARKER = exports.ALL_COLUMNS_MARKER = void 0;
4
+ exports.ALL_COLUMNS_MARKER = "*";
5
+ exports.LITERAL_MARKER = "*literal*";
@@ -0,0 +1,5 @@
1
+ import { ColumnExpr } from "../ColumnExpr";
2
+ /**
3
+ * Creates an expression targeting all columns in the DataFrame.
4
+ */
5
+ export declare function all(): ColumnExpr<any>;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.all = all;
4
+ const ColumnExpr_1 = require("../ColumnExpr");
5
+ const constants_1 = require("../constants");
6
+ /**
7
+ * Creates an expression targeting all columns in the DataFrame.
8
+ */
9
+ function all() {
10
+ return new ColumnExpr_1.ColumnExpr(constants_1.ALL_COLUMNS_MARKER);
11
+ }
@@ -0,0 +1,3 @@
1
+ import { ColumnExpr } from "../ColumnExpr";
2
+ import type { IExpr, Scalar } from "../../types";
3
+ export declare function coalesce(...exprs: (IExpr | Scalar | (IExpr | Scalar)[])[]): ColumnExpr<any>;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.coalesce = coalesce;
4
+ const ColumnExpr_1 = require("../ColumnExpr");
5
+ const utils_1 = require("../../utils");
6
+ function coalesce(...exprs) {
7
+ const rawArgs = (exprs.length === 1 && Array.isArray(exprs[0]))
8
+ ? exprs[0]
9
+ : exprs;
10
+ const expr = new ColumnExpr_1.ColumnExpr("*coalesce*");
11
+ expr.ops.push((_, columns) => {
12
+ const height = _.length;
13
+ const evaluateArg = (arg) => {
14
+ if (arg && typeof arg === "object" && "evaluate" in arg) {
15
+ return arg.evaluate(columns, height);
16
+ }
17
+ if (typeof arg === "string") {
18
+ return columns[arg] || new Array(height).fill(null);
19
+ }
20
+ return arg;
21
+ };
22
+ const evaluatedArrays = rawArgs.map(evaluateArg);
23
+ const result = new Array(height);
24
+ const exprCount = evaluatedArrays.length;
25
+ for (let i = 0; i < height; i++) {
26
+ let foundVal = null;
27
+ for (let j = 0; j < exprCount; j++) {
28
+ const arr = evaluatedArrays[j];
29
+ const val = (0, utils_1.isArrayOrTypedArray)(arr) ? arr[i] : arr;
30
+ if (val != null) {
31
+ foundVal = val;
32
+ break;
33
+ }
34
+ }
35
+ result[i] = foundVal;
36
+ }
37
+ return result;
38
+ });
39
+ return expr;
40
+ }
@@ -0,0 +1,5 @@
1
+ import { ColumnExpr } from "../ColumnExpr";
2
+ /**
3
+ * Creates an expression targeting all columns except the specified ones.
4
+ */
5
+ export declare function exclude(columns: string | string[]): ColumnExpr<any>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.exclude = exclude;
4
+ const ColumnExpr_1 = require("../ColumnExpr");
5
+ const constants_1 = require("../constants");
6
+ /**
7
+ * Creates an expression targeting all columns except the specified ones.
8
+ */
9
+ function exclude(columns) {
10
+ const expr = new ColumnExpr_1.ColumnExpr(constants_1.ALL_COLUMNS_MARKER);
11
+ expr.excludedCols = Array.isArray(columns) ? columns : [columns];
12
+ return expr;
13
+ }
@@ -0,0 +1,5 @@
1
+ import { ColumnExpr } from "../ColumnExpr";
2
+ /**
3
+ * Creates a literal column expression that repeats the given value for all rows.
4
+ */
5
+ export declare function lit(value: any): ColumnExpr<any>;