Skip to main content
Aggregate function that maintains two independent theta-union sketches — an anchor group (is_anchor = 1) and a window group (is_anchor = 0) — then at finalization intersects the two unions and returns the cardinality estimate of the intersection as DOUBLE. This is a single-pass equivalent of:

Syntax

  • sketch: VARBINARY compact theta sketch, typically produced by ds_theta_accumulate or ds_theta_combine.
  • is_anchor: INT flag. Any nonzero value routes the sketch to the anchor group; 0 routes it to the window group.

Return value

Returns DOUBLE. Returns 0 if either group receives no sketches.

Examples

Keywords

DS_THETA_INTERSECT_COND_AGG, DS_THETA_COMBINE, DS_THETA_INTERSECT, DS_THETA_ESTIMATE