kll_sketch_to_string_double
Returns a string with human readable summary information about the KLL double sketch.
Syntax
Python
from pyspark.sql import functions as sf
sf.kll_sketch_to_string_double(col)
Parameters
Parameter | Type | Description |
|---|---|---|
|
| The KLL double sketch binary representation. |
Returns
pyspark.sql.Column: A string representation of the sketch.
Examples
Example 1: Get string representation of KLL double sketch
Python
from pyspark.sql import functions as sf
df = spark.createDataFrame([1.0,2.0,3.0,4.0,5.0], "DOUBLE")
sketch_df = df.agg(sf.kll_sketch_agg_double("value").alias("sketch"))
result = sketch_df.select(sf.kll_sketch_to_string_double("sketch")).first()[0]
"Kll" in result and "N" in result
Output
True