yiguolei commented on code in PR #28141:
URL: https://github.com/apache/doris/pull/28141#discussion_r1418977668
##########
fe/fe-core/src/main/java/org/apache/doris/qe/VariableMgr.java:
##########
@@ -150,9 +150,24 @@ public static SessionVariable getDefaultSessionVariable() {
return defaultSessionVariable;
}
+ private static void checkFieldValue(String variableName, int minValue,
String value) throws DdlException {
+ int val = Integer.valueOf(value);
+ if (val < minValue) {
+ throw new DdlException(
+ variableName + " value should greater than or equal " +
String.valueOf(minValue)
+ + ", you set value is: " + value);
+ }
+ }
+
// Set value to a variable
private static boolean setValue(Object obj, Field field, String value)
throws DdlException {
VarAttr attr = field.getAnnotation(VarAttr.class);
+ if ("parallel_pipeline_task_num".equalsIgnoreCase(attr.name())) {
Review Comment:
It is not a good way to do this.
you could refer this code:
// The global max_execution_time value provides the default for the
session value for new connections.
// The session value applies to SELECT executions executed within the
session that include
// no MAX_EXECUTION_TIME(N) optimizer hint or for which N is 0.
// https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html
// So that it is == query timeout in doris
@VariableMgr.VarAttr(name = MAX_EXECUTION_TIME, fuzzy = true, setter =
"setMaxExecutionTimeMS")
public int maxExecutionTimeMS = -1;
every variable could have a specific setter attribute, then you could add
check in specific setter method.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]