2024-04-08 14:18:29 +00:00
|
|
|
---
|
|
|
|
slug: /en/sql-reference/table-functions/fuzzQuery
|
|
|
|
sidebar_position: 75
|
|
|
|
sidebar_label: fuzzQuery
|
|
|
|
---
|
|
|
|
|
|
|
|
# fuzzQuery
|
|
|
|
|
|
|
|
Perturbs the given query string with random variations.
|
|
|
|
|
|
|
|
``` sql
|
2024-07-03 05:34:25 +00:00
|
|
|
fuzzQuery(query[, max_query_length[, random_seed]])
|
2024-04-08 14:18:29 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
**Arguments**
|
|
|
|
|
|
|
|
- `query` (String) - The source query to perform the fuzzing on.
|
2024-07-03 05:34:25 +00:00
|
|
|
- `max_query_length` (UInt64) - A maximum length the query can get during the fuzzing process.
|
2024-04-08 14:18:29 +00:00
|
|
|
- `random_seed` (UInt64) - A random seed for producing stable results.
|
|
|
|
|
|
|
|
**Returned Value**
|
|
|
|
|
|
|
|
A table object with a single column containing perturbed query strings.
|
|
|
|
|
|
|
|
## Usage Example
|
|
|
|
|
|
|
|
``` sql
|
|
|
|
SELECT * FROM fuzzQuery('SELECT materialize(\'a\' AS key) GROUP BY key') LIMIT 2;
|
|
|
|
```
|
|
|
|
|
|
|
|
```
|
|
|
|
┌─query──────────────────────────────────────────────────────────┐
|
|
|
|
1. │ SELECT 'a' AS key GROUP BY key │
|
|
|
|
2. │ EXPLAIN PIPELINE compact = true SELECT 'a' AS key GROUP BY key │
|
|
|
|
└────────────────────────────────────────────────────────────────┘
|
|
|
|
```
|