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

# materialized_views_* 会话设置

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

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="materialized_views_ignore_errors">
  ## materialized\_views\_ignore\_errors
</div>

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

如果启用，将数据推送到依赖的 materialized view 时 (无论是在其 `SELECT` 中还是在内部表 sink 中) 抛出的异常会作为警告记录，且 `INSERT` 语句会成功。如果禁用 (默认) ，这类异常会继续向上传播，且 `INSERT` 语句会失败。

此设置仅控制错误报告。它不会回滚对源表的写入，也不保证当依赖视图的管道中发生错误时，原始块是否已提交到源表。禁用时 (默认) ，`INSERT` 会因视图错误而失败——请结合插入去重 (`insert_deduplicate`、`deduplicate_blocks_in_dependent_materialized_views`) 重试，以便对源表和所有依赖视图实现 exactly-once 传递。启用时，即使失败视图及其下游链只完成了部分传递，`INSERT` 仍会报告成功；仅应在源表写入绝不能被视图侧问题阻塞时使用此设置 (例如 `system.*_log` 表) 。完整语义请参阅 `CREATE VIEW` 文档。

<div id="materialized_views_squash_parallel_inserts">
  ## materialized\_views\_squash\_parallel\_inserts
</div>

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.10"},{"label": "1"},{"label": "添加了此设置，以便在需要时保留旧有行为。"}]}]} />

将单个 INSERT 查询中通过并行插入写入 materialized view 目标表的写入操作合并，以减少生成的 parts 数量。
如果设置为 false 且启用了 `parallel_view_processing`，则 INSERT 查询会为每个 `max_insert_thread` 在目标表中生成一个 part。
