Skip to content

Commit 94f5cb9

Browse files
committed
[hotfix] Set paimon warehouse in FlinkCatalogITCase to make it consistent
1 parent 37f46dd commit 94f5cb9

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

fluss-flink/fluss-flink-common/src/test/java/org/apache/fluss/flink/catalog/FlinkCatalogITCase.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import org.apache.fluss.cluster.ServerNode;
2121
import org.apache.fluss.config.ConfigOptions;
2222
import org.apache.fluss.config.Configuration;
23+
import org.apache.fluss.exception.FlussRuntimeException;
2324
import org.apache.fluss.exception.InvalidAlterTableException;
2425
import org.apache.fluss.exception.InvalidConfigException;
2526
import org.apache.fluss.exception.InvalidTableException;
@@ -47,6 +48,7 @@
4748
import org.junit.jupiter.api.Test;
4849
import org.junit.jupiter.api.extension.RegisterExtension;
4950

51+
import java.nio.file.Files;
5052
import java.time.Duration;
5153
import java.time.LocalDate;
5254
import java.time.LocalDateTime;
@@ -76,11 +78,23 @@ abstract class FlinkCatalogITCase {
7678
.setClusterConf(initClusterConf())
7779
.build();
7880

81+
protected static String paimonWarehousePath;
82+
7983
static Configuration initClusterConf() {
8084
Configuration clusterConf = new Configuration();
8185
// use a small check interval to cleanup partitions quickly
8286
clusterConf.set(ConfigOptions.AUTO_PARTITION_CHECK_INTERVAL, Duration.ofSeconds(3));
8387
clusterConf.set(ConfigOptions.DATALAKE_FORMAT, DataLakeFormat.PAIMON);
88+
try {
89+
paimonWarehousePath =
90+
Files.createTempDirectory("fluss-catalog-itcase")
91+
.resolve("warehouse")
92+
.toString();
93+
} catch (Exception e) {
94+
throw new FlussRuntimeException("Failed to create warehouse path");
95+
}
96+
clusterConf.setString("datalake.paimon.warehouse", paimonWarehousePath);
97+
8498
return clusterConf;
8599
}
86100

@@ -208,6 +222,7 @@ void testAlterTable() throws Exception {
208222
expectedOptions.put("bucket.num", "5");
209223
expectedOptions.put("table.datalake.enabled", "true");
210224
expectedOptions.put("table.datalake.format", "paimon");
225+
expectedOptions.put("table.datalake.paimon.warehouse", paimonWarehousePath);
211226
assertOptionsEqual(table.getOptions(), expectedOptions);
212227

213228
// alter table

0 commit comments

Comments
 (0)