You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@paimon.apache.org by lz...@apache.org on 2024/06/03 09:19:45 UTC
(paimon) branch master updated: [core] Fix should ignore the Long.MIN value when create TAG based on the watermark. (#3457)
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 013a50da4 [core] Fix should ignore the Long.MIN value when create TAG based on the watermark. (#3457)
013a50da4 is described below
commit 013a50da47e4d07f9eb15a7e2ff74d1d14b89c70
Author: HunterXHunter <13...@qq.com>
AuthorDate: Mon Jun 3 17:19:40 2024 +0800
[core] Fix should ignore the Long.MIN value when create TAG based on the watermark. (#3457)
---
paimon-core/src/main/java/org/apache/paimon/tag/TagTimeExtractor.java | 2 +-
.../src/test/java/org/apache/paimon/tag/TagAutoManagerTest.java | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/paimon-core/src/main/java/org/apache/paimon/tag/TagTimeExtractor.java b/paimon-core/src/main/java/org/apache/paimon/tag/TagTimeExtractor.java
index e017b2151..29bc34503 100644
--- a/paimon-core/src/main/java/org/apache/paimon/tag/TagTimeExtractor.java
+++ b/paimon-core/src/main/java/org/apache/paimon/tag/TagTimeExtractor.java
@@ -56,7 +56,7 @@ public interface TagTimeExtractor {
@Override
public Optional<LocalDateTime> extract(long timeMilli, @Nullable Long watermark) {
- if (watermark == null) {
+ if (watermark == null || watermark < 0) {
return Optional.empty();
}
diff --git a/paimon-core/src/test/java/org/apache/paimon/tag/TagAutoManagerTest.java b/paimon-core/src/test/java/org/apache/paimon/tag/TagAutoManagerTest.java
index a065945ba..84678048a 100644
--- a/paimon-core/src/test/java/org/apache/paimon/tag/TagAutoManagerTest.java
+++ b/paimon-core/src/test/java/org/apache/paimon/tag/TagAutoManagerTest.java
@@ -135,6 +135,10 @@ public class TagAutoManagerTest extends PrimaryKeyTableTestBase {
TableCommitImpl commit = table.newCommit(commitUser).ignoreEmptyCommit(false);
TagManager tagManager = table.store().newTagManager();
+ // test watermark is Long.MIN_VALUE.
+ commit.commit(new ManifestCommittable(0, Long.MIN_VALUE));
+ assertThat(tagManager.allTagNames()).isEmpty();
+
// test first create
commit.commit(new ManifestCommittable(0, localZoneMills("2023-07-18T12:00:09")));
assertThat(tagManager.allTagNames()).containsOnly("2023-07-18 11");