Adds a column per window function to every row (spec §7.13): each computed over the rows that share the row's partition column values (all the rows without any), in the window's sort order. With a sort, an aggregate runs from the partition's first row to the current one, rows tied on the sort sharing a value, as SQL's default frame does (D5, PLAN §11.6); without one, it covers the whole partition. The rank and row functions need a sort (PLAN §11.9). The input's columns and rows stay as they are, in the input's order.

Hierarchy (View Summary)

Constructors

Properties

aggregations: readonly ColumnAggregation[]

The window functions, each a new column

columns: readonly string[]

The partition columns, as listed; none is a window over all the rows

id: string

Unique within the query and shown to users, e.g. filter101

key: number

Assigned at construction from a monotonic sequence: the node's identity for change detection

rest: JsonObject

The keys of the node's saved JSON that this version does not know, kept so a re-save writes them back (PLAN §10.3); edits keep them too

sorts: readonly ColumnDirection[]

The window's sort keys, most significant first; may be empty

Accessors

  • get acceptsNewInputs(): boolean

    Whether edits may change which nodes feed this one. Not for a node whose port semantics are unknown, such as an Unknown node.

    Returns boolean

  • get consumesInputOrder(): boolean

    Whether the node takes rows by their order, as a Limit does: the emitter then writes its input's order as a sort just before it (PLAN §11.4)

    Returns boolean

  • get portLabels(): readonly string[]

    Labels for the input ports, shown on the edges that feed them

    Returns readonly string[]

  • get ports(): readonly string[]

    The named input slots, in order: none for a source, one for a unary transform, two for a binary one

    Returns readonly string[]

Methods

  • The description without the values users typed, which may be sensitive, for logs and telemetry. By default the description, which has none.

    Returns string

  • Whether the node has none of the settings it needs yet, e.g. a Join with no key pair: the canvas shows it as not set, not by its description

    Returns boolean

  • The input's order: every row and column is kept, so the order's columns are still there, and Cube writes it where it is used, after the window (PLAN §11.6). The window's own sort orders its functions, not the rows.

    Parameters

    • inputOrders: readonly (undefined | RowOrder)[]

    Returns undefined | RowOrder

  • The input's columns as they are, then one column per window function, in the order listed, typed as the engine types it and nullable but for the counts and the rank functions (PLAN §5.7, §11.6, §11.9); undefined when invalid

    Parameters

    • inputSchemas: readonly Schema[]

    Returns undefined | Schema

  • The partition columns first: none twice, then each checked (validatePartitionColumn), every one reported; none at all is one window over all the rows. Then the sort keys, each checked (validateSortKey), every one reported, then none twice; none at all is an unsorted window. Then some window functions, each checked (validateColumnAggregation, as a window's), every one reported. The engine fails on a duplicate with no location, so Cube refuses one first.

    Parameters

    • inputSchemas: readonly Schema[]
    • Optionalerrors: string[]

    Returns boolean

  • The node to keep once its two inputs swap ports: by default this node. A node whose settings name its inputs by side, such as a Join's key columns, returns a new node (same id) with those settings swapped too.

    Returns QueryNode