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 2022/06/06 12:10:43 UTC

[GitHub] [incubator-doris] yiguolei commented on a diff in pull request #9972: [feature] datetime column type support auto-initialized with default …

yiguolei commented on code in PR #9972:
URL: https://github.com/apache/incubator-doris/pull/9972#discussion_r890086208


##########
fe/fe-core/src/main/java/org/apache/doris/analysis/ColumnDef.java:
##########
@@ -315,8 +335,12 @@ public static void validateDefaultValue(Type type, String defaultValue) throws A
                 decimalLiteral.checkPrecisionAndScale(scalarType.getScalarPrecision(), scalarType.getScalarScale());
                 break;
             case DATE:
+                DateLiteral dateLiteral = new DateLiteral(defaultValue, type);
+                break;
             case DATETIME:
-                new DateLiteral(defaultValue, type);
+                if (defaultValueExprDef == null || !defaultValueExprDef.getExprName().equals(DefaultValue.NOW)) {
+                    DateLiteral datetimeLiteral = new DateLiteral(defaultValue, type);

Review Comment:
   if defaultValueExprDef == null, then check datetimeLiteral
   if defaultValueExprDef != null, then check the function name == now.



-- 
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: commits-unsubscribe@doris.apache.org

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