xuzifu666 commented on code in PR #4306:
URL: https://github.com/apache/calcite/pull/4306#discussion_r2046231780
##########
core/src/main/java/org/apache/calcite/sql/dialect/MysqlSqlDialect.java:
##########
@@ -366,17 +369,39 @@ private static void unparseFloor(SqlWriter writer,
SqlCall call) {
case SECOND:
format = "%Y-%m-%d %H:%i:%s";
break;
+ case MILLISECOND:
+ needSubStr = true;
+ format = "%Y-%m-%d %H:%i:%s.%f";
+ substringLength = 23;
Review Comment:
Yes,I agree,they are equivalent. I had referred to the relevant MySQL
documents about date and format usage, seems current version maybe a suitable
way to archive it. Some senior MySQL users also use this way to get
millisecond/microsecond from timestamp. If can offer some more suggestions, I
would do more research about it. @mihaibudiu
--
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]