This is an automated email from the ASF dual-hosted git repository.

morrysnow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 9aa9894b111 [fix](Nereids) create table default value error msg is 
diff with lagacy planner (#25897)
9aa9894b111 is described below

commit 9aa9894b1110bb9c2513c2a2170388269b476f1c
Author: morrySnow <[email protected]>
AuthorDate: Thu Oct 26 11:36:14 2023 +0800

    [fix](Nereids) create table default value error msg is diff with lagacy 
planner (#25897)
    
    old error msg:
    default value precision: 2023-10-25 14:45:30.292 can not be greater than 
type precision: DATETIME(1)
    
    new error msg:
    default value precision: CURRENT_TIMESTAMP(3) can not be greater than type 
precision: DATETIME(1)
---
 .../trees/plans/commands/info/DefaultValue.java    | 27 ----------------------
 1 file changed, 27 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/DefaultValue.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/DefaultValue.java
index cd8ddb0f329..40c2b5ed85a 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/DefaultValue.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/DefaultValue.java
@@ -19,10 +19,6 @@ package org.apache.doris.nereids.trees.plans.commands.info;
 
 import org.apache.doris.analysis.DefaultValueExprDef;
 import org.apache.doris.catalog.ScalarType;
-import org.apache.doris.common.util.TimeUtils;
-
-import java.time.LocalDateTime;
-import java.time.format.DateTimeFormatter;
 
 /**
  * default value of a column.
@@ -106,29 +102,6 @@ public class DefaultValue {
      * get string value of a default value expression.
      */
     public String getValue() {
-        if (isCurrentTimeStamp()) {
-            return 
LocalDateTime.now(TimeUtils.getTimeZone().toZoneId()).toString().replace('T', ' 
');
-        } else if (isCurrentTimeStampWithPrecision()) {
-            long precision = getCurrentTimeStampPrecision();
-            String format = "yyyy-MM-dd HH:mm:ss";
-            if (precision == 0) {
-                return 
LocalDateTime.now(TimeUtils.getTimeZone().toZoneId()).toString().replace('T', ' 
');
-            } else if (precision == 1) {
-                format = "yyyy-MM-dd HH:mm:ss.S";
-            } else if (precision == 2) {
-                format = "yyyy-MM-dd HH:mm:ss.SS";
-            } else if (precision == 3) {
-                format = "yyyy-MM-dd HH:mm:ss.SSS";
-            } else if (precision == 4) {
-                format = "yyyy-MM-dd HH:mm:ss.SSSS";
-            } else if (precision == 5) {
-                format = "yyyy-MM-dd HH:mm:ss.SSSSS";
-            } else if (precision == 6) {
-                format = "yyyy-MM-dd HH:mm:ss.SSSSSS";
-            }
-            return LocalDateTime.now(TimeUtils.getTimeZone().toZoneId())
-                    .format(DateTimeFormatter.ofPattern(format));
-        }
         return value;
     }
 


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

Reply via email to