Skip to main content

Quick Start

This topic demonstrates how to quickly get started with managing and querying data in Relyt AI-ready Data Cloud.

Create an account

Relyt operates on an invitation-based registration mechanism. One can create an account only after being invited.

info
  • The term "account" here includes sub-accounts and DW users. To create a sub-account, you can contact the owner of the main account to invite you. To create a DW user within a DW service unit, you can contact the owner of any cloud account that can access the DW service unit to invite you. For more information, see Cloud Accounts and DW Users.

  • Each organization has only one main account, created along with the organization's data cloud and does not require an invitation.

Create a DW service unit

Only cloud accounts with the SYSTEMADMIN role can create DW service units. The specific steps are as follows:

  1. Sign in to the Relyt global console.

    If you use the main account, switch the system role to SYSTEMADMIN. For details about how to switch the role, see section "Switch the role of your cloud account" in Manage Cloud Accounts.

  2. In the top navigation bar, select DW Service Units.

  3. On the DW Service Units page, click + Service Unit in the upper-right corner.

  4. On the Create Service Unit page, complete the relevant configurations.

    For more configuration details, see section "Create a DW service unit" in Manage DW Service Units.

Connect to Relyt

By using the console

Log in to the Relyt global console using your cloud account, click the information card of the target DW service unit to connect to the service unit, or sign in directly to the DW service unit.

By using other clients

For detailed instructions, see the related topic in Ecosystem Integration.

Create a database and a table

The following provides a demo. This demo creates a database named my_relytdb, a table named my_relyt_table, and performs some simple operations.

info

If you perform operations on the console, sign in to the DW service unit console, select Workbooks on the left navigation bar, and then create a new workbook or edit the target workbook.

-- Create a database
CREATE DATABASE my_relytdb;

-- View the current date and time
SELECT current_date;
SELECT localtimestamp;
SELECT current_timestamp;

-- If a table named my_relyt_table already exists in the database, drop that table
DROP TABLE IF EXISTS "my_relyt_table";

-- Create a table named my_relyt_table
CREATE TABLE IF NOT EXISTS "my_relyt_table" (
c1 bigint,
c2 boolean,
c3 date,
c4 decimal(38, 1),
c5 double precision,
c6 integer,
c7 real,
c8 smallint,
c9 text,
c10 timestamp,
c11 timestamp with time zone,
c12 varchar
);

-- Insert data into the my_relyt_table table
INSERT INTO "my_relyt_table" VALUES
(1, true, current_date, 1.0, 1.0, 1, 1.0, 1, '1', localtimestamp, current_timestamp, '1'),
(2, false, current_date, 2.0, 2.0, 2, 2.0, 2, '2', localtimestamp, current_timestamp, '2'),
(3, false, current_date, 3.0, 3.0, 3, 3.0, 3, '3', localtimestamp, current_timestamp, '3'),
(4, false, current_date, 4.0, 4.0, 4, 4.0, 4, '4', localtimestamp, current_timestamp, '4'),
(5, false, current_date, 5.0, 5.0, 5, 5.0, 5, '5', localtimestamp, current_timestamp, '5');

Query data

-- Query data from the table
SELECT * FROM "my_relyt_table";

-- Update data in the table
UPDATE "my_relyt_table" SET c2 = true WHERE c1 > 0;

-- Query data from the table again to check if the data was updated successfully
SELECT * FROM "my_relyt_table";

-- Delete some records from the table
DELETE FROM "my_relyt_table" WHERE c1 > 3;

-- Query data from the table again to check if the records were deleted successfully
SELECT * FROM "my_relyt_table";

Import data

The following demo uses Amazon S3 as an example to demonstrate the process of importing data from an external data source into Relyt. For instructions on how to import data from external data sources, see the corresponding topic in Ecosystem Integration.

-- Create an external table named lineitem_ext with data source as s3
CREATE EXTERNAL TABLE lineitem_ext (
l_orderkey INTEGER,
l_partkey INTEGER,
l_suppkey INTEGER,
l_linenumber INTEGER,
l_quantity DECIMAL(15, 2),
l_extendedprice DECIMAL(15, 2),
l_discount DECIMAL(15, 2),
l_tax DECIMAL(15, 2),
l_returnflag VARCHAR,
l_linestatus VARCHAR,
l_shipdate DATE,
l_commitdate DATE,
l_receiptdate DATE,
l_shipinstruct VARCHAR,
l_shipmode VARCHAR,
l_comment VARCHAR,
l_dummy VARCHAR
)
LOCATION('s3://s3.ap-southeast-1.amazonaws.com/sample_data/tpch/100m/lineitem.tbl
accessid=<your_aws_access_id>
secret=<your_aws_access_secret>')
FORMAT 'csv' (delimiter '|');

-- On the Relyt side, create the corresponding table named lineitem
CREATE TABLE lineitem (
l_orderkey INTEGER,
l_partkey INTEGER,
l_suppkey INTEGER,
l_linenumber INTEGER,
l_quantity DECIMAL(15, 2),
l_extendedprice DECIMAL(15,