littleeleventhwolf commented on a change in pull request #7183:
URL: https://github.com/apache/incubator-doris/pull/7183#discussion_r760247210



##########
File path: 
fe/fe-core/src/main/java/org/apache/doris/qe/cache/PartitionRange.java
##########
@@ -238,7 +238,11 @@ public long realValue() {
         }
 
         private Date getDateValue(LiteralExpr expr) {
-            value = expr.getLongValue() / 1000000;
+            if (expr.getType().equals(Type.DATE)) {
+                value = expr.getLongValue();
+            } else {
+                value = expr.getLongValue() / DateLiteral.BASIC_ZERO_TIME;

Review comment:
       In `PartitionRange` class, the first parameter `type` of init-method 
cannot represent the second parameter `expr`'s real type, as illustrated in 
following figure:
   
![image](https://user-images.githubusercontent.com/20592822/144253131-dc2acc21-55f7-4966-b613-9b26a87b42e8.png)
    
   So I reset to last commit, still handle the `expr`'s type with if-else 
statement, non-`DATE` type should divide `BASIC_ZERO_TIME`.
   
   What about your opinion?




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

Reply via email to