AnalyticDB for MySQL provides the wide table engine that is compatible with the capabilities of the open source columnar database ClickHouse. This topic describes the features of the wide table engine, how to enable the wide table engine feature, and how to use the wide table engine.
The wide table engine feature is in invitational preview. To enable the feature, submit a ticket.
What is the wide table engine?
The wide table engine is fully compatible with the capabilities and syntax of the open source columnar database ClickHouse and can handle large amounts of columnar data. The wide table engine is suitable for aggregate query and analysis scenarios in which tables contain a large number of fields.
The wide table engine provides the following features:
The wide table engine uses the resident computing resources of interactive resource groups to run SQL jobs.
The wide table engine provides a storage-compute decoupled architecture based on the ReplicatedMergeTree engine, disk cache, and Object Storage Service (OSS).
You can easily integrate and manage the wide table engine without the need to specify databases or replicas.
The wide table engine provides high availability and high-performance distributed queries.
For more information about ClickHouse, see What Is ClickHouse?
Prerequisites
Before you enable the wide table engine feature for an AnalyticDB for MySQL cluster, make sure that the following requirements are met:
The AnalyticDB for MySQL cluster is of Data Lakehouse Edition.
The minor version of the AnalyticDB for MySQL cluster is 3.2.1.0 or later.
NoteTo query the minor version of an AnalyticDB for MySQL Data Lakehouse Edition cluster, execute the
SELECT adb_version();
statement. To update the minor version of a cluster, contact technical support.The multi-cluster feature is disabled for interactive resource groups in the AnalyticDB for MySQL cluster.
NoteYou can find an interactive resource group on the Resource Groups tab of the Resource Management page and click Modify in the Actions column to check whether Enable Multi-cluster is turned off. If Enable Multi-cluster is turned off, the multi-cluster feature is disabled for the interactive resource group.
An interactive resource group that contains more than 0 AnalyticDB compute units (ACUs) of reserved computing resources exists in the AnalyticDB for MySQL cluster.
Usage notes
After you enable the wide table engine feature, the feature cannot be disabled.
When you enable the wide table engine feature, specific nodes restart. As a result, specific SQL statements fail. We recommend that you enable the wide table engine feature during off-peak hours.
After you enable the wide table engine feature, you cannot create a resource group for which the multi-cluster feature is enabled or scale down the reserved computing resources to 0 ACUs.
You cannot back up or restore the data stored by the wide table engine.
Before you use the wide table engine, you must create an account for the wide table engine. Wide table engine accounts and database accounts of an AnalyticDB for MySQL cluster belong to different account systems. You cannot use a wide table engine account to access tables in the AnalyticDB for MySQL cluster, or use a database account of the cluster to access the wide table engine.
Billing rules
After you enable the wide table engine feature, the disk cache automatically becomes available, and you are charged a disk cache fee. For more information, see Pricing for Data Lakehouse Edition.
When you use the wide table engine, you are charged a data storage fee based on the unit price of the cold data storage of AnalyticDB for MySQL Data Lakehouse Edition clusters. For more information, see Pricing for Data Lakehouse Edition.
Enable the wide table engine feature
Log on to the AnalyticDB for MySQL console. In the upper-left corner of the console, select a region. In the left-side navigation pane, click Clusters. On the Clusters page, click an edition tab. Find the cluster that you want to manage and click the cluster ID.
In the left-side navigation pane, choose
.On the Configuration Information tab, turn on Enable Wide Table Engine. After you enable the wide table engine feature, the disk cache automatically becomes available.
(Optional) Adjust the slider or click the plus sign to increase the value of the Disk Cache Settings parameter.
Create a wide table engine account
The wide table engine of AnalyticDB for MySQL supports privileged accounts and standard accounts. The following section describes the differences between privileged accounts and standard accounts and how to create the accounts.
Log on to the AnalyticDB for MySQL console. In the upper-left corner of the console, select a region. In the left-side navigation pane, click Clusters. On the Clusters page, click an edition tab. Find the cluster that you want to manage and click the cluster ID.
In the left-side navigation pane, choose
.Click the Accounts tab. On the Accounts tab, click Create Account.
In the Create Account panel, create a privileged account or a standard account.
Parameter
Description
Database Account
The name of the wide table engine account. Enter a name that meets the on-screen requirements.
Account Type
Select Privileged Account or Standard Account.
New Password
The password of the wide table engine account. Enter a password that meets the on-screen requirements.
Confirm Password
Enter the password again.
Description (Optional)
The description of the wide table engine account, which facilitates subsequent account management.
Connect to and use the wide table engine
AnalyticDB for MySQL Data Lakehouse Edition allows you to connect to the wide table engine in an internal or public environment by using the HTTP, HTTPS, TCP, or MySQL protocol. In this example, a MySQL client is used to connect to the wide table engine.
Step 1: Connect to the wide table engine
Connect to the wide table engine over an internal network
Connect to the wide table engine over the Internet
Connect to the wide table engine over an SSL connection
Step 2: Use the wide table engine
Create a database named
adb_demo
.CREATE DATABASE adb_demo ON CLUSTER default [ENGINE = Replicated];
NoteWhen you create a database, you must include the
ON CLUSTER
clause and specify the default parameter. This way, the database is automatically created on each node.When you create a database, you must set the ENGINE parameter to
Replicated
. You cannot specify thezoo_path
,shard_name
, orreplica_name
parameter after theENGINE
parameter. If you do not specify the ENGINE parameter, the Replicated engine is automatically used.For information about how to create a database, see CREATE DATABASE.
Create a table named
test
.CREATE TABLE test ( id Int, name String, age Int, likes String, PRIMARY KEY(id) ) ENGINE = ReplicatedMergeTree;
NoteWhen you create a table, you must set the ENGINE parameter to
ReplicatedMergeTree
. You cannot specify thezoo_path
,shard_name
, orreplica_name
parameter after theENGINE
parameter. The system automatically adds the required parameters.For information about how to create a table, see CREATE TABLE.
Insert data into the
test
table.INSERT INTO test(id,name,age,likes)VALUES('1','Lili','10','Football'); INSERT INTO test(id,name,age,likes)VALUES('2','Tom','15','Basketball'); INSERT INTO test(id,name,age,likes)VALUES('3','Jack','20','Volleyball'); INSERT INTO test(id,name,age,likes)VALUES('4','Lucy','25','Badminton');
Query data from the test table.
SELECT * FROM test;
The following information is returned:
+-----------+-----------+-----------+-----------+ | id | name | age | likes | +-----------+-----------+-----------+-----------+ | 1 | Lili | 10 | Football | +-----------+-----------+-----------+-----------+ | 2 | Tom | 15 | Basketball | +-----------+-----------+-----------+-----------+ | 3 | Jack | 20 | Volleyball | +-----------+-----------+-----------+-----------+ | 4 | Lucy | 25 | Badminton | +-----------+-----------+-----------+-----------+