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

# cast_string_* セッション設定

> cast_string_* 生成グループに含まれる 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/ja/reference/system-tables/settings) で参照でき、[ソースコード](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp) から自動生成されています。

<div id="cast_string_to_date_time_mode">
  ## cast\_string\_to\_date\_time\_mode
</div>

<SettingsInfoBlock type="DateTimeInputFormat" default_value="best_effort" />

<VersionHistory rows={[{"id": "row-1","items": [{"label": "26.5"},{"label": "best_effort"},{"label": "使い勝手を向上"}]}, {"id": "row-2","items": [{"label": "25.6"},{"label": "basic"},{"label": "String から DateTime への cast で、異なる DateTime パースモードを使用できるようにする"}]}]} />

String から cast する際に、日付と時刻のテキスト表現に使用するパーサーを選択できます。

設定可能な値:

* `'best_effort'` — 拡張パースを有効にします。

  ClickHouse は、基本的な `YYYY-MM-DD HH:MM:SS` フォーマットに加え、すべての [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) の日付・時刻フォーマットをパースできます。たとえば、`'2018-06-08T01:02:03.000Z'` です。

* `'best_effort_us'` — `best_effort` と似ています (違いについては [parseDateTimeBestEffortUS](/docs/ja/reference/functions/regular-functions/type-conversion-functions#parseDateTimeBestEffortUS) を参照してください)

* `'basic'` — 基本パーサーを使用します。

  ClickHouse は、基本的な `YYYY-MM-DD HH:MM:SS` または `YYYY-MM-DD` フォーマットのみをパースできます。たとえば、`2019-08-20 10:18:56` や `2019-08-20` です。

関連項目:

* [DateTime データ型](/docs/ja/reference/data-types/datetime)
* [日付と時刻を扱う関数](/docs/ja/reference/functions/regular-functions/date-time-functions)

<div id="cast_string_to_dynamic_use_inference">
  ## cast\_string\_to\_dynamic\_use\_inference
</div>

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "24.5"},{"label": "0"},{"label": "String をパースして Dynamic に変換できるようにする設定を追加"}]}]} />

String から Dynamic への変換時に型推論を使用します

<div id="cast_string_to_variant_use_inference">
  ## cast\_string\_to\_variant\_use\_inference
</div>

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

<VersionHistory rows={[{"id": "row-1","items": [{"label": "25.4"},{"label": "1"},{"label": "String から Variant への CAST 時の型推論の有効/無効を切り替える新しい設定"}]}]} />

String から Variant への変換時に型推論を使用します。
