> ## 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.

> يحسب قائمة المسارات الفريدة وأنواعها المخزنة في JSON

# distinctJSONPathsAndTypes

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

استُحدثت في: v24.9.0

تحسب قائمة المسارات الفريدة وأنواعها المخزَّنة في عمود [JSON](/ar/reference/data-types/newjson).

<Note>
  إذا كان تعريف JSON يحتوي على مسارات بأنواع محددة، فستُدرَج هذه المسارات دائمًا في ناتج الدالتين `distinctJSONPaths/distinctJSONPathsAndTypes` حتى إذا لم تتضمن بيانات الإدخال قيمًا لهذه المسارات.
</Note>

**البنية**

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

**المعاملات**

* `json` — عمود JSON. [`JSON`](/ar/reference/data-types/newjson)

**القيمة المُعادة**

تُرجع خريطة مرتبة للمسارات والأنواع. [`Map(String, Array(String))`](/ar/reference/data-types/map)

**أمثلة**

**الاستخدام الأساسي مع أنواع مختلطة**

```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 distinctJSONPathsAndTypes(json) FROM test_json;
```

```response title=Response theme={null}
┌─distinctJSONPathsAndTypes(json)───────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ {'a':['Int64'],'b':['Array(Nullable(Int64))','String'],'c.d.e':['Date'],'c.d.f':['Array(JSON(max_dynamic_types=16, max_dynamic_paths=256))']} │
└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
```

**مع مسارات JSON المُصرَّح بها**

```sql title=Query theme={null}
DROP TABLE IF EXISTS test_json;
CREATE TABLE test_json(json JSON(a UInt32)) ENGINE = Memory;
INSERT INTO test_json VALUES ('{"b" : "Hello"}'), ('{"b" : "World", "c" : [1, 2, 3]}');

SELECT distinctJSONPathsAndTypes(json) FROM test_json;
```

```response title=Response theme={null}
┌─distinctJSONPathsAndTypes(json)────────────────────────────────┐
│ {'a':['UInt32'],'b':['String'],'c':['Array(Nullable(Int64))']} │
└────────────────────────────────────────────────────────────────┘
```
