> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-detect-table-modification.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Cloud에 파일 업로드

> Cloud에 파일을 업로드하는 방법을 알아봅니다

export const Image = ({img, alt, size = "lg"}) => {
  const normalizedSize = ["sm", "md", "lg"].includes(size) ? size : "lg";
  return <div className={`ch-image-${normalizedSize}`}>
      <Frame>
        <img src={img} alt={alt} />
      </Frame>
    </div>;
};

ClickHouse Cloud는 파일을 손쉽게 가져올 수 있는 방법을 제공하며, 다음
포맷을 지원합니다:

| 포맷                              |
| ------------------------------- |
| `CSV`                           |
| `CSVWithNamesAndTypes`          |
| `CSVWithNames`                  |
| `JSONEachRow`                   |
| `TabSeparated`                  |
| `TabSeparatedWithNames`         |
| `TabSeparatedWithNamesAndTypes` |

<Steps>
  <Step>
    ## 파일 업로드

    아래와 같이 Cloud 홈 페이지에서 서비스를 선택합니다:

    <Image img="https://mintcdn.com/private-7c7dfe99-detect-table-modification/I0yKDIFW2QfsHJIe/images/cloud/migrate/csv_01.webp?fit=max&auto=format&n=I0yKDIFW2QfsHJIe&q=85&s=ca931639add4b1448f9871bb4dc5a7d5" alt="upload_file_02" width="3024" height="1483" data-path="images/cloud/migrate/csv_01.webp" />

    서비스가 유휴 상태이면 먼저 활성화해야 합니다.

    아래와 같이 왼쪽 탭에서 `Data sources`를 선택합니다:

    <Image img="https://mintcdn.com/private-7c7dfe99-detect-table-modification/I0yKDIFW2QfsHJIe/images/cloud/migrate/csv_02.webp?fit=max&auto=format&n=I0yKDIFW2QfsHJIe&q=85&s=3d07583e0f23db5a86d43b81683bfca3" alt="upload_file_03" width="3024" height="1483" data-path="images/cloud/migrate/csv_02.webp" />

    다음으로 데이터 소스 페이지 오른쪽에서 `Upload a file`을 선택합니다:

    <Image img="https://mintcdn.com/private-7c7dfe99-detect-table-modification/I0yKDIFW2QfsHJIe/images/cloud/migrate/csv_03.webp?fit=max&auto=format&n=I0yKDIFW2QfsHJIe&q=85&s=1032b014a1f523d65877906a01f4dede" alt="upload_file_04" width="3024" height="1483" data-path="images/cloud/migrate/csv_03.webp" />

    파일 선택 대화상자가 나타나며, Cloud 서비스의 테이블에 데이터를 삽입하는 데
    사용할 파일을 선택할 수 있습니다.

    <Image img="https://mintcdn.com/private-7c7dfe99-detect-table-modification/I0yKDIFW2QfsHJIe/images/cloud/migrate/csv_04.webp?fit=max&auto=format&n=I0yKDIFW2QfsHJIe&q=85&s=9a1bfd3707e7f3b25f43819a43b9b013" alt="upload_file_05" width="1267" height="736" data-path="images/cloud/migrate/csv_04.webp" />
  </Step>

  <Step>
    ## 테이블 구성

    파일 업로드가 완료되면 데이터를 삽입할 테이블을 구성할 수
    있습니다. 처음 3개 행이 표시된 테이블 미리보기도 함께 제공됩니다.

    <Image img="https://mintcdn.com/private-7c7dfe99-detect-table-modification/I0yKDIFW2QfsHJIe/images/cloud/migrate/csv_08.webp?fit=max&auto=format&n=I0yKDIFW2QfsHJIe&q=85&s=3884126b5640d94ce4b914553d2ccfb2" alt="upload_file_08" width="3018" height="1476" data-path="images/cloud/migrate/csv_08.webp" />

    이제 대상 테이블을 선택할 수 있습니다. 옵션은 다음과 같습니다:

    * 새 테이블
    * 기존 테이블

    <br />

    데이터를 업로드할 데이터베이스를 지정할 수 있으며,
    새 테이블인 경우 생성할 테이블 이름도 지정할 수 있습니다. 또한 정렬 키를 선택할 수 있습니다:

    <Image img="https://mintcdn.com/private-7c7dfe99-detect-table-modification/I0yKDIFW2QfsHJIe/images/cloud/migrate/csv_05.webp?fit=max&auto=format&n=I0yKDIFW2QfsHJIe&q=85&s=e40f9092ae156aa556931da54266b47c" alt="upload_file_05" width="3016" height="1474" data-path="images/cloud/migrate/csv_05.webp" />

    파일에서 읽은 컬럼은 `Source field`로 표시되며, 각 필드에 대해
    다음을 변경할 수 있습니다:

    * 추론된 타입
    * 기본값
    * 해당 컬럼을 [널 허용](/ko/reference/data-types/nullable)로 설정할지 여부

    <Image img="https://mintcdn.com/private-7c7dfe99-detect-table-modification/I0yKDIFW2QfsHJIe/images/cloud/migrate/csv_06.webp?fit=max&auto=format&n=I0yKDIFW2QfsHJIe&q=85&s=05557d10090cef86422e21a7864467cb" alt="upload_file_06" width="3012" height="1476" data-path="images/cloud/migrate/csv_06.webp" />

    <Info>
      **필드 제외**

      가져오기에 포함하지 않으려는 필드는 제거할 수도 있습니다.
    </Info>

    사용할 테이블 엔진을 지정할 수 있습니다:

    * `MergeTree`
    * `ReplacingMergeTree`
    * `SummingMergeTree`
    * `Null`

    <br />

    파티셔닝 키 표현식과 프라이머리
    키 표현식을 지정할 수 있습니다.

    <Image img="https://mintcdn.com/private-7c7dfe99-detect-table-modification/I0yKDIFW2QfsHJIe/images/cloud/migrate/csv_07.webp?fit=max&auto=format&n=I0yKDIFW2QfsHJIe&q=85&s=59c50fd3731146138bc6e5b65b4e13bf" alt="upload_file_07" width="3004" height="1476" data-path="images/cloud/migrate/csv_07.webp" />

    데이터를 가져오려면 `Import to ClickHouse`(위 그림 참조)를 클릭합니다. 데이터 가져오기는
    아래와 같이 `Status` 컬럼의 `queued` 상태 배지로 표시되며 큐에 들어갑니다. 또한
    `Open as query`(위 그림 참조)를 클릭하여 SQL 콘솔에서 삽입 쿼리를 열 수도 있습니다. 이 쿼리는
    `URL` 테이블 함수를 사용하여 S3 버킷에 업로드된 파일의 데이터를 삽입합니다.

    <Image img="https://mintcdn.com/private-7c7dfe99-detect-table-modification/I0yKDIFW2QfsHJIe/images/cloud/migrate/csv_09.webp?fit=max&auto=format&n=I0yKDIFW2QfsHJIe&q=85&s=cefe5ef966512145b561ede5ff6db4e3" alt="upload_file_09" width="1271" height="487" data-path="images/cloud/migrate/csv_09.webp" />

    작업이 실패하면 `Data upload history` 탭의 `Status` 컬럼 아래에
    `failed` 상태 배지가 표시됩니다. `View Details`를 클릭하면
    업로드 실패 원인에 대한 자세한 정보를 확인할 수 있습니다. 실패한 삽입의 오류 메시지에 따라
    테이블 구성을 수정하거나 데이터를 정리해야 할 수 있습니다.

    <Image img="https://mintcdn.com/private-7c7dfe99-detect-table-modification/I0yKDIFW2QfsHJIe/images/cloud/migrate/csv_10.webp?fit=max&auto=format&n=I0yKDIFW2QfsHJIe&q=85&s=486221ac49f07bb4490975262dec1fb7" alt="upload_file_11" width="1260" height="262" data-path="images/cloud/migrate/csv_10.webp" />
  </Step>
</Steps>
