Parameter | Description | Required | Default value |
datasource | The name of the data source. It must be the same as the name of the added data source. You can add data sources by using the code editor. | Yes | No default value |
table | The name of the table from which you want to read data. Each synchronization task can be used to synchronize data to only one table. The following examples show the advanced usage of the table parameter. In the examples, the table parameter is used to specify a table range. Set the table parameter to 'table_[0-99]'. This value indicates that MariaDB Reader reads data from the tables 'table_0' to 'table_99' in sharded databases. Set the table parameter to '"table": ["table_00[0-9]", "table_0[10-99]", "table_[100-999]"]'. This value indicates that MariaDB Reader reads data from tables 'table_000' to 'table_999'. You can use this method only if the numerical suffixes of the names of your tables are of the same length.
Note MariaDB Reader reads data from the columns that are specified by the column parameter in the partitions that are specified by the table parameter. If a specified partition or column does not exist, the synchronization task fails. | Yes | No default value |
column | The names of the columns from which you want to read data. Specify the names in a JSON array. The default value is [ * ], which indicates all columns in the source table. You can select specific columns to read. The column order can be changed. This indicates that you can specify columns in an order different from the order specified by the schema of the source table. Constants are supported. The column names must be arranged in compliance with the SQL syntax supported by MariaDB, such as ["id","table","1","'mingya.wmy'","'null'","to_char(a+1)","2.3","true"]. id: a column name. table: the name of a column that contains reserved keywords. 1: an integer constant. 'mingya.wmy': a string constant, which is enclosed in single quotation marks ('). null:
" " indicates an empty string. null indicates a null value. 'null' indicates the string null. The column parameter must explicitly specify all the columns from which you want to read data. This parameter cannot be left empty.
| Yes | No default value |
splitPk | The field that is used for data sharding when MariaDB Reader reads data. If you configure this parameter, the source table is sharded based on the value of this parameter. Data Integration then runs parallel threads to read data. This way, data can be synchronized more efficiently. We recommend that you set the splitPk parameter to the name of the primary key column of the table. Data can be evenly distributed to different shards based on the primary key column, instead of being intensively distributed only to specific shards. The splitPk parameter supports sharding for data only of integer data types. If you set the splitPk parameter to a field of an unsupported data type, such as a string, floating point, or date data type, the setting of this parameter is ignored, and a single thread is used to read data. If the splitPk parameter is not provided or is left empty, a single thread is used to read data.
| No | No default value |
where | The WHERE clause. For example, you can set this parameter to gmt_create > $bizdate to read the data that is generated on the current day. You can use the WHERE clause to synchronize incremental data. If the where parameter is not provided or is left empty, MariaDB Reader reads all data. Do not set the where parameter to limit 10. This value does not conform to the constraints of MariaDB on the SQL WHERE clause.
| No | No default value |
querySql (advanced parameter, which is available only in the code editor) | The SQL statement that is used for refined data filtering. If you configure this parameter, MariaDB Reader ignores the settings of the table, column, and splitPk parameters and filters data based only on the value of this parameter. For example, if you want to join multiple tables for data synchronization, set this parameter to select a,b from table_a join table_b on table_a.id = table_b.id. The priority of the querySql parameter is higher than the priorities of the table, column, where, and splitPk parameters. If you configure the querySql parameter, MariaDB Reader ignores the settings of the table, column, where, and splitPk parameters. The system parses the information, such as the username and password, of the data source specified by the datasource parameter from the querySql parameter. Note The name of the querySql parameter is case-sensitive. For example, querysql does not take effect. | No | No default value |