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

> System table containing information about all cached file schemas.

# system.schema_inference_cache

<Info>
  **Querying in ClickHouse Cloud**

  The data in this system table is held locally on each node in ClickHouse Cloud. Obtaining a complete view of all data, therefore, requires the `clusterAllReplicas` function. See [here](/reference/system-tables/overview#system-tables-in-clickhouse-cloud) for further details.
</Info>

<h2 id="description">
  Description
</h2>

Contains information about all cached file schemas.

<h2 id="columns">
  Columns
</h2>

* `storage` ([String](/reference/data-types)) — Storage name: File, URL, S3 or HDFS.
* `source` ([String](/reference/data-types)) — File source.
* `format` ([String](/reference/data-types)) — Format name.
* `additional_format_info` ([String](/reference/data-types)) — Additional information required to identify the schema. For example, format specific settings.
* `registration_time` ([DateTime](/reference/data-types)) — Timestamp when schema was added in cache.
* `schema` ([Nullable(String)](/reference/data-types)) — Cached schema.
* `number_of_rows` ([Nullable(UInt64)](/reference/data-types)) — Number of rows in the file in given format. It's used for caching trivial count() from data files and for caching number of rows from the metadata during schema inference.
* `schema_inference_mode` ([Nullable(String)](/reference/data-types)) — Scheme inference mode.

<h2 id="example">
  Example
</h2>

Let's say we have a file `data.jsonl` with this content:

```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>
  Place `data.jsonl` in the `user_files_path` directory.  You can find this by looking
  in your ClickHouse configuration files. The default is:

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

Open `clickhouse-client` and run the `DESCRIBE` query:

```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)) │              │                    │         │                  │                │
└─────────┴─────────────────────────┴──────────────┴────────────────────┴─────────┴──────────────────┴────────────────┘
```

Let's see the content of the `system.schema_inference_cache` table:

```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))
```

<h2 id="see-also">
  See Also
</h2>

* [Automatic schema inference from input data](/concepts/features/interfaces/schema-inference)
