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,67 +1,43 @@
1
- import type { IExpr } from "../../types";
2
- import type { ExprConstructor, RandomOptions } from "../types";
3
- export declare const ArithmeticExpr: <TBase extends ExprConstructor>(Base: TBase) => {
4
- new (...args: any[]): {
5
- abs(): /*elided*/ any;
6
- acos(): /*elided*/ any;
7
- acosh(): /*elided*/ any;
8
- add(val: number | IExpr | null): /*elided*/ any;
9
- asin(): /*elided*/ any;
10
- asinh(): /*elided*/ any;
11
- atan(): /*elided*/ any;
12
- atanh(): /*elided*/ any;
13
- cbrt(): /*elided*/ any;
14
- ceil(): /*elided*/ any;
15
- clip(lower?: number | null, upper?: number | null): /*elided*/ any;
16
- cos(): /*elided*/ any;
17
- cosh(): /*elided*/ any;
18
- degrees(): /*elided*/ any;
19
- div(val: number | IExpr | null): /*elided*/ any;
20
- exp(): /*elided*/ any;
21
- expm1(): /*elided*/ any;
22
- floor(): /*elided*/ any;
23
- floordiv(val: number | IExpr | null): /*elided*/ any;
24
- hypot(val: number | IExpr | null): /*elided*/ any;
25
- log(base?: number): /*elided*/ any;
26
- log1p(): /*elided*/ any;
27
- mod(val: number | IExpr | null): /*elided*/ any;
28
- mul(val: number | IExpr | null): /*elided*/ any;
29
- negate(): /*elided*/ any;
30
- pow(val: number | IExpr | null): /*elided*/ any;
31
- radians(): /*elided*/ any;
32
- rand(seed?: number, { min, max, integer }?: RandomOptions): /*elided*/ any;
33
- round(decimals?: number): /*elided*/ any;
34
- sign(): /*elided*/ any;
35
- sin(): /*elided*/ any;
36
- sinh(): /*elided*/ any;
37
- sqrt(): /*elided*/ any;
38
- sub(val: number | IExpr | null): /*elided*/ any;
39
- tan(): /*elided*/ any;
40
- tanh(): /*elided*/ any;
41
- trunc(): /*elided*/ any;
42
- ops: import("../../types").OpFn[];
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;
1
+ import type { RandomOptions, NumericArg } from "../types";
2
+ import { ExprBase } from "../ExprBase";
3
+ export declare class ArithmeticExpr extends ExprBase {
4
+ abs(): this;
5
+ acos(): this;
6
+ acosh(): this;
7
+ add(val: NumericArg): this;
8
+ asin(): this;
9
+ asinh(): this;
10
+ atan(): this;
11
+ atan2(val: NumericArg): this;
12
+ atanh(): this;
13
+ cbrt(): this;
14
+ ceil(): this;
15
+ clip(lower?: number | null, upper?: number | null): this;
16
+ copysign(val: NumericArg): this;
17
+ cos(): this;
18
+ cosh(): this;
19
+ degrees(): this;
20
+ div(val: NumericArg): this;
21
+ exp(): this;
22
+ expm1(): this;
23
+ floor(): this;
24
+ floordiv(val: NumericArg): this;
25
+ hypot(val: NumericArg): this;
26
+ log(base?: number): this;
27
+ log1p(): this;
28
+ mod(val: NumericArg): this;
29
+ mul(val: NumericArg): this;
30
+ negate(): this;
31
+ pow(val: NumericArg): this;
32
+ radians(): this;
33
+ rand(seed?: number, { min, max, integer }?: RandomOptions): this;
34
+ round(decimals?: number): this;
35
+ sign(): this;
36
+ sin(): this;
37
+ sinh(): this;
38
+ sqrt(): this;
39
+ sub(val: NumericArg): this;
40
+ tan(): this;
41
+ tanh(): this;
42
+ trunc(): this;
43
+ }
@@ -0,0 +1,39 @@
1
+ import { ExprBase } from "../ExprBase";
2
+ import { SortArrayOptions, StepSliceArrayOptions } from "../../utils";
3
+ import type { UniqueArrayStatsOptions, JoinArrayOptions, ExplodeOptions, IExpr } from "../../types";
4
+ export declare class ArrayExprNamespace {
5
+ expr: any;
6
+ constructor(expr: any);
7
+ _deriveArray(fn: (arr: any[] | ArrayBufferView) => any): any;
8
+ all(): any;
9
+ any(): any;
10
+ contains(item: any): any;
11
+ contains_all(items: ArrayLike<any>): any;
12
+ contains_any(items: ArrayLike<any>): any;
13
+ count_matches(item: any): any;
14
+ drop_nulls(): any;
15
+ explode({ empty_as_null, keep_nulls }?: ExplodeOptions): any;
16
+ first(null_on_oob?: boolean): any;
17
+ gather(indices: number | ArrayLike<number>, null_on_oob?: boolean): any;
18
+ gather_every(options?: StepSliceArrayOptions): any;
19
+ get(index: number, null_on_oob?: boolean): any;
20
+ join(separator?: string, options?: JoinArrayOptions): any;
21
+ last(null_on_oob?: boolean): any;
22
+ len(): any;
23
+ lengths(): any;
24
+ max(): any;
25
+ mean(): any;
26
+ median(): any;
27
+ min(): any;
28
+ mode(): any;
29
+ n_unique(options?: UniqueArrayStatsOptions): any;
30
+ reverse(): any;
31
+ slice(offset: number, length?: number): any;
32
+ sort(options?: SortArrayOptions): any;
33
+ sum(): any;
34
+ unique(options?: UniqueArrayStatsOptions): any;
35
+ eval(expr: IExpr): any;
36
+ }
37
+ export declare class ArrayExpr extends ExprBase {
38
+ get arr(): ArrayExprNamespace;
39
+ }
@@ -1,60 +1,31 @@
1
- import type { ExprConstructor } from "../types";
2
- export declare const ComparisonExpr: <TBase extends ExprConstructor>(Base: TBase) => {
3
- new (...args: any[]): {
4
- between(lower: any, upper: any, closed?: "both" | "left" | "right" | "none"): /*elided*/ any;
5
- eq(val: any): /*elided*/ any;
6
- eq_missing(val: any): /*elided*/ any;
7
- ge(val: any): /*elided*/ any;
8
- gt(val: any): /*elided*/ any;
9
- has_nulls(): any;
10
- is_close(other: any, options?: {
11
- abs_tol?: number;
12
- rel_tol?: number;
13
- nans_equal?: boolean;
14
- }): /*elided*/ any;
15
- is_duplicated(): /*elided*/ any;
16
- is_empty(options?: {
17
- ignoreNulls?: boolean;
18
- }): /*elided*/ any;
19
- is_finite(): /*elided*/ any;
20
- is_first_distinct(): /*elided*/ any;
21
- is_in(values: any[] | any): /*elided*/ any;
22
- is_infinite(): /*elided*/ any;
23
- is_last_distinct(): /*elided*/ any;
24
- is_n_distinct(n: number): any;
25
- is_nan(): /*elided*/ any;
26
- is_not_nan(): /*elided*/ any;
27
- is_not_null(): /*elided*/ any;
28
- is_null(): /*elided*/ any;
29
- is_unique(): /*elided*/ any;
30
- le(val: any): /*elided*/ any;
31
- lt(val: any): /*elided*/ any;
32
- ne(val: any): /*elided*/ any;
33
- ne_missing(val: any): /*elided*/ any;
34
- not_in(values: any[] | any): /*elided*/ any;
35
- ops: import("../..").OpFn[];
36
- colName?: string;
37
- outputName?: string;
38
- isLiteral?: boolean;
39
- literalValue?: any;
40
- aggFn?: import("../..").AggFn<any> | null;
41
- groupingOpsIndex?: number;
42
- partitionOpsIndex?: number;
43
- partitionBy?: (string | import("../..").IExpr)[] | null;
44
- windowOp?: {
45
- type: string;
46
- [key: string]: any;
47
- } | null;
48
- isWindow?: boolean;
49
- alias(name: string): /*elided*/ any;
50
- cast(dataType: any): /*elided*/ any;
51
- _resolve(val: any, columns: import("../..").ColumnDict, height: number): import("../..").ColumnData | any;
52
- evaluate(columns: import("../..").ColumnDict, height: number): import("../..").ColumnData;
53
- evaluatePreGrouping(columns: import("../..").ColumnDict, height: number): import("../..").ColumnData;
54
- evaluatePostGrouping(aggregatedArray: any[], columns: import("../..").ColumnDict): import("../..").ColumnData;
55
- evaluatePrePartition(columns: import("../..").ColumnDict, height: number): import("../..").ColumnData;
56
- evaluatePostPartition(aggregatedArray: any[], columns: import("../..").ColumnDict): import("../..").ColumnData;
57
- evaluateWindow?(groupPreValues: any[], partitionIndices: number[], currentIndex: number): any;
58
- debug(label?: string): /*elided*/ any;
59
- };
60
- } & TBase;
1
+ import { ExprBase } from "../ExprBase";
2
+ export declare class ComparisonExpr extends ExprBase {
3
+ between(lower: any, upper: any, closed?: "both" | "left" | "right" | "none"): this;
4
+ eq(val: any): this;
5
+ eq_missing(val: any): this;
6
+ ge(val: any): this;
7
+ gt(val: any): this;
8
+ has_nulls(): any;
9
+ is_close(other: any, { abs_tol, rel_tol, nans_equal }?: {
10
+ abs_tol?: number;
11
+ rel_tol?: number;
12
+ nans_equal?: boolean;
13
+ }): this;
14
+ is_duplicated(): this;
15
+ is_empty({ ignoreNulls }?: {
16
+ ignoreNulls?: boolean;
17
+ }): this;
18
+ is_finite(): this;
19
+ is_in(values: any[] | any): this;
20
+ is_infinite(): this;
21
+ is_nan(): this;
22
+ is_not_nan(): this;
23
+ is_not_null(): this;
24
+ is_null(): this;
25
+ is_unique(): this;
26
+ le(val: any): this;
27
+ lt(val: any): this;
28
+ ne(val: any): this;
29
+ ne_missing(val: any): this;
30
+ not_in(values: any[] | any): this;
31
+ }
@@ -1,4 +1,6 @@
1
- import type { ExprConstructor } from "../types";
1
+ import { ExprBase } from "../ExprBase";
2
+ import { SortListOptions, StepSliceListOptions } from "../../utils";
3
+ import type { UniqueListStatsOptions, JoinListOptions, ExplodeOptions, IExpr } from "../../types";
2
4
  export declare class ListExprNamespace {
3
5
  expr: any;
4
6
  constructor(expr: any);
@@ -6,17 +8,16 @@ export declare class ListExprNamespace {
6
8
  all(): any;
7
9
  any(): any;
8
10
  contains(item: any): any;
9
- contains_all(items: any[]): any;
10
- contains_any(items: any[]): any;
11
+ contains_all(items: ArrayLike<any>): any;
12
+ contains_any(items: ArrayLike<any>): any;
11
13
  count_matches(item: any): any;
12
14
  drop_nulls(): any;
15
+ explode({ empty_as_null, keep_nulls }?: ExplodeOptions): any;
13
16
  first(null_on_oob?: boolean): any;
14
- gather(indices: number | number[], null_on_oob?: boolean): any;
15
- gather_every(n: number, offset?: number): any;
17
+ gather(indices: number | ArrayLike<number>, null_on_oob?: boolean): any;
18
+ gather_every(options?: StepSliceListOptions): any;
16
19
  get(index: number, null_on_oob?: boolean): any;
17
- join(separator: string, { ignoreNulls }?: {
18
- ignoreNulls?: boolean;
19
- }): any;
20
+ join(separator?: string, options?: JoinListOptions): any;
20
21
  last(null_on_oob?: boolean): any;
21
22
  len(): any;
22
23
  lengths(): any;
@@ -25,39 +26,14 @@ export declare class ListExprNamespace {
25
26
  median(): any;
26
27
  min(): any;
27
28
  mode(): any;
28
- n_unique(): any;
29
+ n_unique(options?: UniqueListStatsOptions): any;
29
30
  reverse(): any;
30
31
  slice(offset: number, length?: number): any;
31
- sort(descending?: boolean): any;
32
+ sort(options?: SortListOptions): any;
32
33
  sum(): any;
33
- unique(): any;
34
+ unique(options?: UniqueListStatsOptions): any;
35
+ eval(expr: IExpr): any;
36
+ }
37
+ export declare class ListExpr extends ExprBase {
38
+ get list(): ListExprNamespace;
34
39
  }
35
- export declare const ListExpr: <TBase extends ExprConstructor>(Base: TBase) => {
36
- new (...args: any[]): {
37
- get list(): ListExprNamespace;
38
- ops: import("../..").OpFn[];
39
- colName?: string;
40
- outputName?: string;
41
- isLiteral?: boolean;
42
- literalValue?: any;
43
- aggFn?: import("../..").AggFn<any> | null;
44
- groupingOpsIndex?: number;
45
- partitionOpsIndex?: number;
46
- partitionBy?: (string | import("../..").IExpr)[] | null;
47
- windowOp?: {
48
- type: string;
49
- [key: string]: any;
50
- } | null;
51
- isWindow?: boolean;
52
- alias(name: string): /*elided*/ any;
53
- cast(dataType: any): /*elided*/ any;
54
- _resolve(val: any, columns: import("../..").ColumnDict, height: number): import("../..").ColumnData | any;
55
- evaluate(columns: import("../..").ColumnDict, height: number): import("../..").ColumnData;
56
- evaluatePreGrouping(columns: import("../..").ColumnDict, height: number): import("../..").ColumnData;
57
- evaluatePostGrouping(aggregatedArray: any[], columns: import("../..").ColumnDict): import("../..").ColumnData;
58
- evaluatePrePartition(columns: import("../..").ColumnDict, height: number): import("../..").ColumnData;
59
- evaluatePostPartition(aggregatedArray: any[], columns: import("../..").ColumnDict): import("../..").ColumnData;
60
- evaluateWindow?(groupPreValues: any[], partitionIndices: number[], currentIndex: number): any;
61
- debug(label?: string): /*elided*/ any;
62
- };
63
- } & TBase;
@@ -1,33 +1,7 @@
1
- import type { ExprConstructor } from "../types";
2
- export declare const LogicalExpr: <TBase extends ExprConstructor>(Base: TBase) => {
3
- new (...args: any[]): {
4
- and(other: any): /*elided*/ any;
5
- not(): /*elided*/ any;
6
- or(other: any): /*elided*/ any;
7
- xor(other: any): /*elided*/ any;
8
- ops: import("../..").OpFn[];
9
- colName?: string;
10
- outputName?: string;
11
- isLiteral?: boolean;
12
- literalValue?: any;
13
- aggFn?: import("../..").AggFn<any> | null;
14
- groupingOpsIndex?: number;
15
- partitionOpsIndex?: number;
16
- partitionBy?: (string | import("../..").IExpr)[] | null;
17
- windowOp?: {
18
- type: string;
19
- [key: string]: any;
20
- } | null;
21
- isWindow?: boolean;
22
- alias(name: string): /*elided*/ any;
23
- cast(dataType: any): /*elided*/ any;
24
- _resolve(val: any, columns: import("../..").ColumnDict, height: number): import("../..").ColumnData | any;
25
- evaluate(columns: import("../..").ColumnDict, height: number): import("../..").ColumnData;
26
- evaluatePreGrouping(columns: import("../..").ColumnDict, height: number): import("../..").ColumnData;
27
- evaluatePostGrouping(aggregatedArray: any[], columns: import("../..").ColumnDict): import("../..").ColumnData;
28
- evaluatePrePartition(columns: import("../..").ColumnDict, height: number): import("../..").ColumnData;
29
- evaluatePostPartition(aggregatedArray: any[], columns: import("../..").ColumnDict): import("../..").ColumnData;
30
- evaluateWindow?(groupPreValues: any[], partitionIndices: number[], currentIndex: number): any;
31
- debug(label?: string): /*elided*/ any;
32
- };
33
- } & TBase;
1
+ import { ExprBase } from "../ExprBase";
2
+ export declare class LogicalExpr extends ExprBase {
3
+ and(other: any): this;
4
+ not(): this;
5
+ or(other: any): this;
6
+ xor(other: any): this;
7
+ }
@@ -1,31 +1,6 @@
1
- import type { ExprConstructor } from "../types";
2
- export declare const ManipulationExpr: <TBase extends ExprConstructor>(Base: TBase) => {
3
- new (...args: any[]): {
4
- fill_null(value: any): /*elided*/ any;
5
- reverse(): /*elided*/ any;
6
- ops: import("../..").OpFn[];
7
- colName?: string;
8
- outputName?: string;
9
- isLiteral?: boolean;
10
- literalValue?: any;
11
- aggFn?: import("../..").AggFn<any> | null;
12
- groupingOpsIndex?: number;
13
- partitionOpsIndex?: number;
14
- partitionBy?: (string | import("../..").IExpr)[] | null;
15
- windowOp?: {
16
- type: string;
17
- [key: string]: any;
18
- } | null;
19
- isWindow?: boolean;
20
- alias(name: string): /*elided*/ any;
21
- cast(dataType: any): /*elided*/ any;
22
- _resolve(val: any, columns: import("../..").ColumnDict, height: number): import("../..").ColumnData | any;
23
- evaluate(columns: import("../..").ColumnDict, height: number): import("../..").ColumnData;
24
- evaluatePreGrouping(columns: import("../..").ColumnDict, height: number): import("../..").ColumnData;
25
- evaluatePostGrouping(aggregatedArray: any[], columns: import("../..").ColumnDict): import("../..").ColumnData;
26
- evaluatePrePartition(columns: import("../..").ColumnDict, height: number): import("../..").ColumnData;
27
- evaluatePostPartition(aggregatedArray: any[], columns: import("../..").ColumnDict): import("../..").ColumnData;
28
- evaluateWindow?(groupPreValues: any[], partitionIndices: number[], currentIndex: number): any;
29
- debug(label?: string): /*elided*/ any;
30
- };
31
- } & TBase;
1
+ import { ExprBase } from "../ExprBase";
2
+ import type { FillNullOptions } from "../../types";
3
+ export declare class ManipulationExpr extends ExprBase {
4
+ fill_null({ value, strategy, limit }?: FillNullOptions): this;
5
+ reverse(): this;
6
+ }
@@ -1,10 +1,11 @@
1
1
  import type { IExpr } from "../../types";
2
- import type { ExprConstructor } from "../types";
2
+ import { ExprBase } from "../ExprBase";
3
3
  import { StripCharsOptions } from "../../utils";
4
4
  export declare class StringExprNamespace {
5
5
  expr: any;
6
6
  constructor(expr: any);
7
7
  _deriveString(fn: (v: string) => any): any;
8
+ _patternGuard(pattern: any, fn: () => any): any;
8
9
  concat(other: string | IExpr): any;
9
10
  contains(pattern: string | RegExp): any;
10
11
  count_matches(pattern: string | RegExp): any;
@@ -20,8 +21,8 @@ export declare class StringExprNamespace {
20
21
  lpad(width: number, fill?: string): any;
21
22
  pad_end(width: number, fill?: string): any;
22
23
  pad_start(width: number, fill?: string): any;
23
- replace(pattern: string | RegExp, replacement: string): any;
24
- replace_all(pattern: string | RegExp, replacement: string): any;
24
+ replace(pattern: string | RegExp, replacement: string | ((match: string, ...args: any[]) => string)): any;
25
+ replace_all(pattern: string | RegExp, replacement: string | ((match: string, ...args: any[]) => string)): any;
25
26
  reverse(): any;
26
27
  rpad(width: number, fill?: string): any;
27
28
  slice(offset: number, length?: number): any;
@@ -48,32 +49,6 @@ export declare class StringExprNamespace {
48
49
  upper(): any;
49
50
  zfill(width: number): any;
50
51
  }
51
- export declare const StringExpr: <TBase extends ExprConstructor>(Base: TBase) => {
52
- new (...args: any[]): {
53
- get str(): StringExprNamespace;
54
- ops: import("../../types").OpFn[];
55
- colName?: string;
56
- outputName?: string;
57
- isLiteral?: boolean;
58
- literalValue?: any;
59
- aggFn?: import("../../types").AggFn<any> | null;
60
- groupingOpsIndex?: number;
61
- partitionOpsIndex?: number;
62
- partitionBy?: (string | IExpr)[] | null;
63
- windowOp?: {
64
- type: string;
65
- [key: string]: any;
66
- } | null;
67
- isWindow?: boolean;
68
- alias(name: string): /*elided*/ any;
69
- cast(dataType: any): /*elided*/ any;
70
- _resolve(val: any, columns: import("../../types").ColumnDict, height: number): import("../../types").ColumnData | any;
71
- evaluate(columns: import("../../types").ColumnDict, height: number): import("../../types").ColumnData;
72
- evaluatePreGrouping(columns: import("../../types").ColumnDict, height: number): import("../../types").ColumnData;
73
- evaluatePostGrouping(aggregatedArray: any[], columns: import("../../types").ColumnDict): import("../../types").ColumnData;
74
- evaluatePrePartition(columns: import("../../types").ColumnDict, height: number): import("../../types").ColumnData;
75
- evaluatePostPartition(aggregatedArray: any[], columns: import("../../types").ColumnDict): import("../../types").ColumnData;
76
- evaluateWindow?(groupPreValues: any[], partitionIndices: number[], currentIndex: number): any;
77
- debug(label?: string): /*elided*/ any;
78
- };
79
- } & TBase;
52
+ export declare class StringExpr extends ExprBase {
53
+ get str(): StringExprNamespace;
54
+ }
@@ -0,0 +1,16 @@
1
+ import { ExprBase } from "../ExprBase";
2
+ import type { IntoExpr, IExpr } from "../../types";
3
+ export declare class StructExprNamespace {
4
+ expr: IExpr;
5
+ constructor(expr: IExpr);
6
+ field(name: string): IExpr;
7
+ rename_fields(mapping: Record<string, string>): IExpr;
8
+ with_fields(fields: IntoExpr[] | Record<string, IntoExpr>): IExpr;
9
+ unnest(): IExpr;
10
+ }
11
+ export interface StructExprNamespace {
12
+ [key: string]: any;
13
+ }
14
+ export declare class StructExpr extends ExprBase {
15
+ get struct(): StructExprNamespace;
16
+ }
@@ -1,5 +1,5 @@
1
1
  import type { TimeUnit } from "../../types";
2
- import type { ExprConstructor } from "../types";
2
+ import { ExprBase } from "../ExprBase";
3
3
  export declare class DateTimeExprNamespace {
4
4
  expr: any;
5
5
  constructor(expr: any);
@@ -38,32 +38,6 @@ export declare class DateTimeExprNamespace {
38
38
  weekday(): any;
39
39
  year(): any;
40
40
  }
41
- export declare const TemporalExpr: <TBase extends ExprConstructor>(Base: TBase) => {
42
- new (...args: any[]): {
43
- get dt(): DateTimeExprNamespace;
44
- ops: import("../../types").OpFn[];
45
- colName?: string;
46
- outputName?: string;
47
- isLiteral?: boolean;
48
- literalValue?: any;
49
- aggFn?: import("../../types").AggFn<any> | null;
50
- groupingOpsIndex?: number;
51
- partitionOpsIndex?: number;
52
- partitionBy?: (string | import("../../types").IExpr)[] | null;
53
- windowOp?: {
54
- type: string;
55
- [key: string]: any;
56
- } | null;
57
- isWindow?: boolean;
58
- alias(name: string): /*elided*/ any;
59
- cast(dataType: any): /*elided*/ any;
60
- _resolve(val: any, columns: import("../../types").ColumnDict, height: number): import("../../types").ColumnData | any;
61
- evaluate(columns: import("../../types").ColumnDict, height: number): import("../../types").ColumnData;
62
- evaluatePreGrouping(columns: import("../../types").ColumnDict, height: number): import("../../types").ColumnData;
63
- evaluatePostGrouping(aggregatedArray: any[], columns: import("../../types").ColumnDict): import("../../types").ColumnData;
64
- evaluatePrePartition(columns: import("../../types").ColumnDict, height: number): import("../../types").ColumnData;
65
- evaluatePostPartition(aggregatedArray: any[], columns: import("../../types").ColumnDict): import("../../types").ColumnData;
66
- evaluateWindow?(groupPreValues: any[], partitionIndices: number[], currentIndex: number): any;
67
- debug(label?: string): /*elided*/ any;
68
- };
69
- } & TBase;
41
+ export declare class TemporalExpr extends ExprBase {
42
+ get dt(): DateTimeExprNamespace;
43
+ }
@@ -1,50 +1,28 @@
1
1
  import type { IExpr } from "../../types";
2
- import type { ExprConstructor } from "../types";
3
- export declare const WindowExpr: <TBase extends ExprConstructor>(Base: TBase) => {
4
- new (...args: any[]): {
5
- partitionBy: (string | IExpr)[] | null;
6
- _rolling(windowSize: number, aggFn: (vals: any[]) => any): /*elided*/ any;
7
- get isWindow(): boolean;
8
- cum_count(reverse?: boolean): /*elided*/ any;
9
- cum_max(reverse?: boolean): /*elided*/ any;
10
- cum_min(reverse?: boolean): /*elided*/ any;
11
- cum_prod(reverse?: boolean): /*elided*/ any;
12
- cum_sum(reverse?: boolean): /*elided*/ any;
13
- dense_rank(): /*elided*/ any;
14
- lag(offset?: number, defaultVal?: any): /*elided*/ any;
15
- lead(offset?: number, defaultVal?: any): /*elided*/ any;
16
- over(columns: string | IExpr | (string | IExpr)[]): /*elided*/ any;
17
- rank(): /*elided*/ any;
18
- rolling_max(windowSize: number): /*elided*/ any;
19
- rolling_mean(windowSize: number): /*elided*/ any;
20
- rolling_median(windowSize: number): /*elided*/ any;
21
- rolling_min(windowSize: number): /*elided*/ any;
22
- rolling_quantile(quantile: number, windowSize: number): /*elided*/ any;
23
- rolling_rank(windowSize: number): /*elided*/ any;
24
- rolling_std(windowSize: number): /*elided*/ any;
25
- rolling_sum(windowSize: number): /*elided*/ any;
26
- row_number(): /*elided*/ any;
27
- ops: import("../../types").OpFn[];
28
- colName?: string;
29
- outputName?: string;
30
- isLiteral?: boolean;
31
- literalValue?: any;
32
- aggFn?: import("../../types").AggFn<any> | null;
33
- groupingOpsIndex?: number;
34
- partitionOpsIndex?: number;
35
- windowOp?: {
36
- type: string;
37
- [key: string]: any;
38
- } | null;
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;
2
+ import { ExprBase } from "../ExprBase";
3
+ export declare class WindowExpr extends ExprBase {
4
+ partitionBy: (string | IExpr)[] | null;
5
+ _window(evaluateWindow: (this: IExpr, groupPreValues: any[], partitionIndices: number[], currentIndex: number) => any): this;
6
+ _rolling(windowSize: number, aggFn: (vals: any[]) => any): this;
7
+ _cum(reverse: boolean, initialVal: any, stepFn: (acc: any, val: any) => any, postFn?: (acc: any, hasValid: boolean) => any): this;
8
+ get isWindow(): boolean;
9
+ cum_count(reverse?: boolean): this;
10
+ cum_max(reverse?: boolean): this;
11
+ cum_min(reverse?: boolean): this;
12
+ cum_prod(reverse?: boolean): this;
13
+ cum_sum(reverse?: boolean): this;
14
+ dense_rank(): this;
15
+ lag(offset?: number, defaultVal?: any): this;
16
+ lead(offset?: number, defaultVal?: any): this;
17
+ over(columns: string | IExpr | (string | IExpr)[]): this;
18
+ rank(): this;
19
+ rolling_max(windowSize: number): this;
20
+ rolling_mean(windowSize: number): this;
21
+ rolling_median(windowSize: number): this;
22
+ rolling_min(windowSize: number): this;
23
+ rolling_quantile(quantile: number, windowSize: number): this;
24
+ rolling_rank(windowSize: number): this;
25
+ rolling_std(windowSize: number): this;
26
+ rolling_sum(windowSize: number): this;
27
+ row_number(): this;
28
+ }
@@ -5,3 +5,4 @@ export interface RandomOptions {
5
5
  max?: number;
6
6
  integer?: boolean;
7
7
  }
8
+ export type NumericArg = number | IExpr | null;
@@ -0,0 +1,4 @@
1
+ import type { IExpr, ColumnData, ColumnDict } from "../types";
2
+ export declare const kleeneUnary: (fn: (v: any) => any) => (vArray: ColumnData) => any[];
3
+ export declare const kleeneBinary: (expr: IExpr, other: any, fn: (v: any, r: any) => any) => (vArray: ColumnData, columns: ColumnDict) => any[];
4
+ export declare function evaluateExpression(expr: IExpr, columns: ColumnDict, height: number): ColumnData;
@@ -0,0 +1,11 @@
1
+ export declare const NEWLINE = "\n";
2
+ export declare const CARRIAGE_RETURN = "\r";
3
+ export declare const UTF8_BOM = "\uFEFF";
4
+ export declare const MS_PER_SECOND = 1000;
5
+ export declare const MS_PER_MINUTE = 60000;
6
+ export declare const MS_PER_HOUR = 3600000;
7
+ export declare const MS_PER_DAY = 86400000;
8
+ export declare const US_PER_MS = 1000;
9
+ export declare const NS_PER_MS = 1000000;
10
+ export declare const US_PER_MS_BI = 1000n;
11
+ export declare const NS_PER_MS_BI = 1000000n;
@@ -1 +1,4 @@
1
1
  export declare const KEY_SEPARATOR = "\0";
2
+ export declare const NEWLINE = "\n";
3
+ export declare const CARRIAGE_RETURN = "\r";
4
+ export declare const UTF8_BOM = "\uFEFF";