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

yiguolei pushed a commit to branch dev-1.1.2
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/dev-1.1.2 by this push:
     new e5379f76ca [dev-1.1.2](cherry-pick) Fix ctas default timestamp insert 
error #12057
e5379f76ca is described below

commit e5379f76ca1d4d8b46d379f71c6085c1618283e8
Author: Stalary <stal...@163.com>
AuthorDate: Thu Aug 25 09:00:21 2022 +0800

    [dev-1.1.2](cherry-pick) Fix ctas default timestamp insert error #12057
---
 fe/fe-core/src/main/java/org/apache/doris/catalog/Catalog.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/Catalog.java 
b/fe/fe-core/src/main/java/org/apache/doris/catalog/Catalog.java
index b4bb47bd5f..aef7c4a792 100755
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/Catalog.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/Catalog.java
@@ -3152,7 +3152,11 @@ public class Catalog {
                     } else {
                         defaultValue = new DefaultValue(setDefault, 
column.getDefaultValue());
                     }
-                    columnDef = new ColumnDef(name, typeDef, column.isKey(), 
column.getAggregationType(),
+                    // AggregateType.NONE cause the table to change to the 
AGGREGATE KEY when analyze is used,
+                    // cause CURRENT_TIMESTAMP to report an error.
+                    columnDef = new ColumnDef(name, typeDef, column.isKey(),
+                            
AggregateType.NONE.equals(column.getAggregationType())
+                                    ? null : column.getAggregationType(),
                             column.isAllowNull(), defaultValue, 
column.getComment());
                 }
                 createTableStmt.addColumnDef(columnDef);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to