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

> Системная таблица с информацией обо всех кэшированных схемах файлов.

# system.schema_inference_cache

<Info>
  **Запросы в ClickHouse Cloud**

  Данные в этой системной таблице хранятся локально на каждом узле ClickHouse Cloud. Поэтому, чтобы получить полное представление обо всех данных, требуется функция `clusterAllReplicas`. Дополнительные сведения см. [здесь](/ru/reference/system-tables/overview#system-tables-in-clickhouse-cloud).
</Info>

<div id="description">
  ## Описание
</div>

Содержит информацию обо всех схемах файлов, хранящихся в кэше.

<div id="columns">
  ## Столбцы
</div>

* `storage` ([String](/ru/reference/data-types)) — Имя хранилища: File, URL, S3 или HDFS.
* `source` ([String](/ru/reference/data-types)) — Источник файла.
* `format` ([String](/ru/reference/data-types)) — Название формата.
* `additional_format_info` ([String](/ru/reference/data-types)) — Дополнительная информация, необходимая для определения схемы. Например, специфичные для формата настройки.
* `registration_time` ([DateTime](/ru/reference/data-types)) — Временная метка добавления схемы в кэш.
* `schema` ([Nullable(String)](/ru/reference/data-types)) — Кэшированная схема.
* `number_of_rows` ([Nullable(UInt64)](/ru/reference/data-types)) — Количество строк в файле в указанном формате. Используется для кэширования простого `count()` для файлов данных, а также количества строк из метаданных при автоматическом определении схемы.
* `schema_inference_mode` ([Nullable(String)](/ru/reference/data-types)) — Режим определения схемы.

<div id="example">
  ## Пример
</div>

Допустим, у нас есть файл `data.jsonl` со следующим содержимым:

```json theme={null}
{"id" :  1, "age" :  25, "name" :  "Josh", "hobbies" :  ["football", "cooking", "music"]}
{"id" :  2, "age" :  19, "name" :  "Alan", "hobbies" :  ["tennis", "art"]}
{"id" :  3, "age" :  32, "name" :  "Lana", "hobbies" :  ["fitness", "reading", "shopping"]}
{"id" :  4, "age" :  47, "name" :  "Brayan", "hobbies" :  ["movies", "skydiving"]}
```

<Tip>
  Поместите `data.jsonl` в каталог `user_files_path`. Его можно найти
  в конфигурационных файлах ClickHouse. Значение по умолчанию:

  ```sql theme={null}
  <user_files_path>/var/lib/clickhouse/user_files/</user_files_path>
  ```
</Tip>

Откройте `clickhouse-client` и выполните запрос `DESCRIBE`:

```sql theme={null}
DESCRIBE file('data.jsonl') SETTINGS input_format_try_infer_integers=0;
```

```response theme={null}
┌─name────┬─type────────────────────┬─default_type─┬─default_expression─┬─comment─┬─codec_expression─┬─ttl_expression─┐
│ id      │ Nullable(Float64)       │              │                    │         │                  │                │
│ age     │ Nullable(Float64)       │              │                    │         │                  │                │
│ name    │ Nullable(String)        │              │                    │         │                  │                │
│ hobbies │ Array(Nullable(String)) │              │                    │         │                  │                │
└─────────┴─────────────────────────┴──────────────┴────────────────────┴─────────┴──────────────────┴────────────────┘
```

Давайте посмотрим на содержимое таблицы `system.schema_inference_cache`:

```sql theme={null}
SELECT *
FROM system.schema_inference_cache
FORMAT Vertical
```

```response theme={null}
Row 1:
──────
storage:                File
source:                 /home/droscigno/user_files/data.jsonl
format:                 JSONEachRow
additional_format_info: schema_inference_hints=, max_rows_to_read_for_schema_inference=25000, schema_inference_make_columns_nullable=true, try_infer_integers=false, try_infer_dates=true, try_infer_datetimes=true, try_infer_numbers_from_strings=true, read_bools_as_numbers=true, try_infer_objects=false
registration_time:      2022-12-29 17:49:52
schema:                 id Nullable(Float64), age Nullable(Float64), name Nullable(String), hobbies Array(Nullable(String))
```

<div id="see-also">
  ## См. также
</div>

* [Автоматическое определение схемы](/ru/concepts/features/interfaces/schema-inference)
