You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "MonsterChenzhuo (via GitHub)" <gi...@apache.org> on 2023/12/30 16:52:15 UTC

[PR] [core]Introduce tags system table ut [incubator-paimon]

MonsterChenzhuo opened a new pull request, #2607:
URL: https://github.com/apache/incubator-paimon/pull/2607

   <!-- Please specify the module before the PR name: [core] ... or [flink] ... -->
   
   ### Purpose
   
   Introduce tags system table ut.
   
   <!-- What is the purpose of the change -->
   
   ### Tests
   
   <!-- List UT and IT cases to verify this change -->
   
   ### API and Format
   
   <!-- Does this change affect API or storage format -->
   
   ### Documentation
   
   <!-- Does this change introduce a new feature -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [core]Append tags system table ut [incubator-paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi merged PR #2607:
URL: https://github.com/apache/incubator-paimon/pull/2607


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [core]Append tags system table ut [incubator-paimon]

Posted by "MonsterChenzhuo (via GitHub)" <gi...@apache.org>.
MonsterChenzhuo closed pull request #2607: [core]Append tags system table ut
URL: https://github.com/apache/incubator-paimon/pull/2607


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [core]Append tags system table ut [incubator-paimon]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi commented on code in PR #2607:
URL: https://github.com/apache/incubator-paimon/pull/2607#discussion_r1439111918


##########
paimon-core/src/test/java/org/apache/paimon/table/system/TagsTableTest.java:
##########
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.paimon.table.system;
+
+import org.apache.paimon.Snapshot;
+import org.apache.paimon.catalog.Identifier;
+import org.apache.paimon.data.BinaryString;
+import org.apache.paimon.data.GenericRow;
+import org.apache.paimon.data.InternalRow;
+import org.apache.paimon.data.Timestamp;
+import org.apache.paimon.manifest.ManifestCommittable;
+import org.apache.paimon.schema.Schema;
+import org.apache.paimon.table.FileStoreTable;
+import org.apache.paimon.table.TableTestBase;
+import org.apache.paimon.table.sink.TableCommitImpl;
+import org.apache.paimon.types.DataTypes;
+import org.apache.paimon.utils.DateTimeUtils;
+import org.apache.paimon.utils.TagManager;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import java.time.LocalDateTime;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+/** Unit tests for {@link TagsTable}. */
+public class TagsTableTest extends TableTestBase {
+
+    private TagsTable tagsTable;
+    private TagManager tagManager;
+
+    @BeforeEach
+    public void before() throws Exception {
+        Identifier identifier = identifier("T");
+        Schema schema =
+                Schema.newBuilder()
+                        .column("product_id", DataTypes.INT())
+                        .column("price", DataTypes.INT())
+                        .column("sales", DataTypes.INT())
+                        .primaryKey("product_id")
+                        .option("tag.automatic-creation", "watermark")
+                        .option("tag.creation-period", "daily")
+                        .option("tag.num-retained-max", "3")
+                        .build();
+        catalog.createTable(identifier, schema, true);
+        FileStoreTable table = (FileStoreTable) catalog.getTable(identifier);
+        TableCommitImpl commit = table.newCommit(commitUser).ignoreEmptyCommit(false);
+        commit.commit(
+                new ManifestCommittable(
+                        0,
+                        Timestamp.fromLocalDateTime(LocalDateTime.parse("2023-07-18T12:00:01"))
+                                .getMillisecond()));
+        commit.commit(
+                new ManifestCommittable(
+                        1,
+                        Timestamp.fromLocalDateTime(LocalDateTime.parse("2023-07-19T12:00:01"))
+                                .getMillisecond()));
+        tagsTable = (TagsTable) catalog.getTable(identifier("T$tags"));
+        tagManager = table.store().newTagManager();
+    }
+
+    @Test
+    public void testSchemasTable() throws Exception {

Review Comment:
   name



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [core]Append tags system table ut [incubator-paimon]

Posted by "MonsterChenzhuo (via GitHub)" <gi...@apache.org>.
MonsterChenzhuo commented on code in PR #2607:
URL: https://github.com/apache/incubator-paimon/pull/2607#discussion_r1441183453


##########
paimon-core/src/test/java/org/apache/paimon/table/system/TagsTableTest.java:
##########
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.paimon.table.system;
+
+import org.apache.paimon.Snapshot;
+import org.apache.paimon.catalog.Identifier;
+import org.apache.paimon.data.BinaryString;
+import org.apache.paimon.data.GenericRow;
+import org.apache.paimon.data.InternalRow;
+import org.apache.paimon.data.Timestamp;
+import org.apache.paimon.manifest.ManifestCommittable;
+import org.apache.paimon.schema.Schema;
+import org.apache.paimon.table.FileStoreTable;
+import org.apache.paimon.table.TableTestBase;
+import org.apache.paimon.table.sink.TableCommitImpl;
+import org.apache.paimon.types.DataTypes;
+import org.apache.paimon.utils.DateTimeUtils;
+import org.apache.paimon.utils.TagManager;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import java.time.LocalDateTime;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+/** Unit tests for {@link TagsTable}. */
+public class TagsTableTest extends TableTestBase {
+
+    private TagsTable tagsTable;
+    private TagManager tagManager;
+
+    @BeforeEach
+    public void before() throws Exception {
+        Identifier identifier = identifier("T");
+        Schema schema =
+                Schema.newBuilder()
+                        .column("product_id", DataTypes.INT())
+                        .column("price", DataTypes.INT())
+                        .column("sales", DataTypes.INT())
+                        .primaryKey("product_id")
+                        .option("tag.automatic-creation", "watermark")
+                        .option("tag.creation-period", "daily")
+                        .option("tag.num-retained-max", "3")
+                        .build();
+        catalog.createTable(identifier, schema, true);
+        FileStoreTable table = (FileStoreTable) catalog.getTable(identifier);
+        TableCommitImpl commit = table.newCommit(commitUser).ignoreEmptyCommit(false);
+        commit.commit(
+                new ManifestCommittable(
+                        0,
+                        Timestamp.fromLocalDateTime(LocalDateTime.parse("2023-07-18T12:00:01"))
+                                .getMillisecond()));
+        commit.commit(
+                new ManifestCommittable(
+                        1,
+                        Timestamp.fromLocalDateTime(LocalDateTime.parse("2023-07-19T12:00:01"))
+                                .getMillisecond()));
+        tagsTable = (TagsTable) catalog.getTable(identifier("T$tags"));
+        tagManager = table.store().newTagManager();
+    }
+
+    @Test
+    public void testSchemasTable() throws Exception {

Review Comment:
   done.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org