platinumhamburg commented on code in PR #2279:
URL: https://github.com/apache/fluss/pull/2279#discussion_r2663287387
##########
fluss-flink/fluss-flink-common/src/test/java/org/apache/fluss/flink/procedure/FlinkProcedureITCase.java:
##########
@@ -428,7 +461,61 @@ void testSetClusterConfigValidation() throws Exception {
.await())
.rootCause()
.hasMessageContaining(
- "config_pairs must be set in pairs. Please specify a
valid configuration pairs.");
+ "config_pairs must be set in pairs. Please specify a
valid configuration pairs");
+
+ // Try to no parameters passed
+ assertThatThrownBy(
+ () ->
+ tEnv.executeSql(
+ String.format(
+ "Call
%s.sys.set_cluster_configs()",
+ CATALOG_NAME))
+ .await())
+ .rootCause()
+ .hasMessageContaining(
+ "config_pairs cannot be null or empty. Please specify
a valid configuration pairs");
+
+ // Try to mismatched key-value pairs in the input parameters.
+ assertThatThrownBy(
+ () ->
+ tEnv.executeSql(
+ String.format(
+ "Call
%s.sys.set_cluster_configs('%s', 'paimon')",
+ CATALOG_NAME,
+ ConfigOptions
+
.KV_SHARED_RATE_LIMITER_BYTES_PER_SEC
+ .key()))
+ .await())
+ .rootCause()
+ .hasMessageContaining(
+ "Could not parse value 'paimon' for key
'kv.rocksdb.shared-rate-limiter.bytes-per-sec'");
+ }
+
+ @Test
+ void testResetClusterConfigValidation() throws Exception {
+ // Try to reset an invalid config
+ assertThatThrownBy(
+ () ->
+ tEnv.executeSql(
+ String.format(
+ "Call
%s.sys.reset_cluster_configs('invalid.config.key')",
+ CATALOG_NAME))
+ .await())
+ .rootCause()
+ .hasMessageContaining(
+ "The config key invalid.config.key is not allowed to
be changed dynamically");
Review Comment:
An invalid (non-existent) key and a key that isn't allowed to be set
dynamically are two distinct error cases. The current error message can be
misleading. If we prefer not to complicate the validation logic, we could
instead use "or" in the error message to cover both scenarios explicitly.
--
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]