> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-8c05c8a2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Calcula una lista de rutas distintas almacenadas en una columna JSON.

# distinctJSONPaths

<div id="distinctJSONPaths">
  ## distinctJSONPaths
</div>

Introducido en: v24.9.0

Calcula una lista de rutas distintas almacenadas en una columna [JSON](/es/reference/data-types/newjson).

**Sintaxis**

```sql theme={null}
distinctJSONPaths(json)
```

**Argumentos**

* `json` — columna JSON. [`JSON`](/es/reference/data-types/newjson)

**Valor devuelto**

Devuelve la lista ordenada de rutas. [`Array(String)`](/es/reference/data-types/array)

**Ejemplos**

**Uso básico con JSON anidado**

```sql title=Query theme={null}
DROP TABLE IF EXISTS test_json;
CREATE TABLE test_json(json JSON) ENGINE = Memory;
INSERT INTO test_json VALUES ('{"a" : 42, "b" : "Hello"}'), ('{"b" : [1, 2, 3], "c" : {"d" : {"e" : "2020-01-01"}}}'), ('{"a" : 43, "c" : {"d" : {"f" : [{"g" : 42}]}}}');

SELECT distinctJSONPaths(json) FROM test_json;
```

```response title=Response theme={null}
┌─distinctJSONPaths(json)───┐
│ ['a','b','c.d.e','c.d.f'] │
└───────────────────────────┘
```

**Con rutas JSON definidas**

```sql title=Query theme={null}
DROP TABLE IF EXISTS test_json;
CREATE TABLE test_json(json JSON) ENGINE = Memory;
INSERT INTO test_json VALUES ('{"a" : 42, "b" : "Hello"}'), ('{"b" : [1, 2, 3], "c" : {"d" : {"e" : "2020-01-01"}}}'), ('{"a" : 43, "c" : {"d" : {"f" : [{"g" : 42}]}}}')

SELECT distinctJSONPaths(json) FROM test_json;
```

```response title=Response theme={null}
┌─distinctJSONPaths(json)─┐
│ ['a','b','c']           │
└─────────────────────────┘
```
