@platforma-open/milaboratories.software-ptabler.schema 1.9.0 → 1.11.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.
@@ -1,5 +1,5 @@
1
1
  import { DataType } from './common';
2
- export type Expression = ComparisonExpression | BinaryArithmeticExpression | UnaryArithmeticExpression | CastExpression | BooleanLogicExpression | NotExpression | NullCheckExpression | StringJoinExpression | HashExpression | ColumnReferenceExpression | ConstantValueExpression | RankExpression | CumsumExpression | ExtendedUnaryStringExpression | StringDistanceExpression | FuzzyStringFilterExpression | WhenThenOtherwiseExpression | SubstringExpression | StringReplaceExpression | StringContainsExpression | StringStartsWithExpression | StringEndsWithExpression | StringContainsAnyExpression | StringCountMatchesExpression | StringExtractExpression | MinMaxExpression | FillNaExpression | WindowExpression;
2
+ export type Expression = ComparisonExpression | BinaryArithmeticExpression | UnaryArithmeticExpression | CastExpression | BooleanLogicExpression | NotExpression | NullCheckExpression | StringJoinExpression | HashExpression | ColumnReferenceExpression | ConstantValueExpression | RankExpression | CumsumExpression | ExtendedUnaryStringExpression | StringDistanceExpression | FuzzyStringFilterExpression | WhenThenOtherwiseExpression | SubstringExpression | StringReplaceExpression | StringContainsExpression | StringStartsWithExpression | StringEndsWithExpression | StringContainsAnyExpression | StringCountMatchesExpression | StringExtractExpression | MinMaxExpression | FillNaExpression | WindowExpression | StructFieldExpression;
3
3
  /** Represents all possible expression types in the system. */
4
4
  export type ComparisonOperator = 'gt' | 'ge' | 'eq' | 'lt' | 'le' | 'neq';
5
5
  /** Defines a comparison operation between two expressions. */
@@ -406,3 +406,19 @@ export interface WindowExpression {
406
406
  /** List of expressions to partition the data by. The aggregation is performed independently within each partition. */
407
407
  partitionBy: Expression[];
408
408
  }
409
+ /**
410
+ * Represents a struct field access operation.
411
+ * This operation retrieves a single field from a struct (nested data structure).
412
+ * It corresponds to Polars' struct.field() functionality.
413
+ */
414
+ export interface StructFieldExpression {
415
+ /** The type of operation, always 'struct_field'. */
416
+ type: 'struct_field';
417
+ /** The struct expression to extract fields from. */
418
+ struct: Expression;
419
+ /**
420
+ * The field name to extract from the struct.
421
+ * Currently only supports single field extraction due to Polars behavior limitations.
422
+ */
423
+ fields: string;
424
+ }
package/dist/index.d.ts CHANGED
@@ -9,3 +9,4 @@ export type PTablerWorkflow = {
9
9
  workflow: PTablerStep[];
10
10
  };
11
11
  export type { BaseFileReadStep, BaseFileWriteStep };
12
+ export type { Expression, StructFieldExpression } from './expressions';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platforma-open/milaboratories.software-ptabler.schema",
3
- "version": "1.9.0",
3
+ "version": "1.11.0",
4
4
  "description": "Type definitions for PTabler",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.js",
@@ -28,7 +28,8 @@ export type Expression =
28
28
  | StringExtractExpression
29
29
  | MinMaxExpression
30
30
  | FillNaExpression
31
- | WindowExpression;
31
+ | WindowExpression
32
+ | StructFieldExpression;
32
33
 
33
34
  /** Represents all possible expression types in the system. */
34
35
  export type ComparisonOperator = 'gt' | 'ge' | 'eq' | 'lt' | 'le' | 'neq';
@@ -514,3 +515,20 @@ export interface WindowExpression {
514
515
  /** List of expressions to partition the data by. The aggregation is performed independently within each partition. */
515
516
  partitionBy: Expression[];
516
517
  }
518
+
519
+ /**
520
+ * Represents a struct field access operation.
521
+ * This operation retrieves a single field from a struct (nested data structure).
522
+ * It corresponds to Polars' struct.field() functionality.
523
+ */
524
+ export interface StructFieldExpression {
525
+ /** The type of operation, always 'struct_field'. */
526
+ type: 'struct_field';
527
+ /** The struct expression to extract fields from. */
528
+ struct: Expression;
529
+ /**
530
+ * The field name to extract from the struct.
531
+ * Currently only supports single field extraction due to Polars behavior limitations.
532
+ */
533
+ fields: string;
534
+ }
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ReadCsvStep, ReadNdjsonStep, WriteCsvStep, WriteJsonStep, WriteNdjsonStep, BaseFileReadStep, BaseFileWriteStep } from './io';
1
+ import type { ReadCsvStep, ReadNdjsonStep, WriteCsvStep, WriteNdjsonStep, BaseFileReadStep, BaseFileWriteStep } from './io';
2
2
  import type { AddColumnsStep, FilterStep, SelectStep, WithColumnsStep, WithoutColumnsStep } from './basic_steps';
3
3
  import type { AggregateStep } from './aggregate';
4
4
  import type { AnyJoinStep } from './join';
@@ -26,3 +26,6 @@ export type PTablerWorkflow = {
26
26
 
27
27
  // Re-export base interfaces for potential external use
28
28
  export type { BaseFileReadStep, BaseFileWriteStep };
29
+
30
+ // Re-export expression types for external use
31
+ export type { Expression, StructFieldExpression } from './expressions';