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

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


The following commit(s) were added to refs/heads/master by this push:
     new b53c3680d [core] TagsTable create time should be nullable (#3289)
b53c3680d is described below

commit b53c3680da9cd79908f82ece7c4f0c31fefd1d26
Author: EricZ <[email protected]>
AuthorDate: Sat May 4 10:07:38 2024 +0800

    [core] TagsTable create time should be nullable (#3289)
---
 .../main/java/org/apache/paimon/table/system/TagsTable.java    | 10 ++++------
 .../java/org/apache/paimon/table/system/TagsTableTest.java     |  7 +++----
 2 files changed, 7 insertions(+), 10 deletions(-)

diff --git 
a/paimon-core/src/main/java/org/apache/paimon/table/system/TagsTable.java 
b/paimon-core/src/main/java/org/apache/paimon/table/system/TagsTable.java
index 21c9cf495..82fe629f0 100644
--- a/paimon-core/src/main/java/org/apache/paimon/table/system/TagsTable.java
+++ b/paimon-core/src/main/java/org/apache/paimon/table/system/TagsTable.java
@@ -52,7 +52,6 @@ import org.apache.paimon.utils.TagManager;
 
 import org.apache.paimon.shade.guava30.com.google.common.collect.Iterators;
 
-import java.time.LocalDateTime;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
@@ -81,7 +80,7 @@ public class TagsTable implements ReadonlyTable {
                             new DataField(3, "commit_time", new 
TimestampType(false, 3)),
                             new DataField(4, "record_count", new 
BigIntType(true)),
                             new DataField(5, "branches", 
SerializationUtils.newStringType(true)),
-                            new DataField(6, "create_time", new 
TimestampType(false, 3)),
+                            new DataField(6, "create_time", new 
TimestampType(true, 3)),
                             new DataField(
                                     7, "time_retained", 
SerializationUtils.newStringType(true))));
 
@@ -246,10 +245,9 @@ public class TagsTable implements ReadonlyTable {
                     
Timestamp.fromLocalDateTime(DateTimeUtils.toLocalDateTime(tag.timeMillis())),
                     tag.totalRecordCount(),
                     BinaryString.fromString(branches == null ? "[]" : 
branches.toString()),
-                    Timestamp.fromLocalDateTime(
-                            tag.getTagCreateTime() == null
-                                    ? LocalDateTime.MIN
-                                    : tag.getTagCreateTime()),
+                    tag.getTagCreateTime() == null
+                            ? null
+                            : 
Timestamp.fromLocalDateTime(tag.getTagCreateTime()),
                     BinaryString.fromString(
                             tag.getTagTimeRetained() == null
                                     ? ""
diff --git 
a/paimon-core/src/test/java/org/apache/paimon/table/system/TagsTableTest.java 
b/paimon-core/src/test/java/org/apache/paimon/table/system/TagsTableTest.java
index 4b381a601..ea7aca67c 100644
--- 
a/paimon-core/src/test/java/org/apache/paimon/table/system/TagsTableTest.java
+++ 
b/paimon-core/src/test/java/org/apache/paimon/table/system/TagsTableTest.java
@@ -132,10 +132,9 @@ class TagsTableTest extends TableTestBase {
                                     
DateTimeUtils.toLocalDateTime(tag.timeMillis())),
                             tag.totalRecordCount(),
                             
BinaryString.fromString(tagBranchesFunction.apply(tagName).toString()),
-                            Timestamp.fromLocalDateTime(
-                                    tag.getTagCreateTime() == null
-                                            ? LocalDateTime.MIN
-                                            : tag.getTagCreateTime()),
+                            tag.getTagCreateTime() == null
+                                    ? null
+                                    : 
Timestamp.fromLocalDateTime(tag.getTagCreateTime()),
                             BinaryString.fromString(
                                     tag.getTagTimeRetained() == null
                                             ? ""

Reply via email to