You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/03/08 02:27:30 UTC

[GitHub] [incubator-doris] acelyc111 commented on a change in pull request #5436: [FEATURE]Check date type to avoid scan all partitions

acelyc111 commented on a change in pull request #5436:
URL: https://github.com/apache/incubator-doris/pull/5436#discussion_r589135143



##########
File path: fe/fe-core/src/main/java/org/apache/doris/analysis/DateLiteral.java
##########
@@ -253,6 +253,11 @@ public static DateLiteral createMinValue(Type type) throws AnalysisException {
     }
 
     private void init(String s, Type type) throws AnalysisException {
+        // if s contains micro seconds, split it and only maintain second part
+        // because BE only save a datetime with second part
+        if (s.length() > 19) {

Review comment:
       `19` is a magic number, how about define a member variable like `MAX_DATE_VALUE_LENGTH = new String("yyyy-MM-dd hh:mm:ss").length();` ?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org