Skip to content

Commit eb9510b

Browse files
keydunovhassankhan
andauthored
docs: Update getting started guide (#6869)
* docs: Update getting started guide * Update docs/content/Getting-Started/Cloud/06-Query-from-React.mdx Co-authored-by: Hassan Khan <[email protected]> * Update docs/content/Getting-Started/Cloud/01-Overview.mdx Co-authored-by: Hassan Khan <[email protected]> * docs: minor fixes * Update docs/content/Getting-Started/Cloud/04-Create-data-model.mdx Co-authored-by: Hassan Khan <[email protected]> * Update docs/content/Getting-Started/Cloud/02-Load data.mdx Co-authored-by: Hassan Khan <[email protected]> * Update docs/content/Getting-Started/Cloud/05-Query-from-BI.mdx Co-authored-by: Hassan Khan <[email protected]> * Update docs/content/Getting-Started/Cloud/05-Query-from-BI.mdx Co-authored-by: Hassan Khan <[email protected]> * Update docs/content/Getting-Started/Cloud/06-Query-from-React.mdx Co-authored-by: Hassan Khan <[email protected]> * Update docs/content/Getting-Started/Cloud/03-Connect-to-Snowflake.mdx Co-authored-by: Hassan Khan <[email protected]> * Update docs/content/Getting-Started/Cloud/03-Connect-to-Snowflake.mdx Co-authored-by: Hassan Khan <[email protected]> * Update docs/content/Getting-Started/Cloud/03-Connect-to-Snowflake.mdx Co-authored-by: Hassan Khan <[email protected]> * Update docs/content/Getting-Started/Cloud/03-Connect-to-Snowflake.mdx Co-authored-by: Hassan Khan <[email protected]> * Update docs/content/Getting-Started/Cloud/04-Create-data-model.mdx Co-authored-by: Hassan Khan <[email protected]> * Update docs/content/Getting-Started/Cloud/04-Create-data-model.mdx Co-authored-by: Hassan Khan <[email protected]> * Update docs/content/Getting-Started/Cloud/04-Create-data-model.mdx Co-authored-by: Hassan Khan <[email protected]> * Update docs/content/Getting-Started/Cloud/04-Create-data-model.mdx Co-authored-by: Hassan Khan <[email protected]> * Update docs/content/Getting-Started/Cloud/04-Create-data-model.mdx Co-authored-by: Hassan Khan <[email protected]> * Update docs/content/Getting-Started/Cloud/04-Create-data-model.mdx Co-authored-by: Hassan Khan <[email protected]> * Update docs/content/Getting-Started/Cloud/05-Query-from-BI.mdx Co-authored-by: Hassan Khan <[email protected]> * Update docs/content/Getting-Started/Cloud/05-Query-from-BI.mdx Co-authored-by: Hassan Khan <[email protected]> * Update docs/content/Getting-Started/Cloud/05-Query-from-BI.mdx Co-authored-by: Hassan Khan <[email protected]> * Update docs/content/Getting-Started/Cloud/05-Query-from-BI.mdx Co-authored-by: Hassan Khan <[email protected]> * Update docs/content/Getting-Started/Cloud/06-Query-from-React.mdx Co-authored-by: Hassan Khan <[email protected]> * Update docs/content/Getting-Started/Cloud/06-Query-from-React.mdx Co-authored-by: Hassan Khan <[email protected]> * Update docs/content/Getting-Started/Cloud/06-Query-from-React.mdx Co-authored-by: Hassan Khan <[email protected]> * Update docs/content/Getting-Started/Cloud/06-Query-from-React.mdx Co-authored-by: Hassan Khan <[email protected]> * Update docs/content/Getting-Started/Cloud/06-Query-from-React.mdx Co-authored-by: Hassan Khan <[email protected]> * fix links * Update docs/content/Getting-Started/Cloud/06-Query-from-React.mdx Co-authored-by: Hassan Khan <[email protected]> --------- Co-authored-by: Hassan Khan <[email protected]>
1 parent 2cc97a1 commit eb9510b

File tree

10 files changed

+538
-325
lines changed

10 files changed

+538
-325
lines changed

docs/content/Getting-Started/Cloud/01-Overview.mdx

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,16 @@ subCategory: Cube Cloud
66
menuOrder: 2
77
---
88

9-
First, we'll create a new deployment, connect it to a database, and generate a
10-
data model from it. Then, we'll run queries using the Developer Playground and
11-
APIs. Finally, we'll add a pre-aggregation to optimize query latency down to
12-
milliseconds.
9+
This getting started guide will show you how to use Cube Cloud with Snowflake. You will learn how to:
1310

14-
This guide will walk you through the following tasks:
11+
- Load sample data into your Snowflake account
12+
- Connect Cube Cloud to Snowflake
13+
- Create your first Cube data model
14+
- Connect to a BI tool to explore this model
15+
- Create React application with Cube REST API
1516

16-
- [Create a new deployment](/getting-started/cloud/create-a-deployment)
17-
- [Generate a data model from a connected data source](/getting-started/cloud/generate-models)
18-
- [Run queries using the Developer Playground and APIs](/getting-started/cloud/query-data)
19-
- [Add a pre-aggregation to optimize query performance](/getting-started/cloud/add-a-pre-aggregation)
17+
## Prerequisites
2018

21-
If you'd prefer to run Cube locally, then you can refer to [Getting Started
22-
using Cube Core][ref-getting-started-core-overview] instead.
2319

24-
[ref-getting-started-core-overview]: /getting-started/core/overview
20+
- [Cube Cloud account](https://cubecloud.dev/auth/signup)
21+
- [Snowflake account](https://signup.snowflake.com/)

docs/content/Getting-Started/Cloud/02-Create-a-deployment.mdx

Lines changed: 0 additions & 113 deletions
This file was deleted.
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
---
2+
title: Load data
3+
permalink: /getting-started/cloud/load-data
4+
category: Getting Started
5+
subCategory: Cube Cloud
6+
menuOrder: 2.1
7+
---
8+
9+
The following steps will guide you through setting up a Snowflake account and uploading the demo dataset, which is stored as CSV files in a public S3 bucket.
10+
11+
First, let’s create a warehouse, database, and schema. Paste the following SQL into the Editor of the Snowflake worksheet and click Run.
12+
13+
```sql
14+
CREATE WAREHOUSE cube_demo_wh;
15+
CREATE DATABASE cube_demo;
16+
CREATE SCHEMA cube_demo.ecom;
17+
```
18+
19+
We’re going to create four tables in the `ecom` schema and seed them with data from S3.
20+
21+
First, let’s create `line_items` table. Delete the previous SQL in your Editor and then run the following command.
22+
23+
```sql
24+
CREATE TABLE cube_demo.ecom.line_items
25+
( id INTEGER,
26+
order_id INTEGER,
27+
product_id INTEGER,
28+
price INTEGER,
29+
created_at TIMESTAMP
30+
);
31+
```
32+
33+
Clear all the content in the Editor and run the following command to load data into the `line_items` table.
34+
35+
```
36+
COPY INTO cube_demo.ecom.line_items (id, order_id, product_id, price, created_at)
37+
FROM 's3://cube-tutorial/line_items.csv'
38+
FILE_FORMAT = (TYPE = 'CSV' FIELD_DELIMITER = ',' SKIP_HEADER = 1);
39+
```
40+
41+
Now, we’re going to repeat these steps for three other tables.
42+
43+
Run the following command to create the `orders` table.
44+
45+
```sql
46+
CREATE TABLE cube_demo.ecom.orders
47+
( id INTEGER,
48+
user_id INTEGER,
49+
status VARCHAR,
50+
completed_at TIMESTAMP,
51+
created_at TIMESTAMP
52+
);
53+
```
54+
55+
Run the following command to load data into the `orders` table from S3.
56+
57+
```sql
58+
COPY INTO cube_demo.ecom.orders (id, user_id, status, completed_at, created_at)
59+
FROM 's3://cube-tutorial/orders.csv'
60+
FILE_FORMAT = (TYPE = 'CSV' FIELD_DELIMITER = ',' SKIP_HEADER = 1);
61+
62+
```
63+
64+
Run the following command to create the `users` table.
65+
66+
```sql
67+
CREATE TABLE cube_demo.ecom.users
68+
( id INTEGER,
69+
user_id INTEGER,
70+
city VARCHAR,
71+
age INTEGER,
72+
gender VARCHAR,
73+
state VARCHAR,
74+
first_name VARCHAR,
75+
last_name VARCHAR,
76+
created_at TIMESTAMP
77+
);
78+
79+
```
80+
81+
Run the following command to load data into the `users` table.
82+
83+
```sql
84+
COPY INTO cube_demo.ecom.users (id, city, age, gender, state, first_name, last_name, created_at)
85+
FROM 's3://cube-tutorial/users.csv'
86+
FILE_FORMAT = (TYPE = 'CSV' FIELD_DELIMITER = ',' SKIP_HEADER = 1);
87+
88+
```
89+
90+
Run the following command to create the `products` table.
91+
92+
```sql
93+
CREATE TABLE cube_demo.ecom.products
94+
( id INTEGER,
95+
name VARCHAR,
96+
product_category VARCHAR,
97+
created_at TIMESTAMP
98+
);
99+
100+
```
101+
102+
Run the following command to load data into the `products` table.
103+
104+
```sql
105+
COPY INTO cube_demo.ecom.products (id, name, created_at, product_category)
106+
FROM 's3://cube-tutorial/products.csv'
107+
FILE_FORMAT = (TYPE = 'CSV' FIELD_DELIMITER = ',' SKIP_HEADER = 1);
108+
```
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
title: Connect to Snowflake
3+
permalink: /getting-started/cloud/connect-to-snowflake
4+
category: Getting Started
5+
subCategory: Cube Cloud
6+
menuOrder: 3
7+
---
8+
9+
In this section, we’ll create a Cube Cloud deployment and connect it to Snowflake.
10+
A deployment represents a data model, configuration, and managed infrastructure.
11+
12+
To continue with this guide, you'll need to have a Cube Cloud account. If you
13+
don't have one yet, [click here to sign up][cube-cloud-signup] for free.
14+
15+
First, [sign in to your Cube Cloud account][cube-cloud-signin]. Then,
16+
click&nbsp;<Btn>Create Deployment</Btn>:
17+
18+
Give the deployment a name, select the cloud provider and region of your choice,
19+
and click <Btn>Next</Btn>:
20+
21+
<Screenshot
22+
alt="Cube Cloud Create Deployment Screen"
23+
src="https://ucarecdn.com/2338323e-0db8-4224-8e7a-3b4daf9c60ec/"
24+
/>
25+
26+
<SuccessBox>
27+
28+
Microsoft Azure is available in Cube Cloud on
29+
[Premium](https://cube.dev/pricing) tier. [Contact us](https://cube.dev/contact)
30+
for details.
31+
32+
</SuccessBox>
33+
34+
## Set up a Cube project
35+
36+
Next, click <Btn>Create</Btn> to create a new project from scratch:
37+
38+
<Screenshot
39+
alt="Cube Cloud Upload Project Screen"
40+
src="https://ucarecdn.com/46b72b61-b650-4271-808d-55203f1c8d8b/"
41+
/>
42+
43+
## Connect to your Snowflake
44+
45+
The last step is to connect Cube Cloud to Snowflake. First, select it from the grid:
46+
47+
<Screenshot
48+
alt="Cube Cloud Setup Database Screen"
49+
src="https://ucarecdn.com/1d656ba9-dd83-4ff4-a59e-8b5f97a9ddcc/"
50+
/>
51+
52+
Then enter your Snowflake credentials:
53+
54+
- **Username:** Your Snowflake username. Please note, it is usually **not** your email address.
55+
- **Password:** Your Snowflake password.
56+
- **Database:** `CUBE_DEMO`, that is the database we've created in the previous step.
57+
- **Account:** Your snowflake account identifier. You can find it in your Snowflake URL as the `account_locator` part.
58+
- **Region:** Your Snowflake account region. You can find it in your Snowflake URL. If your URL includes a `cloud` part, use both the `cloud_region_id` and `cloud` together e.g. `us-east-2.aws`, otherwise just use `cloud_region_id`
59+
- **Warehouse:** `CUBE_DEMO_WH`, that is the warehouse we've created in the previous step.
60+
- **Role:** You can leave it blank.
61+
62+
Click <Btn>Apply</Btn>, Cube Cloud will test the connection and proceed to the next step.
63+
64+
## Generate data model from your Snowflake schema
65+
66+
Cube can now generate a basic data model from your data warehouse schema, which helps getting started with data modeling faster.
67+
Select all four tables in our `ECOM` schema and click through the data model generation wizard. We'll inspect these generated files in the next section and start making changes to them.
68+
69+
[aws-docs-sec-group]:
70+
https://docs.aws.amazon.com/vpc/latest/userguide/security-groups.html
71+
[aws-docs-sec-group-rule]:
72+
https://docs.aws.amazon.com/vpc/latest/userguide/security-group-rules.html
73+
[cube-cloud-signin]: https://cubecloud.dev/auth
74+
[cube-cloud-signup]: https://cubecloud.dev/auth/signup
75+
[ref-conf-db]: /config/databases
76+
[ref-getting-started-cloud-generate-models]:
77+
/getting-started/cloud/generate-models

0 commit comments

Comments
 (0)