This topic describes how to create an AnalyticDB for MySQL V3.0 result table in Realtime Compute.

Note
  • The storage registration feature is not supported.
  • This topic only applies to Blink 3.3.0 and later.
  • For more information about how to create an AnalyticDB for MySQL V2.0 result table, see Create an AnalyticDB for MySQL V2.0 result table.

DDL syntax

In Realtime Compute, you can use AnalyticDB for MySQL V3.0 to store output data. The sample code is as follows:
CREATE TABLE rds_output (
id INT,
len INT,
content VARCHAR,
PRIMARY KEY(id,len)
) WITH (
type='ADB30',
url='jdbc:mysql://<yourNetworkAddress>:<PortId>/<yourDatabaseName>',
tableName='<yourDatabaseTableName>',
userName='<yourDatabaseUserName>',
password='<yourDatabasePassword>'
);
Note Realtime Compute executes an SQL statement to write each row of output data to the result table in an AnalyticDB for MySQL 3.0 database.

Parameters in the WITH clause

Parameter Description Required Remarks
type The type of a connector. Yes Set the value to ADB30.
url The Java Database Connectivity (JDBC) URL of an AnalyticDB for MySQL database. Yes The URL of an AnalyticDB for MySQL database, for example, url='jdbc:mysql://databaseName****-cn-shenzhen-a.ads.aliyuncs.com:10014/databaseName'.
Note
  • For more information about how to connect to an AnalyticDB for MySQL database, see Query a URL in Register an AnalyticDB for MySQL instance.
  • The databaseName parameter indicates the AnalyticDB for MySQL database name, which is the name of an AnalyticDB for MySQL instance.
tableName The name of a table. Yes None.
username The username that is used to access a database. Yes None.
password The password that is used to access a database. Yes None.
maxRetryTimes The maximum number of retries for writing data into a table. No Default value: 3.
bufferSize The maximum number of data records that can be stored in the buffer before deduplication is triggered. No Default value: 1000. This value indicates that deduplication is triggered after the number of input data records reaches 1,000.
Note This parameter is valid only when you specify the primary key.
batchSize The number of data records that can be written at a time. No Default value: 1000.
Note This parameter is valid only when you specify the primary key.
flushIntervalMs The time interval at which the cache is cleared. No Default value: 3000. Unit: milliseconds. This value indicates that if the number of input data records does not reach the value specified by the batchSize parameter within 3,000 milliseconds, all cached data is written into the result table.
ignoreDelete Specifies whether to skip the delete operation. No Default value: false. This value indicates that the delete operation is supported.
reserveMilliSecond Specifies whether to reserve the millisecond component in a value of the TIMESTAMP type. No Default value: false. This value indicates that the millisecond component is not reserved.