Back to Elasticsearch

Sample

docs/reference/query-languages/esql/_snippets/commands/layout/sample.md

9.5.0599 B
Original Source
yaml
serverless: ga
stack: preview 9.1-9.4, ga 9.5+

The SAMPLE command samples a fraction of the table rows.

::::{note} For automatic sampling with extrapolation and confidence intervals, see Approximate STATS queries. ::::

Syntax

esql
SAMPLE probability

Parameters

probability : The probability that a row is included in the sample. The value must be between 0 and 1, exclusive.

Examples

:::{include} ../../generated/x-pack-esql/commands/examples/sample.csv-spec/sampleForDocs.md :::