Skip to contents

Creates a comparison level that matches when the smaller of two array columns is a complete subset of the larger. In other words, every element of the smaller array appears in the larger one.

Usage

cl_array_subset()

Value

A comparison-level object for use in il_compare().

Details

On DuckDB this is computed in SQL by counting the distinct elements shared by both arrays. On SQLite it falls back to an R-side set check.

Examples

il_spec() |>
  il_compare(qualifications, cl_array_subset())
#> Linkage Specification
#>   Comparisons (1):
#>     qualifications : array_subset
#>   Blocking rules: (none)