メインコンテンツまでスキップ

tuple_sketch_theta_double function

Applies to: check marked yes Databricks Runtime 18.1 and above

Returns the theta value (sampling rate) from a TupleSketch with double summaries.

Syntax

tuple_sketch_theta_double ( sketch )

Arguments

  • sketch: A TupleSketch in binary format with double summaries.

Returns

A DOUBLE value between 0.0 and 1.0 representing the effective sampling rate of the sketch.

Notes

  • Theta = 1.0 indicates the sketch has not been sampled (exact mode).
  • Theta < 1.0 indicates the sketch has been probabilistically sampled.

Examples

SQL
> SELECT tuple_sketch_theta_double(tuple_sketch_agg_double(key, summary)) FROM VALUES (1, 1.0D), (2, 2.0D), (3, 3.0D) tab(key, summary);
1.0