> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# engine_file_* 会话设置

> engine_file_* 自动生成分组中的 ClickHouse 会话设置。

export const SettingsInfoBlock = ({type, default_value, changeable_without_restart}) => {
  return <div className="not-prose" style={{
    display: "flex",
    flexWrap: "wrap",
    alignItems: "baseline",
    columnGap: "0.5rem",
    rowGap: "0.125rem",
    margin: "0.375rem 0",
    fontSize: "0.8125rem",
    lineHeight: "1.125rem"
  }}>
      <div style={{
    fontWeight: 600,
    opacity: 0.72
  }}>类型</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{type}</div>
      <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>默认值</div>
      <div style={{
    overflowWrap: "anywhere"
  }}>{default_value}</div>
      {changeable_without_restart && <div style={{
    fontWeight: 600,
    opacity: 0.72,
    marginInlineStart: "0.5rem"
  }}>
          无需重启即可更改
        </div>}
      {changeable_without_restart && <div style={{
    overflowWrap: "anywhere"
  }}>
          {changeable_without_restart}
        </div>}
    </div>;
};

这些设置可在 [system.settings](/docs/zh/reference/system-tables/settings) 中查看，并由 [源文件](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp) 自动生成。

<div id="engine_file_allow_create_multiple_files">
  ## engine\_file\_allow\_create\_multiple\_files
</div>

<SettingsInfoBlock type="Bool" default_value="0" />

如果格式带有后缀 (`JSON`、`ORC`、`Parquet` 等) ，则控制在 File 表引擎表中每次 insert 时是否创建新文件。启用后，每次 insert 都会创建一个新文件，文件名遵循以下模式：

`data.Parquet` -> `data.1.Parquet` -> `data.2.Parquet`，以此类推。

可能的值：

* 0 — `INSERT` 查询会将新数据追加到文件末尾。
* 1 — `INSERT` 查询会创建一个新文件。

<div id="engine_file_empty_if_not_exists">
  ## engine\_file\_empty\_if\_not\_exists
</div>

<SettingsInfoBlock type="Bool" default_value="0" />

允许在文件不存在时从 File 表引擎表中查询数据。

可能的值：

* 0 — `SELECT` 抛出异常。
* 1 — `SELECT` 返回空结果。

<div id="engine_file_skip_empty_files">
  ## engine\_file\_skip\_empty\_files
</div>

<SettingsInfoBlock type="Bool" default_value="0" />

启用或禁用在 [File 表引擎](/docs/zh/reference/engines/table-engines/special/file)表中跳过空文件。

可选值：

* 0 — 如果空文件与所请求的格式不兼容，`SELECT` 会抛出异常。
* 1 — 对于空文件，`SELECT` 返回空结果。

<div id="engine_file_truncate_on_insert">
  ## engine\_file\_truncate\_on\_insert
</div>

<SettingsInfoBlock type="Bool" default_value="0" />

启用或禁用在 [File](/docs/zh/reference/engines/table-engines/special/file) 表引擎的表中插入前先截断文件。

可能的值：

* 0 — `INSERT` 查询会将新数据追加到文件末尾。
* 1 — `INSERT` 查询会用新数据替换文件中的现有内容。
