|
20 | 20 | import org.apache.fluss.cluster.ServerNode; |
21 | 21 | import org.apache.fluss.config.ConfigOptions; |
22 | 22 | import org.apache.fluss.config.Configuration; |
| 23 | +import org.apache.fluss.exception.FlussRuntimeException; |
23 | 24 | import org.apache.fluss.exception.InvalidAlterTableException; |
24 | 25 | import org.apache.fluss.exception.InvalidConfigException; |
25 | 26 | import org.apache.fluss.exception.InvalidTableException; |
|
47 | 48 | import org.junit.jupiter.api.Test; |
48 | 49 | import org.junit.jupiter.api.extension.RegisterExtension; |
49 | 50 |
|
| 51 | +import java.nio.file.Files; |
50 | 52 | import java.time.Duration; |
51 | 53 | import java.time.LocalDate; |
52 | 54 | import java.time.LocalDateTime; |
@@ -76,11 +78,23 @@ abstract class FlinkCatalogITCase { |
76 | 78 | .setClusterConf(initClusterConf()) |
77 | 79 | .build(); |
78 | 80 |
|
| 81 | + protected static String paimonWarehousePath; |
| 82 | + |
79 | 83 | static Configuration initClusterConf() { |
80 | 84 | Configuration clusterConf = new Configuration(); |
81 | 85 | // use a small check interval to cleanup partitions quickly |
82 | 86 | clusterConf.set(ConfigOptions.AUTO_PARTITION_CHECK_INTERVAL, Duration.ofSeconds(3)); |
83 | 87 | 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 | + |
84 | 98 | return clusterConf; |
85 | 99 | } |
86 | 100 |
|
@@ -208,6 +222,7 @@ void testAlterTable() throws Exception { |
208 | 222 | expectedOptions.put("bucket.num", "5"); |
209 | 223 | expectedOptions.put("table.datalake.enabled", "true"); |
210 | 224 | expectedOptions.put("table.datalake.format", "paimon"); |
| 225 | + expectedOptions.put("table.datalake.paimon.warehouse", paimonWarehousePath); |
211 | 226 | assertOptionsEqual(table.getOptions(), expectedOptions); |
212 | 227 |
|
213 | 228 | // alter table |
|
0 commit comments