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

# Cloud에 파일 업로드

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

export const Image = ({img, alt, size}) => {
  return <Frame>
      <img src={img} alt={alt} />
    </Frame>;
};

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

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

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

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

    <Image img="https://mintcdn.com/private-7c7dfe99-home-button/q-fyjp7bh9TLY82A/images/cloud/migrate/csv_01.png?fit=max&auto=format&n=q-fyjp7bh9TLY82A&q=85&s=876c101d2a4ffec4d0f30bcc50b6b18d" alt="upload_file_02" width="3024" height="1483" data-path="images/cloud/migrate/csv_01.png" />

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

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

    <Image img="https://mintcdn.com/private-7c7dfe99-home-button/q-fyjp7bh9TLY82A/images/cloud/migrate/csv_02.png?fit=max&auto=format&n=q-fyjp7bh9TLY82A&q=85&s=eae61a72498dac03087820fcd7866993" alt="upload_file_03" width="3024" height="1483" data-path="images/cloud/migrate/csv_02.png" />

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

    <Image img="https://mintcdn.com/private-7c7dfe99-home-button/q-fyjp7bh9TLY82A/images/cloud/migrate/csv_03.png?fit=max&auto=format&n=q-fyjp7bh9TLY82A&q=85&s=408100744de84bcd3b4f8391a4a54aa2" alt="upload_file_04" width="3024" height="1483" data-path="images/cloud/migrate/csv_03.png" />

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

    <Image img="https://mintcdn.com/private-7c7dfe99-home-button/q-fyjp7bh9TLY82A/images/cloud/migrate/csv_04.png?fit=max&auto=format&n=q-fyjp7bh9TLY82A&q=85&s=622103a5187dd8c3729a90ceb85e4a22" alt="upload_file_05" width="1267" height="736" data-path="images/cloud/migrate/csv_04.png" />
  </Step>

  <Step>
    ## 테이블 구성

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

    <Image img="https://mintcdn.com/private-7c7dfe99-home-button/q-fyjp7bh9TLY82A/images/cloud/migrate/csv_08.png?fit=max&auto=format&n=q-fyjp7bh9TLY82A&q=85&s=cc1ba1bd8209db5bd4a25f974fac1c40" alt="upload_file_08" width="3018" height="1476" data-path="images/cloud/migrate/csv_08.png" />

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

    * 새 테이블
    * 기존 테이블

    <br />

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

    <Image img="https://mintcdn.com/private-7c7dfe99-home-button/q-fyjp7bh9TLY82A/images/cloud/migrate/csv_05.png?fit=max&auto=format&n=q-fyjp7bh9TLY82A&q=85&s=09c759f82ac150dee12226c61f9d45a1" alt="upload_file_05" width="3016" height="1474" data-path="images/cloud/migrate/csv_05.png" />

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

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

    <Image img="https://mintcdn.com/private-7c7dfe99-home-button/q-fyjp7bh9TLY82A/images/cloud/migrate/csv_06.png?fit=max&auto=format&n=q-fyjp7bh9TLY82A&q=85&s=2fd6a98d8e07c65848538ec4b9e16b29" alt="upload_file_06" width="3012" height="1476" data-path="images/cloud/migrate/csv_06.png" />

    <Info>
      **필드 제외**

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

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

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

    <br />

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

    <Image img="https://mintcdn.com/private-7c7dfe99-home-button/q-fyjp7bh9TLY82A/images/cloud/migrate/csv_07.png?fit=max&auto=format&n=q-fyjp7bh9TLY82A&q=85&s=42d42b33b5c6a4de019bef72b5878e96" alt="upload_file_07" width="3004" height="1476" data-path="images/cloud/migrate/csv_07.png" />

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

    <Image img="https://mintcdn.com/private-7c7dfe99-home-button/q-fyjp7bh9TLY82A/images/cloud/migrate/csv_09.png?fit=max&auto=format&n=q-fyjp7bh9TLY82A&q=85&s=97d94291457c576c6820c6181c43d1d5" alt="upload_file_09" width="1271" height="487" data-path="images/cloud/migrate/csv_09.png" />

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

    <Image img="https://mintcdn.com/private-7c7dfe99-home-button/q-fyjp7bh9TLY82A/images/cloud/migrate/csv_10.png?fit=max&auto=format&n=q-fyjp7bh9TLY82A&q=85&s=ca10845ec20085918db626ad44a1776d" alt="upload_file_11" width="1260" height="262" data-path="images/cloud/migrate/csv_10.png" />
  </Step>
</Steps>
