[ES|QL] Adds inline docs for the SAMPLE command (#224806)

This PR adds inline docs for the CHANGE POINT command. It mimics the
content currently at
https://www.elastic.co/docs/reference/query-languages/esql/commands/processing-commands#esql-sample

<img width="526" alt="image"
src="https://github.com/user-attachments/assets/2eb9e99c-d768-4149-98b1-ec90717dc51b"
/>

Closes: https://github.com/elastic/docs-content/issues/1825
This commit is contained in:
florent-leborgne 2025-06-23 14:08:56 +02:00 committed by GitHub
parent 3a235538a0
commit 7127fa4e56
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -574,6 +574,56 @@ FROM employees
/>
),
},
{
label: i18n.translate('languageDocumentation.documentationESQL.sampleCommand', {
defaultMessage: 'SAMPLE',
}),
preview: true,
description: (
<Markdown
openLinksInNewTab={true}
markdownContent={i18n.translate(
'languageDocumentation.documentationESQL.sampleCommand.markdown',
{
defaultMessage: `### SAMPLE
The \`SAMPLE\` command samples a fraction of the table rows.
**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.
**Example**
The following example shows the detection of a step change:
\`\`\` esql
FROM employees
| KEEP emp_no
| SAMPLE 0.05
\`\`\`
| emp_no:integer |
|----------------|
| 10018 |
| 10024 |
| 10062 |
| 10081 |
`,
ignoreTag: true,
description:
'Text is in markdown. Do not translate function names, special characters, or field names like sum(bytes)',
}
)}
/>
),
},
{
label: i18n.translate('languageDocumentation.documentationESQL.sort', {
defaultMessage: 'SORT',