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

# type_json_* 格式设置

> ClickHouse 在 type_json_* 生成分组中的格式设置。

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>;
};

这些设置是根据[源文件](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/FormatFactorySettings.h)自动生成的。

<div id="type_json_allow_duplicated_key_with_literal_and_nested_object">
  ## type\_json\_allow\_duplicated\_key\_with\_literal\_and\_nested\_object
</div>

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

启用后，将允许解析如下 JSON：`{"a" : 42, "a" : {"b" : 42}}`，即某个键重复出现，但其中一个值是嵌套对象。

<div id="type_json_skip_duplicated_paths">
  ## type\_json\_skip\_duplicated\_paths
</div>

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

启用后，在将 JSON 对象解析为 JSON 类型时，会忽略重复路径，只插入第一个，而不会抛出异常

<div id="type_json_skip_invalid_typed_paths">
  ## type\_json\_skip\_invalid\_typed\_paths
</div>

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

启用后，对于带有类型化路径的 JSON 类型 列，如果某个字段的值无法转换为其声明的类型，则会跳过该字段，而不是抛出错误。被跳过的字段会视为缺失，并根据类型化路径的定义使用默认值/NULL 值。

此设置仅适用于 JSON 类型 列 (例如 `JSON(a Int64, b String)`) ，即其中某些特定路径已声明类型的情况。它不适用于常规 JSON input formats，例如向普通类型化列插入数据时使用的 `JSONEachRow`。

可能的值：

* 0 — 禁用 (类型不匹配时抛出错误) 。
* 1 — 启用 (类型不匹配时跳过字段) 。

<div id="type_json_use_partial_match_to_skip_paths_by_regexp">
  ## type\_json\_use\_partial\_match\_to\_skip\_paths\_by\_regexp
</div>

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

启用后，在将 JSON 对象 解析为 JSON 类型 时，通过 SKIP REGEXP 指定的正则表达式只需部分匹配即可跳过某个路径。禁用后，则必须完全匹配。
