Skip to main content

kll_sketch_to_string_bigint

Returns a string with human readable summary information about the KLL bigint sketch.

Syntax

Python
from pyspark.sql import functions as sf

sf.kll_sketch_to_string_bigint(col)

Parameters

Parameter

Type

Description

col

pyspark.sql.Column or str

The KLL bigint sketch binary representation.

Returns

pyspark.sql.Column: A string representation of the sketch.

Examples

Example 1: Get string representation of KLL bigint sketch

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_to_string_bigint("sketch")).first()[0]
"Kll" in result and "N" in result
Output
True