peilinqian commented on issue #19137:
URL:
https://github.com/apache/shardingsphere/issues/19137#issuecomment-1191391614
Passed
order_db=> CREATE TRAFFIC RULE sql_hint_traffic_2(LABELS(OLAP,
order_by),TRAFFIC_ALGORITHM(TYPE(NAME= SQL_HINT)));
ERROR: Traffic load balance algorithm can not be null.
order_db=> show traffic rules from traffic_db;
name | labels | algorithm_type |
algorithm_props
| load_balancer_type | load_balancer_props
-------------------+---------------------+----------------+-----------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------+--------------------+---------------------
sql_match_traffic | sharding1,sharding2 | SQL_MATCH | sql=SELECT
i_price, i_name, i_data FROM bmsql_item WHERE i_id = ?;SELECT d_tax,
d_next_o_id FROM bmsql_district WHERE d_w_id =
? AND d_id = ? FOR UPDATE | ROUND_ROBIN |
sql_regex_traffic | sharding2 | SQL_REGEX |
regex=(?i)^(UPDATE|delete).*WHERE .*;
| ROUND_ROBIN |
(2 rows)
order_db=>
order_db=> CREATE TRAFFIC RULE sql_hint_traffic_2(LABELS(OLAP,
order_by),TRAFFIC_ALGORITHM(TYPE(NAME=
SQL_HINT)),LOAD_BALANCER(TYPE(NAME=ROUND_ROBIN)));
SUCCESS
order_db=> show traffic rules from traffic_db;
name | labels | algorithm_type |
algorithm_props
| load_balancer_type | load_balancer_props
--------------------+---------------------+----------------+----------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------+--------------------+---------------------
sql_match_traffic | sharding1,sharding2 | SQL_MATCH | sql=SELECT
i_price, i_name, i_data FROM bmsql_item WHERE i_id = ?;SELECT d_tax,
d_next_o_id FROM bmsql_district WHERE d_w_id
= ? AND d_id = ? FOR UPDATE | ROUND_ROBIN |
sql_regex_traffic | sharding2 | SQL_REGEX |
regex=(?i)^(UPDATE|delete).*WHERE .*;
| ROUND_ROBIN |
sql_hint_traffic_2 | OLAP,order_by | SQL_HINT |
| ROUND_ROBIN |
(3 rows)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]