bloom_contains_any


bloom_contains_any(string bloom, string key) or bloom_contains_any(string bloom, array keys)- Returns true if the bloom filter contains any of the given key

WITH data1 as (
SELECT explode(array(1,2,3,4,5)) as id
),
data2 as (
SELECT explode(array(1,3,5,6,8)) as id
),
bloom as (
SELECT bloom(id) as bf
FROM data1
)
SELECT
l.*
FROM
data2 l
CROSS JOIN bloom r
WHERE
bloom_contains_any(r.bf, array(l.id))

Platforms: WhereOS, Spark, Hive
Class: hivemall.sketch.bloom.BloomContainsAnyUDF

More functions can be added to WhereOS via Python or R bindings or as Java & Scala UDF (user-defined function), UDAF (user-defined aggregation function) and UDTF (user-defined table generating function) extensions. Custom libraries can be added on via Settings-page or installed from WhereOS Store.

Leave a Reply