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

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


The following commit(s) were added to refs/heads/branch-4.0 by this push:
     new 768032e6d32 branch-4.0: [opt](catalog) make catalog createtime the 
same format as updatetime #59288 (#59306)
768032e6d32 is described below

commit 768032e6d327728b1217fbc9d8e280791c6ad697
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Thu Dec 25 15:42:29 2025 +0800

    branch-4.0: [opt](catalog) make catalog createtime the same format as 
updatetime #59288 (#59306)
    
    Cherry-picked from #59288
    
    Co-authored-by: camby <[email protected]>
---
 fe/fe-core/src/main/java/org/apache/doris/catalog/JdbcResource.java  | 5 ++---
 .../doris/nereids/trees/plans/commands/CreateCatalogCommand.java     | 5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/catalog/JdbcResource.java 
b/fe/fe-core/src/main/java/org/apache/doris/catalog/JdbcResource.java
index 1859c09200c..c9d21e7174d 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/JdbcResource.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/JdbcResource.java
@@ -26,6 +26,7 @@ import org.apache.doris.common.FeConstants;
 import org.apache.doris.common.plugin.CloudPluginDownloader;
 import org.apache.doris.common.plugin.CloudPluginDownloader.PluginType;
 import org.apache.doris.common.proc.BaseProcResult;
+import org.apache.doris.common.util.TimeUtils;
 import org.apache.doris.common.util.Util;
 import org.apache.doris.datasource.CatalogProperty;
 import org.apache.doris.datasource.ExternalCatalog;
@@ -47,8 +48,6 @@ import java.net.URI;
 import java.net.URISyntaxException;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
-import java.time.LocalDateTime;
-import java.time.ZoneId;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -206,7 +205,7 @@ public class JdbcResource extends Resource {
         this.configs = Maps.newHashMap(properties);
         validateProperties(this.configs);
         applyDefaultProperties();
-        String currentDateTime = 
LocalDateTime.now(ZoneId.systemDefault()).toString().replace("T", " ");
+        String currentDateTime = 
TimeUtils.longToTimeString(System.currentTimeMillis());
         configs.put(CREATE_TIME, currentDateTime);
         // check properties
         for (String property : ALL_PROPERTIES) {
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/CreateCatalogCommand.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/CreateCatalogCommand.java
index 138773108e5..3d1e913296c 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/CreateCatalogCommand.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/CreateCatalogCommand.java
@@ -23,6 +23,7 @@ import org.apache.doris.common.Config;
 import org.apache.doris.common.ErrorCode;
 import org.apache.doris.common.ErrorReport;
 import org.apache.doris.common.util.PropertyAnalyzer;
+import org.apache.doris.common.util.TimeUtils;
 import org.apache.doris.common.util.Util;
 import org.apache.doris.datasource.ExternalCatalog;
 import org.apache.doris.datasource.InternalCatalog;
@@ -35,8 +36,6 @@ import org.apache.doris.qe.StmtExecutor;
 import com.google.common.base.Strings;
 import com.google.common.collect.Maps;
 
-import java.time.LocalDateTime;
-import java.time.ZoneId;
 import java.util.Map;
 import java.util.Objects;
 
@@ -81,7 +80,7 @@ public class CreateCatalogCommand extends Command implements 
ForwardWithSync, Ne
                     + " to enable it temporarily.");
         }
 
-        String currentDateTime = 
LocalDateTime.now(ZoneId.systemDefault()).toString().replace("T", " ");
+        String currentDateTime = 
TimeUtils.longToTimeString(System.currentTimeMillis());
         properties.put(ExternalCatalog.CREATE_TIME, currentDateTime);
         PropertyAnalyzer.checkCatalogProperties(properties, false);
     }


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

Reply via email to