Skip to main content

kll_sketch_merge_bigint

Merges two KLL bigint sketch buffers together into one.

Syntax

Python
from pyspark.sql import functions as sf

sf.kll_sketch_merge_bigint(left, right)

Parameters

Parameter

Type

Description

left

pyspark.sql.Column or str

The first KLL bigint sketch.

right

pyspark.sql.Column or str

The second KLL bigint sketch.

Parameter

Type

Description

left

pyspark.sql.Column or str

The first KLL bigint sketch.

right

pyspark.sql.Column or str

The second KLL bigint sketch.

Returns

pyspark.sql.Column: The merged KLL sketch.

Examples

Example 1: Merge two KLL bigint sketches

Python
from pyspark.sql import functions as sf
df = spark.createDataFrame([1,2,3,4,5], "INT")
sketch_df = df.agg(sf.kll_sketch_agg_bigint("value").alias("sketch"))
result = sketch_df.select(sf.kll_sketch_merge_bigint("sketch", "sketch")).first()[0]
result is not None and len(result) > 0
Output
True