Skip to content

Commit

Permalink
[core] TagsTable create time should be nullable (#3289)
Browse files Browse the repository at this point in the history
  • Loading branch information
eric666666 committed May 4, 2024
1 parent 7b378dc commit b53c368
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@

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;
Expand Down Expand Up @@ -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))));

Expand Down Expand Up @@ -246,10 +245,9 @@ private InternalRow toRow(
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
? ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,9 @@ private List<InternalRow> getExceptedResult(
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
? ""
Expand Down

0 comments on commit b53c368

Please sign in to comment.