Class PCollection<T>

A deferred, possibly distributed collection of elements. See https://beam.apache.org/documentation/programming-guide/#pcollections

Type Parameters

  • T

Hierarchy

  • PCollection

Properties

computeId: (() => string)

Type declaration

    • (): string
    • Returns string

id: string

Methods

  • Returns a PCollection containing only elements that satisfy the given predicate function.

    This is analogous to JavaScript's Array.filter() method.

    Example usage:

    const evens = pcoll.filter(x => x % 2 === 0);
    const positives = pcoll.filter(x => x > 0);

    Returns

    A new PCollection containing only the elements for which the predicate returned true.

    Type Parameters

    • ContextT extends undefined | Object = undefined

    Parameters

    • fn: (ContextT extends undefined ? ((element: T) => boolean) : never) | ((element: T, context: ContextT) => boolean)

      A predicate function that returns true for elements to keep, false for elements to filter out. The function receives the element and optionally a context object.

    • context: ContextT = ...

      Optional context object to pass to the predicate function.

    Returns PCollection<T>

  • Type Parameters

    • OutputT

    • ContextT

    Parameters

    • fn: (ContextT extends undefined ? ((element: T) => Iterable<OutputT>) : never) | ((element: T, context: ContextT) => Iterable<OutputT>)
    • context: ContextT = ...

    Returns PCollection<OutputT>

  • Type Parameters

    • OutputT

    • ContextT

    Parameters

    • fn: (ContextT extends undefined ? ((element: T) => OutputT) : never) | ((element: T, context: ContextT) => OutputT)
    • context: ContextT = ...

    Returns PCollection<OutputT>

Generated using TypeDoc