Subquery Outputs: How Results Are Used

The results of a subquery are used in different ways depending on the function:

  • Select events or elements โ€” The subquery filters or selects specific events or array elements based on conditions.

    Example contexts: array:filter(), selfJoinFilter()

  • Compute values โ€” The subquery calculates a value for each input event or element.

    Example context: array:eval()

  • Select and transform events โ€” The subquery retrieves and transforms events for use in the main query.

    Example contexts: defineTable(), correlate()

  • Perform aggregations โ€” The subquery aggregates data and returns summary results.

    Example contexts: array:reduceAll(), array of subqueries in groupBy()