pyspark.sql.functions.kll_sketch_to_string_float#
- pyspark.sql.functions.kll_sketch_to_string_float(col)[source]#
Returns a string with human readable summary information about the KLL float sketch.
Added in version 4.1.0.
- Parameters:
- col
Columnor column name The KLL float sketch binary representation. A column that evaluates to a binary.
- col
- Returns:
ColumnA string representation of the sketch. Returns a column that evaluates to a string.
Examples
>>> from pyspark.sql import functions as sf >>> df = spark.createDataFrame([1.0,2.0,3.0,4.0,5.0], "FLOAT") >>> sketch_df = df.agg(sf.kll_sketch_agg_float("value").alias("sketch")) >>> result = sketch_df.select(sf.kll_sketch_to_string_float("sketch")).first()[0] >>> "kll" in result.lower() True