This is an automated email from the ASF dual-hosted git repository.
englefly pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new c3d642517ef [fix](optimizer) Add check time method #25538
c3d642517ef is described below
commit c3d642517efc847db05682a9a722f179294c15d4
Author: AKIRA <[email protected]>
AuthorDate: Wed Oct 18 11:07:28 2023 +0800
[fix](optimizer) Add check time method #25538
Co-authored-by: AKIHA <[email protected]>
---
.../src/main/java/org/apache/doris/qe/SessionVariable.java | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
index 4e7a4893b67..f01e67a5107 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
@@ -48,6 +48,8 @@ import java.io.DataOutput;
import java.io.IOException;
import java.io.Serializable;
import java.lang.reflect.Field;
+import java.time.format.DateTimeFormatter;
+import java.time.format.DateTimeParseException;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
@@ -2577,5 +2579,15 @@ public class SessionVariable implements Serializable,
Writable {
}
return connectContext.getSessionVariable().enableAggState;
}
+
+ public void checkAnalyzeTimeFormat(String time) {
+ try {
+ DateTimeFormatter timeFormatter =
DateTimeFormatter.ofPattern("HH:mm:ss");
+ timeFormatter.parse(time);
+ } catch (DateTimeParseException e) {
+ LOG.warn("Parse analyze start/end time format fail", e);
+ throw new UnsupportedOperationException("Expect format: HH:mm:ss");
+ }
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]