Skip to content

Commit ca91e6e

Browse files
authored
Merge pull request #4014 from Blargian/update_csv_guide
Cloud: update csv file load page
2 parents 895d6eb + 51bd386 commit ca91e6e

File tree

20 files changed

+125
-46
lines changed

20 files changed

+125
-46
lines changed
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
---
2+
title: 'Uploading files'
3+
slug: /cloud/migrate/upload-a-csv-file
4+
description: 'Learn how to upload files to Cloud'
5+
---
6+
7+
import Image from '@theme/IdealImage';
8+
import csv_01 from '@site/static/images/cloud/migrate/csv_01.png';
9+
import csv_02 from '@site/static/images/cloud/migrate/csv_02.png';
10+
import csv_03 from '@site/static/images/cloud/migrate/csv_03.png';
11+
import csv_04 from '@site/static/images/cloud/migrate/csv_04.png';
12+
import csv_05 from '@site/static/images/cloud/migrate/csv_05.png';
13+
import csv_06 from '@site/static/images/cloud/migrate/csv_06.png';
14+
import csv_07 from '@site/static/images/cloud/migrate/csv_07.png';
15+
import csv_08 from '@site/static/images/cloud/migrate/csv_08.png';
16+
import csv_09 from '@site/static/images/cloud/migrate/csv_09.png';
17+
import csv_10 from '@site/static/images/cloud/migrate/csv_10.png';
18+
19+
# Upload files to Cloud
20+
21+
ClickHouse Cloud provides an easy way to import your files and supports the
22+
following formats:
23+
24+
| Format |
25+
|---------------------------------|
26+
| `CSV` |
27+
| `CSVWithNamesAndTypes` |
28+
| `CSVWithNames` |
29+
| `JSONEachRow` |
30+
| `TabSeparated` |
31+
| `TabSeparatedWithNames` |
32+
| `TabSeparatedWithNamesAndTypes` |
33+
34+
<VerticalStepper headerLevel="h2">
35+
36+
## Upload a file {#upload-file}
37+
38+
From the Cloud homepage, select your service as shown below:
39+
40+
<Image img={csv_01} alt="upload_file_02" />
41+
42+
If your service is idle you will need to wake it.
43+
44+
Select `Data sources` in the left hand tab as shown below:
45+
46+
<Image img={csv_02} alt="upload_file_03" />
47+
48+
Next select `Upload a file` on the right side of the data sources page:
49+
50+
<Image img={csv_03} alt="upload_file_04" />
51+
52+
A file dialogue will pop up allowing you to select the file that you wish to
53+
use to insert data into a table on your Cloud service.
54+
55+
<Image img={csv_04} alt="upload_file_05" />
56+
57+
## Configure table {#configure-table}
58+
59+
Once the file has uploaded you will be able to configure the table where you want
60+
to insert the data to. A preview of the table with the first three rows is shown.
61+
62+
<Image img={csv_08} alt="upload_file_08" />
63+
64+
You can now select a destination table. The options are:
65+
66+
- a new table
67+
- an existing table
68+
69+
<br/>
70+
You can specify which database you want to upload the data to, and in the case of
71+
a new table, the name of the table that will be created. You will also be able to select the sorting key:
72+
73+
<Image img={csv_05} alt="upload_file_05" />
74+
75+
Columns read from the file are shown as `Source field`s and for each field, you
76+
can change:
77+
- the inferred type
78+
- the default value
79+
- whether to make the column [Nullable](/sql-reference/data-types/nullable) or not
80+
81+
<Image img={csv_06} alt="upload_file_06" />
82+
83+
:::note Excluding fields
84+
You can also remove a field if you don't want to include it in the import
85+
:::
86+
87+
You can specify the type of table engine that you want to use:
88+
89+
- `MergeTree`
90+
- `ReplacingMergeTree`
91+
- `SummingMergeTree`
92+
- `Null`
93+
<br/>
94+
You can specify a partitioning key expression and primary
95+
key expression.
96+
97+
<Image img={csv_07} alt="upload_file_07" />
98+
99+
Click `Import to ClickHouse` (shown above) to import the data. The data import will be queued as
100+
indicated by the `queued` status badge in the `Status` column as shown below. You can also click
101+
`Open as query` (shown above) to open the insert query in the SQL console. The query will insert
102+
the file which was uploaded to an S3 bucket using the `URL` table function.
103+
104+
<Image img={csv_09} alt="upload_file_09" />
105+
106+
If the job fails you will see a `failed` status badge under the `Status` column of
107+
the `Data upload history` tab. You can click `View Details` for more information
108+
on why the upload failed. You may need to modify the table configuration or clean
109+
the data based on the error message for the failed insert.
110+
111+
<Image img={csv_10} alt="upload_file_11" />
112+
113+
</VerticalStepper>

docs/integrations/migration/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ slug: /integrations/migration
1010
This section of the docs explores how you can migrate from ClickHouse to ClickHouse Cloud.
1111
Take a look at the pages below for further information.
1212

13-
| Page | Description |
14-
|----------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|
13+
| Page | Description |
14+
|--------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|
1515
| [Overview](/integrations/migration/overview) | Provides an overview of the available ways to migrate from ClickHouse to ClickHouse Cloud |
1616
| [Migrating to ClickHouse using clickhouse-local](/cloud/migration/clickhouse-local) | Learn how to migrate to ClickHouse using clickhouse-local. | |
1717
| [ClickHouse to ClickHouse Cloud](/cloud/migration/clickhouse-to-cloud) | This guide will show how to migrate from a self-managed ClickHouse server to ClickHouse Cloud, and also how to migrate between ClickHouse Cloud services. |
1818
| [Using a 3rd-party ETL Tool](/cloud/migration/etl-tool-to-clickhouse) | Learn more about the popular ETL and ELT tools for moving data from an external data source into ClickHouse. |
1919
| [Object Storage to ClickHouse Cloud](/integrations/migration/object-storage-to-clickhouse) | Learn how to use various table functions to import data from Cloud Object Storage into ClickHouse Cloud. |
20-
| [Upload a CSV File](/integrations/migration/upload-a-csv-file) | Learn how to upload data to ClickHouse Cloud using a CSV or TSV file. |
20+
| [Upload a CSV File](/cloud/migrate/upload-a-csv-file) | Learn how to upload data to ClickHouse Cloud using a CSV or TSV file. |

docs/integrations/migration/upload-a-csv-file.md

Lines changed: 0 additions & 39 deletions
This file was deleted.

sidebars.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ const sidebars = {
480480
"integrations/migration/clickhouse-local-etl",
481481
"integrations/migration/etl-tool-to-clickhouse",
482482
"integrations/migration/object-storage-to-clickhouse",
483-
"integrations/migration/upload-a-csv-file",
483+
"cloud/migrate/upload-a-csv-file",
484484
],
485485
},
486486
],
204 KB
Loading
354 KB
Loading
235 KB
Loading
190 KB
Loading
354 KB
Loading
377 KB
Loading

0 commit comments

Comments
 (0)