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

> ClickHouse에서 지원하는 입력 및 출력 데이터 포맷 개요

# 입력 및 출력 데이터 포맷

export const CloudNotSupportedBadge = () => {
  return <div className="cloudNotSupportedBadge">
            <div className="cloudNotSupportedIcon">
            <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
                <path strokeWidth="1.5" d="M6.33366 12.6666L12.3739 12.6667C13.6593 12.6667 14.7073 11.6187 14.7073 10.3334C14.7073 9.04804 13.6593 8.00003 12.3739 8.00003C12.3739 8.00003 12.3337 7.66659 12.0003 7.33325M10.667 5.33322C8.00033 2.33325 4.45395 4.78537 4.14195 6.68203C2.55728 6.7627 1.29395 8.06203 1.29395 9.6667C1.29395 11.3234 2.66699 12.6666 4.00033 12.6666" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
                <path strokeWidth="1.5" d="M2.66699 14L12.0003 4.66663" stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" />
            </svg>

        </div>
            Not supported in ClickHouse Cloud
        </div>;
};

ClickHouse는 널리 알려진 대부분의 텍스트 및 바이너리 데이터 포맷을 지원합니다. 이를 통해 거의 모든 데이터 파이프라인에 쉽게 통합하여 ClickHouse의 이점을 활용할 수 있습니다.

<div id="input-formats">
  ## 입력 형식
</div>

입력 형식은 다음 용도로 사용됩니다.

* `INSERT` SQL 문에 제공된 데이터 파싱
* `File`, `URL`, `HDFS`와 같은 파일 기반 테이블(file-backed tables)에서 `SELECT` 쿼리 수행
* 딕셔너리 읽기

ClickHouse에서 데이터를 효율적으로 수집하려면 적절한 입력 형식을 선택하는 것이 매우 중요합니다. 지원되는 포맷이 70개가 넘기 때문에,
가장 성능이 뛰어난 옵션을 선택하면 삽입 속도, CPU 및 메모리 사용량, 전반적인 시스템
효율성에 큰 차이를 만들 수 있습니다. 이러한 선택에 도움을 드리기 위해 포맷별 수집 성능을 벤치마크했으며, 그 결과 다음과 같은 핵심 사항을 확인했습니다.

* **[Native](/ko/reference/formats/Native) 포맷은 가장 효율적인 입력 형식입니다**. 가장 뛰어난 압축률, 가장 낮은
  리소스 사용량, 최소한의 서버 측 처리 오버헤드를 제공합니다.
* **압축은 필수입니다** - LZ4는 CPU 비용을 거의 늘리지 않으면서 데이터 크기를 줄여 주고, ZSTD는 더 높은 압축률을 제공하는 대신
  CPU 사용량이 더 필요합니다.
* **사전 정렬의 영향은 중간 정도입니다**. ClickHouse가 이미 효율적으로 정렬하기 때문입니다.
* **배칭은 효율성을 크게 높입니다** - 배치가 클수록 삽입 오버헤드가 줄고 처리량이 향상됩니다.

결과와 모범 사례를 자세히 살펴보려면
전체 [벤치마크 분석](https://www.clickhouse.com/blog/clickhouse-input-format-matchup-which-is-fastest-most-efficient)을 읽어보십시오.
전체 테스트 결과는 [FastFormats](https://fastformats.clickhouse.com/) 온라인 대시보드에서 확인하십시오.

<div id="output-formats">
  ## 출력 형식
</div>

출력에 지원되는 포맷은 다음 용도로 사용됩니다:

* `SELECT` 쿼리 결과를 정렬
* 파일 기반 테이블에 `INSERT` 작업 수행

<div id="formats-overview">
  ## 포맷 개요
</div>

지원되는 포맷은 다음과 같습니다:

| 포맷                                                                                                                  | 입력 | 출력 |
| ------------------------------------------------------------------------------------------------------------------- | -- | -- |
| [TabSeparated](/ko/reference/formats/TabSeparated/TabSeparated)                                                     | ✔  | ✔  |
| [TabSeparatedRaw](/ko/reference/formats/TabSeparated/TabSeparatedRaw)                                               | ✔  | ✔  |
| [TabSeparatedWithNames](/ko/reference/formats/TabSeparated/TabSeparatedWithNames)                                   | ✔  | ✔  |
| [TabSeparatedWithNamesAndTypes](/ko/reference/formats/TabSeparated/TabSeparatedWithNamesAndTypes)                   | ✔  | ✔  |
| [TabSeparatedRawWithNames](/ko/reference/formats/TabSeparated/TabSeparatedRawWithNames)                             | ✔  | ✔  |
| [TabSeparatedRawWithNamesAndTypes](/ko/reference/formats/TabSeparated/TabSeparatedRawWithNamesAndTypes)             | ✔  | ✔  |
| [Template](/ko/reference/formats/Template/Template)                                                                 | ✔  | ✔  |
| [TemplateIgnoreSpaces](/ko/reference/formats/Template/TemplateIgnoreSpaces)                                         | ✔  | ✗  |
| [CSV](/ko/reference/formats/CSV/CSV)                                                                                | ✔  | ✔  |
| [CSVWithNames](/ko/reference/formats/CSV/CSVWithNames)                                                              | ✔  | ✔  |
| [CSVWithNamesAndTypes](/ko/reference/formats/CSV/CSVWithNamesAndTypes)                                              | ✔  | ✔  |
| [CustomSeparated](/ko/reference/formats/CustomSeparated/CustomSeparated)                                            | ✔  | ✔  |
| [CustomSeparatedWithNames](/ko/reference/formats/CustomSeparated/CustomSeparatedWithNames)                          | ✔  | ✔  |
| [CustomSeparatedWithNamesAndTypes](/ko/reference/formats/CustomSeparated/CustomSeparatedWithNamesAndTypes)          | ✔  | ✔  |
| [SQLInsert](/ko/reference/formats/SQLInsert)                                                                        | ✗  | ✔  |
| [Values](/ko/reference/formats/Values)                                                                              | ✔  | ✔  |
| [Vertical](/ko/reference/formats/Vertical)                                                                          | ✗  | ✔  |
| [JSON](/ko/reference/formats/JSON/JSON)                                                                             | ✔  | ✔  |
| [JSONAsString](/ko/reference/formats/JSON/JSONAsString)                                                             | ✔  | ✗  |
| [JSONAsObject](/ko/reference/formats/JSON/JSONAsObject)                                                             | ✔  | ✗  |
| [JSONStrings](/ko/reference/formats/JSON/JSONStrings)                                                               | ✔  | ✔  |
| [JSONColumns](/ko/reference/formats/JSON/JSONColumns)                                                               | ✔  | ✔  |
| [JSONColumnsWithMetadata](/ko/reference/formats/JSON/JSONColumnsWithMetadata)                                       | ✔  | ✔  |
| [JSONCompact](/ko/reference/formats/JSON/JSONCompact)                                                               | ✔  | ✔  |
| [JSONCompactStrings](/ko/reference/formats/JSON/JSONCompactStrings)                                                 | ✗  | ✔  |
| [JSONCompactColumns](/ko/reference/formats/JSON/JSONCompactColumns)                                                 | ✔  | ✔  |
| [JSONEachRow](/ko/reference/formats/JSON/JSONEachRow)                                                               | ✔  | ✔  |
| [PrettyJSONEachRow](/ko/reference/formats/JSON/PrettyJSONEachRow)                                                   | ✗  | ✔  |
| [JSONEachRowWithProgress](/ko/reference/formats/JSON/JSONEachRowWithProgress)                                       | ✗  | ✔  |
| [JSONStringsEachRow](/ko/reference/formats/JSON/JSONStringsEachRow)                                                 | ✔  | ✔  |
| [JSONStringsEachRowWithProgress](/ko/reference/formats/JSON/JSONStringsEachRowWithProgress)                         | ✗  | ✔  |
| [JSONCompactEachRow](/ko/reference/formats/JSON/JSONCompactEachRow)                                                 | ✔  | ✔  |
| [JSONCompactEachRowWithNames](/ko/reference/formats/JSON/JSONCompactEachRowWithNames)                               | ✔  | ✔  |
| [JSONCompactEachRowWithNamesAndTypes](/ko/reference/formats/JSON/JSONCompactEachRowWithNamesAndTypes)               | ✔  | ✔  |
| [JSONCompactEachRowWithProgress](/ko/reference/formats/JSON/JSONCompactEachRowWithProgress)                         | ✗  | ✔  |
| [JSONCompactStringsEachRow](/ko/reference/formats/JSON/JSONCompactStringsEachRow)                                   | ✔  | ✔  |
| [JSONCompactStringsEachRowWithNames](/ko/reference/formats/JSON/JSONCompactStringsEachRowWithNames)                 | ✔  | ✔  |
| [JSONCompactStringsEachRowWithNamesAndTypes](/ko/reference/formats/JSON/JSONCompactStringsEachRowWithNamesAndTypes) | ✔  | ✔  |
| [JSONCompactStringsEachRowWithProgress](/ko/reference/formats/JSON/JSONCompactStringsEachRowWithProgress)           | ✗  | ✔  |
| [JSONObjectEachRow](/ko/reference/formats/JSON/JSONObjectEachRow)                                                   | ✔  | ✔  |
| [BSONEachRow](/ko/reference/formats/BSONEachRow)                                                                    | ✔  | ✔  |
| [TSKV](/ko/reference/formats/TabSeparated/TSKV)                                                                     | ✔  | ✔  |
| [Pretty](/ko/reference/formats/Pretty/Pretty)                                                                       | ✗  | ✔  |
| [PrettyNoEscapes](/ko/reference/formats/Pretty/PrettyNoEscapes)                                                     | ✗  | ✔  |
| [PrettyMonoBlock](/ko/reference/formats/Pretty/PrettyMonoBlock)                                                     | ✗  | ✔  |
| [PrettyNoEscapesMonoBlock](/ko/reference/formats/Pretty/PrettyNoEscapesMonoBlock)                                   | ✗  | ✔  |
| [PrettyCompact](/ko/reference/formats/Pretty/PrettyCompact)                                                         | ✗  | ✔  |
| [PrettyCompactNoEscapes](/ko/reference/formats/Pretty/PrettyCompactNoEscapes)                                       | ✗  | ✔  |
| [PrettyCompactMonoBlock](/ko/reference/formats/Pretty/PrettyCompactMonoBlock)                                       | ✗  | ✔  |
| [PrettyCompactNoEscapesMonoBlock](/ko/reference/formats/Pretty/PrettyCompactNoEscapesMonoBlock)                     | ✗  | ✔  |
| [PrettySpace](/ko/reference/formats/Pretty/PrettySpace)                                                             | ✗  | ✔  |
| [PrettySpaceNoEscapes](/ko/reference/formats/Pretty/PrettySpaceNoEscapes)                                           | ✗  | ✔  |
| [PrettySpaceMonoBlock](/ko/reference/formats/Pretty/PrettySpaceMonoBlock)                                           | ✗  | ✔  |
| [PrettySpaceNoEscapesMonoBlock](/ko/reference/formats/Pretty/PrettySpaceNoEscapesMonoBlock)                         | ✗  | ✔  |
| [Prometheus](/ko/reference/formats/Prometheus)                                                                      | ✗  | ✔  |
| [Protobuf](/ko/reference/formats/Protobuf/Protobuf)                                                                 | ✔  | ✔  |
| [ProtobufSingle](/ko/reference/formats/Protobuf/ProtobufSingle)                                                     | ✔  | ✔  |
| [ProtobufList](/ko/reference/formats/Protobuf/ProtobufList)                                                         | ✔  | ✔  |
| [Avro](/ko/reference/formats/Avro/Avro)                                                                             | ✔  | ✔  |
| [AvroConfluent](/ko/reference/formats/Avro/AvroConfluent)                                                           | ✔  | ✔  |
| [Parquet](/ko/reference/formats/Parquet/Parquet)                                                                    | ✔  | ✔  |
| [ParquetMetadata](/ko/reference/formats/Parquet/ParquetMetadata)                                                    | ✔  | ✗  |
| [Arrow](/ko/reference/formats/Arrow/Arrow)                                                                          | ✔  | ✔  |
| [ArrowStream](/ko/reference/formats/Arrow/ArrowStream)                                                              | ✔  | ✔  |
| [ORC](/ko/reference/formats/ORC)                                                                                    | ✔  | ✔  |
| [One](/ko/reference/formats/One)                                                                                    | ✔  | ✗  |
| [Npy](/ko/reference/formats/Npy)                                                                                    | ✔  | ✔  |
| [RowBinary](/ko/reference/formats/RowBinary/RowBinary)                                                              | ✔  | ✔  |
| [RowBinaryWithNames](/ko/reference/formats/RowBinary/RowBinaryWithNames)                                            | ✔  | ✔  |
| [RowBinaryWithNamesAndTypes](/ko/reference/formats/RowBinary/RowBinaryWithNamesAndTypes)                            | ✔  | ✔  |
| [RowBinaryWithDefaults](/ko/reference/formats/RowBinary/RowBinaryWithDefaults)                                      | ✔  | ✗  |
| [Native](/ko/reference/formats/Native)                                                                              | ✔  | ✔  |
| [Buffers](/ko/reference/formats/Buffers)                                                                            | ✔  | ✔  |
| [Null](/ko/reference/formats/Null)                                                                                  | ✗  | ✔  |
| [Hash](/ko/reference/formats/Hash)                                                                                  | ✗  | ✔  |
| [XML](/ko/reference/formats/XML)                                                                                    | ✗  | ✔  |
| [CapnProto](/ko/reference/formats/CapnProto)                                                                        | ✔  | ✔  |
| [LineAsString](/ko/reference/formats/LineAsString/LineAsString)                                                     | ✔  | ✔  |
| [LineAsStringWithNames](/ko/reference/formats/LineAsString/LineAsStringWithNames)                                   | ✔  | ✔  |
| [LineAsStringWithNamesAndTypes](/ko/reference/formats/LineAsString/LineAsStringWithNamesAndTypes)                   | ✔  | ✔  |
| [Regexp](/ko/reference/formats/Regexp)                                                                              | ✔  | ✗  |
| [RawBLOB](/ko/reference/formats/RawBLOB)                                                                            | ✔  | ✔  |
| [MsgPack](/ko/reference/formats/MsgPack)                                                                            | ✔  | ✔  |
| [MySQLDump](/ko/reference/formats/MySQLDump)                                                                        | ✔  | ✗  |
| [DWARF](/ko/reference/formats/DWARF)                                                                                | ✔  | ✗  |
| [Markdown](/ko/reference/formats/Markdown)                                                                          | ✗  | ✔  |
| [Form](/ko/reference/formats/Form)                                                                                  | ✔  | ✗  |

일부 포맷 처리 매개변수는 ClickHouse 설정을 통해 제어할 수 있습니다. 자세한 내용은 [설정](/ko/reference/settings/formats) 섹션을 참조하십시오.

<div id="formatschema">
  ## 포맷 스키마
</div>

포맷 스키마를 포함하는 파일 이름은 `format_schema` 설정으로 지정합니다.
`Cap'n Proto`와 `Protobuf` 포맷 중 하나를 사용할 때는 이 설정을 반드시 지정해야 합니다.
포맷 스키마는 파일 이름과 그 파일에 있는 메시지 유형 이름을 콜론으로 구분해 결합한 형태이며,
예를 들어 `schemafile.proto:MessageType`와 같습니다.
파일에 해당 포맷의 표준 확장자(예: `Protobuf`의 `.proto`)가 있으면
이를 생략할 수 있으며, 이 경우 포맷 스키마는 `schemafile:MessageType` 형태가 됩니다.

대화형 모드에서 [client](/ko/concepts/features/interfaces/client)를 통해 데이터를 입력하거나 출력하는 경우, 포맷 스키마에 지정된 파일 이름에는
절대 경로나 클라이언트의 현재 디렉터리를 기준으로 한 상대 경로를 사용할 수 있습니다.
[batch mode](/ko/concepts/features/interfaces/client#batch-mode)에서 client를 사용하는 경우에는 보안상의 이유로 스키마 경로가 상대 경로여야 합니다.

[HTTP 인터페이스](/ko/concepts/features/interfaces/http)를 통해 데이터를 입력하거나 출력하는 경우, 포맷 스키마에 지정된 파일 이름은
서버 구성의 [format\_schema\_path](/ko/reference/settings/server-settings/settings#format_schema_path)에서 지정한 디렉터리에
있어야 합니다.

<div id="skippingerrors">
  ## 오류 건너뛰기
</div>

`CSV`, `TabSeparated`, `TSKV`, `JSONEachRow`, `Template`, `CustomSeparated`, `Protobuf`와 같은 일부 포맷은 파싱 오류가 발생하면 손상된 행을 건너뛰고 다음 행의 시작부터 파싱을 계속할 수 있습니다. [input\_format\_allow\_errors\_num](/ko/reference/settings/formats#input_format_allow_errors_num) 및
[input\_format\_allow\_errors\_ratio](/ko/reference/settings/formats#input_format_allow_errors_ratio) 설정을 참조하십시오.
제한 사항:

* 파싱 오류가 발생하면 `JSONEachRow`는 새 줄(또는 EOF)까지의 모든 데이터를 건너뛰므로, 오류 수를 올바르게 계산하려면 행이 `\n`으로 구분되어야 합니다.
* `Template`와 `CustomSeparated`는 다음 행의 시작을 찾기 위해 마지막 컬럼 뒤의 구분자와 행 사이의 구분자를 사용하므로, 둘 중 하나 이상이 비어 있지 않을 때만 오류 건너뛰기가 작동합니다.
