Usage notes

Updated at:

An OLAP resource group separates compute from storage and directly accesses three internal data sources: lake-mode columnar data, warehouse-mode columnar data, and the wide table engine. Use catalogs to switch between data sources.

Run the following SQL statements to switch between data sources:

  • Switch to the wide table data source: SET CATALOG lindorm_table;.

  • Switch to the lake-mode columnar data source: SET CATALOG lindorm_columnar;.

  • Switch to the warehouse-mode columnar data source: SET CATALOG default_catalog;.

To verify the current catalog, run SELECT catalog();. The available catalogs are lindorm_table, lindorm_columnar, and default_catalog.

Wide table data

Lindorm Wide Table is a distributed storage system for massive structured and semi-structured data, compatible with HBase, Phoenix (SQL), and Cassandra. It supports up to 100 trillion rows per table, tens of millions of concurrent requests with millisecond-level latency, and strong consistency for cross-data-center disaster recovery. Typical use cases include metadata management, order and billing systems, user profiling, social graphs, and log analytics.

An OLAP resource group connects to the wide table engine and uses dedicated compute resources and enhanced query capabilities to run real-time analytics on wide table data.

Run SET CATALOG lindorm_table; to connect to the wide table engine and view its databases and tables:

-- Connect to the wide table engine
SET CATALOG lindorm_table;

-- List all databases
SHOW DATABASES;

-- Use a database
USE db01;

-- List all tables
SHOW TABLES;

-- Query a table
SELECT * FROM tb01 LIMIT 5;
Important

The wide table data source has the following limitations:

  • You cannot create or delete databases.

  • You cannot create or delete tables, or perform DDL operations such as adding or dropping columns.

  • You cannot insert or delete rows by using DML operations such as INSERT INTO and DELETE FROM.

For more information, see Untitled.

Lake-mode columnar data

Lake-mode columnar data is compatible with open-source Iceberg and stored in the underlying file system of a Lindorm instance. Within the same instance, the OLAP resource group and the ETL resource group share the same lake-mode columnar data.

By default, an OLAP resource group connects to lake-mode columnar data. If you switched to another data source, run SET CATALOG lindorm_columnar; to switch back.

You can create databases and tables and write data to this data source:

SET CATALOG lindorm_columnar;

-- Create a database
CREATE DATABASE db01;

-- Use a database
USE db01;

-- Create a table
CREATE TABLE test (id INT, name STRING) ENGINE = iceberg;

-- Insert data
INSERT INTO test VALUES (0, 'Jay'), (1, 'Edison');

-- Insert the query result into the table
INSERT INTO test SELECT * FROM test;

-- Drop the table
DROP TABLE test;

-- Drop the database
DROP DATABASE db01;
Important

The OLAP resource group does not support the CREATE TABLE AS SELECT and DELETE FROM statements.

Warehouse-mode columnar data

Run SET CATALOG default_catalog; to switch to warehouse-mode columnar data:

-- Switch the catalog
SET CATALOG default_catalog;

-- Create a database
CREATE DATABASE db01;

-- Use a database
USE db01;

-- Create a table
CREATE TABLE test (id INT, name STRING);

-- Insert data
INSERT INTO test VALUES (0, 'Jay'), (1, 'Edison');

-- Insert the query result into the table
INSERT INTO test SELECT * FROM test;

-- Drop the table
DROP TABLE test;

-- Drop the database
DROP DATABASE db01;

For more information, see Warehouse Mode Columnar Table.