diff --git a/paimon-core/src/test/java/org/apache/paimon/table/RecordLevelExpireTest.java b/paimon-core/src/test/java/org/apache/paimon/table/RecordLevelExpireTest.java index 367a30b6676c..b8788883ab56 100644 --- a/paimon-core/src/test/java/org/apache/paimon/table/RecordLevelExpireTest.java +++ b/paimon-core/src/test/java/org/apache/paimon/table/RecordLevelExpireTest.java @@ -19,17 +19,49 @@ package org.apache.paimon.table; import org.apache.paimon.CoreOptions; +import org.apache.paimon.catalog.Catalog; +import org.apache.paimon.catalog.CatalogContext; +import org.apache.paimon.catalog.CatalogFactory; +import org.apache.paimon.catalog.Identifier; import org.apache.paimon.catalog.PrimaryKeyTableTestBase; import org.apache.paimon.data.GenericRow; +import org.apache.paimon.fs.Path; import org.apache.paimon.options.Options; +import org.apache.paimon.schema.Schema; +import org.apache.paimon.types.DataTypes; +import org.apache.paimon.utils.TraceableFileIO; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import java.time.Duration; +import java.util.UUID; import static org.assertj.core.api.Assertions.assertThat; class RecordLevelExpireTest extends PrimaryKeyTableTestBase { + @Override + @BeforeEach + public void beforeEachBase() throws Exception { + CatalogContext context = + CatalogContext.create( + new Path(TraceableFileIO.SCHEME + "://" + tempPath.toString())); + Catalog catalog = CatalogFactory.createCatalog(context); + Identifier identifier = new Identifier("default", "T"); + catalog.createDatabase(identifier.getDatabaseName(), true); + Schema schema = + Schema.newBuilder() + .column("pt", DataTypes.INT()) + .column("pk", DataTypes.INT()) + .column("col1", DataTypes.INT().notNull()) + .partitionKeys("pt") + .primaryKey("pk", "pt") + .options(tableOptions().toMap()) + .build(); + catalog.createTable(identifier, schema, true); + table = (FileStoreTable) catalog.getTable(identifier); + commitUser = UUID.randomUUID().toString(); + } @Override protected Options tableOptions() { diff --git a/paimon-core/src/test/java/org/apache/paimon/table/RecordLevelExpireWithMillisecondTest.java b/paimon-core/src/test/java/org/apache/paimon/table/RecordLevelExpireWithMillisecondTest.java index 15b6556c3481..393683fc92ea 100644 --- a/paimon-core/src/test/java/org/apache/paimon/table/RecordLevelExpireWithMillisecondTest.java +++ b/paimon-core/src/test/java/org/apache/paimon/table/RecordLevelExpireWithMillisecondTest.java @@ -53,7 +53,7 @@ public void beforeEachBase() throws Exception { Schema.newBuilder() .column("pt", DataTypes.INT()) .column("pk", DataTypes.INT()) - .column("col1", DataTypes.BIGINT()) + .column("col1", DataTypes.BIGINT().notNull()) .partitionKeys("pt") .primaryKey("pk", "pt") .options(tableOptions().toMap()) diff --git a/paimon-core/src/test/java/org/apache/paimon/table/RecordLevelExpireWithTimestampLTZTest.java b/paimon-core/src/test/java/org/apache/paimon/table/RecordLevelExpireWithTimestampLTZTest.java index af834af276c4..c256171c6f03 100644 --- a/paimon-core/src/test/java/org/apache/paimon/table/RecordLevelExpireWithTimestampLTZTest.java +++ b/paimon-core/src/test/java/org/apache/paimon/table/RecordLevelExpireWithTimestampLTZTest.java @@ -46,7 +46,7 @@ public void beforeEachBase() throws Exception { Schema.newBuilder() .column("pt", DataTypes.INT()) .column("pk", DataTypes.INT()) - .column("col1", DataTypes.TIMESTAMP_WITH_LOCAL_TIME_ZONE()) + .column("col1", DataTypes.TIMESTAMP_WITH_LOCAL_TIME_ZONE().notNull()) .partitionKeys("pt") .primaryKey("pk", "pt") .options(tableOptions().toMap()) diff --git a/paimon-core/src/test/java/org/apache/paimon/table/RecordLevelExpireWithTimestampTest.java b/paimon-core/src/test/java/org/apache/paimon/table/RecordLevelExpireWithTimestampTest.java index 3c4add8914f8..697053c0e7ac 100644 --- a/paimon-core/src/test/java/org/apache/paimon/table/RecordLevelExpireWithTimestampTest.java +++ b/paimon-core/src/test/java/org/apache/paimon/table/RecordLevelExpireWithTimestampTest.java @@ -46,7 +46,7 @@ public void beforeEachBase() throws Exception { Schema.newBuilder() .column("pt", DataTypes.INT()) .column("pk", DataTypes.INT()) - .column("col1", DataTypes.TIMESTAMP()) + .column("col1", DataTypes.TIMESTAMP().notNull()) .partitionKeys("pt") .primaryKey("pk", "pt") .options(tableOptions().toMap())