diff --git a/docs/en/connector-v2/source/StarRocks.md b/docs/en/connector-v2/source/StarRocks.md index df814105aa5..fba0c707938 100644 --- a/docs/en/connector-v2/source/StarRocks.md +++ b/docs/en/connector-v2/source/StarRocks.md @@ -26,6 +26,7 @@ delivers the query plan as a parameter to BE nodes, and then obtains data result | password | string | yes | - | | database | string | yes | - | | table | string | yes | - | +| table_list | array | yes | - | | scan_filter | string | no | - | | schema | config | yes | - | | request_tablet_size | int | no | Integer.MAX_VALUE | @@ -57,6 +58,10 @@ The name of StarRocks database The name of StarRocks table +### table_list [array] + +The list of tables to be read, you can use this configuration instead of `table` + ### scan_filter [string] Filter expression of the query, which is transparently transmitted to StarRocks. StarRocks uses this expression to complete source-side data filtering. @@ -153,21 +158,23 @@ source { table = "e2e_table_source" scan_batch_rows = 10 max_retries = 3 - fields { - BIGINT_COL = BIGINT - LARGEINT_COL = STRING - SMALLINT_COL = SMALLINT - TINYINT_COL = TINYINT - BOOLEAN_COL = BOOLEAN - DECIMAL_COL = "DECIMAL(20, 1)" - DOUBLE_COL = DOUBLE - FLOAT_COL = FLOAT - INT_COL = INT - CHAR_COL = STRING - VARCHAR_11_COL = STRING - STRING_COL = STRING - DATETIME_COL = TIMESTAMP - DATE_COL = DATE + schema = { + fields { + BIGINT_COL = BIGINT + LARGEINT_COL = STRING + SMALLINT_COL = SMALLINT + TINYINT_COL = TINYINT + BOOLEAN_COL = BOOLEAN + DECIMAL_COL = "DECIMAL(20, 1)" + DOUBLE_COL = DOUBLE + FLOAT_COL = FLOAT + INT_COL = INT + CHAR_COL = STRING + VARCHAR_11_COL = STRING + STRING_COL = STRING + DATETIME_COL = TIMESTAMP + DATE_COL = DATE + } } scan.params.scanner_thread_pool_thread_num = "3" @@ -175,6 +182,67 @@ source { } ``` +## Example 2: Multiple tables + +``` +source { + StarRocks { + nodeUrls = ["starrocks_e2e:8030"] + username = root + password = "" + database = "test" + table_list = [ + { + table = "e2e_table_source" + schema = { + fields { + BIGINT_COL = BIGINT + LARGEINT_COL = STRING + SMALLINT_COL = SMALLINT + TINYINT_COL = TINYINT + BOOLEAN_COL = BOOLEAN + DECIMAL_COL = "DECIMAL(20, 1)" + DOUBLE_COL = DOUBLE + FLOAT_COL = FLOAT + INT_COL = INT + CHAR_COL = STRING + VARCHAR_11_COL = STRING + STRING_COL = STRING + DATETIME_COL = TIMESTAMP + DATE_COL = DATE + } + } + }, + { + table = "e2e_table_source_2" + schema = { + fields { + BIGINT_COL_2 = BIGINT + LARGEINT_COL_2 = STRING + SMALLINT_COL_2 = SMALLINT + TINYINT_COL_2 = TINYINT + BOOLEAN_COL_2 = BOOLEAN + DECIMAL_COL_2 = "DECIMAL(20, 1)" + DOUBLE_COL_2 = DOUBLE + FLOAT_COL_2 = FLOAT + INT_COL_2 = INT + CHAR_COL_2 = STRING + VARCHAR_11_COL_2 = STRING + STRING_COL_2 = STRING + DATETIME_COL_2 = TIMESTAMP + DATE_COL_2 = DATE + } + } + }] + scan_batch_rows = 10 + max_retries = 3 + scan.params.scanner_thread_pool_thread_num = "3" + + } +} + +``` + ## Changelog ### next version diff --git a/seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/client/StarRocksStreamLoadVisitor.java b/seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/client/StarRocksStreamLoadVisitor.java index d004213b7a8..fc66a36f264 100644 --- a/seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/client/StarRocksStreamLoadVisitor.java +++ b/seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/client/StarRocksStreamLoadVisitor.java @@ -17,6 +17,7 @@ package org.apache.seatunnel.connectors.seatunnel.starrocks.client; +import org.apache.seatunnel.common.exception.CommonErrorCode; import org.apache.seatunnel.common.exception.CommonErrorCodeDeprecated; import org.apache.seatunnel.common.utils.JsonUtils; import org.apache.seatunnel.connectors.seatunnel.starrocks.config.SinkConfig; @@ -68,7 +69,7 @@ public Boolean doStreamLoad(StarRocksFlushTuple flushData) throws IOException { String host = getAvailableHost(); if (null == host) { throw new StarRocksConnectorException( - CommonErrorCodeDeprecated.ILLEGAL_ARGUMENT, + CommonErrorCode.ILLEGAL_ARGUMENT, "None of the host in `load_url` could be connected."); } String loadUrl =