imay commented on a change in pull request #1644: Refactor DateLiteral class in 
FE
URL: https://github.com/apache/incubator-doris/pull/1644#discussion_r317673067
 
 

 ##########
 File path: fe/src/main/java/org/apache/doris/rewrite/FEFunctions.java
 ##########
 @@ -56,8 +49,13 @@
      */
     @FEFunction(name = "timediff", argTypes = { "DATETIME", "DATETIME" }, 
returnType = "TIME")
     public static FloatLiteral timeDiff(LiteralExpr first, LiteralExpr second) 
throws AnalysisException {
-        long timediff = (getTime(first) - getTime(second)) / 1000;
-        return new FloatLiteral((double)timediff, Type.TIME);
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
 
 Review comment:
   why "yyyy-MM-dd" other than "yyyy-MM-dd hh:mm:ss"
   
   I think we can write a function getTime() for DateLiteral.

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to