---
title: tuple_sketch_theta_double function
description: Learn the syntax of the tuple\_sketch\_theta\_double function of the SQL language in Databricks SQL and Databricks Runtime.
canonical_url: https://docs.databricks.com/aws/en/sql/language-manual/functions/tuple_sketch_theta_double
---

# `tuple_sketch_theta_double` function

**Applies to:** ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) 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
```

## Related

* [`tuple_sketch_theta_integer` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/tuple_sketch_theta_integer.md)
* [`tuple_sketch_estimate_double` function](https://docs.databricks.com/aws/en/sql/language-manual/functions/tuple_sketch_estimate_double.md)
