Quick start

Sign up

Visit the official website.

On the free trial page, sign up for a new account by filling in your basic information, then choose your Cloud Provider and Region.

Note: Cloud provider and Region CANNOT be changed after successful registration.

1190

After registration is complete, you will receive an email to activate your ByteHouse account.

ByteHouse will generate a login URL in this email for account password initialisation. Click the login link and set/confirm password, then you will be automatically logged into the ByteHouse console.

1359

Getting started

In this tutorial, we'll perform a basic data analysis operation including database/table creation, data loading, and SQL query.

We'll also go through all the key functionalities and modules to gain a basic understanding of ByteHouse.

Step 1. Log into ByteHouse

Enter your Account Name, Region, Username and Password on the ByteHouse login page.

2722

Step 2. Create objects in ByteHouse

Note: Before proceeding, check that the AccountAdmin role is selected by clicking the avatar icon.

1034

A database and a table are required before you can load data. In addition, loading and querying data requires a virtual warehouse, which provides the necessary compute resources to perform these tasks.

  • Create a virtual warehouse

On the Virtual Warehouses page, choose [New] to create a new virtual warehouse, with the name and size as shown, then choose [OK] to finish creation.

1280
  • Create a database

On the Databases page, choose [New Database] to create a bh_test_${yourname} database using the web UI, then choose [Create].

1034

Alternatively, you can use CREATE DATABASE command in the SQL worksheet to create a database. Choose a running virtual warehouse before executing the following SQL query statement.

create database bh_demo;
2880
  • Create a table

On the SQL Worksheet page, create a table named employment in bh_demo using the CREATE TABLE command.

CREATE TABLE bh_demo.employment (
 
  `first_name` Nullable(String),
  
  `last_name` String,
  
  `email` String,
  
  `address` String,
  
  `city` String,
  
  `start_date` String   -- currently the 'date' format has some restrictions

) ENGINE = CnchMergeTree()

ORDER BY `city`;

After creation, you can see the details of the table in the database module.

2880

Note: The number of columns in the table and their data types correspond to the fields in the sample CSV data files that you will be loading in the next step.

Alternatively, you can choose the [Table] button to create the table directly via web UI on the Databases page:

2880

Step 3. Load data into the target table

Ad hoc job

Download employees.csv. On the Data Loading page, choose [New Loading Job].

First, input the job name as bh_demo_adhoc (Note: no space is allowed and no duplicates of Job Names).

Next, choose Type: [file], and upload or drag your local file into the file upload box. Select Has header: [Yes] option.

2880

After selecting the target database and table, choose [Re-Parser] to map the Source Column Name with the Source Schema.

Note: The Column Name and Type should match with the Target Table created in Step 2.

2880

Select Loading Type: [Full Data Replacement] and complete the job creation by choosing [Create].

2880

You will be redirected to the Data Loading page where you can see the running status.

After the status is updated to success, you can check the data loading result on the table detail page.

Connect new data source

You could also load data by connecting data sources. Go to Select Data Source section and choose the type of data source you'd like to use. You can choose [Connect a new datasource] to enter the data source. For more details, please refer to Data Import.

2148

Step 4. Query the loaded data

On the SQL Worksheet page, run the following SQL statements to query the loaded data.

Ensure you've selected a running virtual warehouse before executing the SQL statement.

  • Query all data
select * from bh_demo.employment
2880
  • Insert additional rows of data
insert into bh_demo.employment values
  ('Clementine','Adamou','[email protected]','10510 Sachs Road','Klenak','2017-9-22') ,
  ('Marlowe','De Anesy','[email protected]','36768 Northfield Plaza','Fangshan','2017-1-26');
  • Query rows based on email addresses
select email from bh_demo.employment where email like '%.uk';
2880