Skip to content

Commit 2c3ae38

Browse files
branch-4.1: [fix](catalog) Support database properties for Paimon and Iceberg (#67163)
### What problem does this PR solve? Problem Summary: Doris rejected database properties for every Paimon catalog except HMS and for every Iceberg catalog except HMS, even when the upstream catalog implementation supports namespace/database properties. In particular, this prevented creating databases with properties in Paimon JDBC catalogs. This change aligns Doris with the pinned upstream catalog capabilities: - Paimon: allow ordinary database properties for HMS, JDBC, REST, and DLF catalogs; keep rejecting them for filesystem catalogs. - Iceberg: allow ordinary namespace properties for HMS, JDBC, and Glue catalogs; keep rejecting them for Hadoop, REST, DLF, and S3 Tables catalogs. Iceberg REST remains unsupported because the protocol allows servers to ignore namespace properties. - Treat the operational `location` property separately. Allow it only where it controls default table placement: Paimon HMS/DLF and Iceberg HMS/Glue. Reject it for Paimon JDBC/REST and Iceberg JDBC, where accepting it would persist metadata without relocating subsequently created tables. - Forward supported property maps unchanged to the upstream catalog implementation. - Validate Paimon `ALTER TABLE SET` keys with the Paimon SDK and reject `path` before issuing the remote alter, because changing the option does not relocate an existing table. - Add unit coverage for the capability matrix and pre-alter validation, and extend the JDBC and Paimon alter regression cases. ### Release note Support creating databases with properties in supported Paimon and Iceberg catalogs, while rejecting location properties that do not control table placement. ### Check List (For Author) - Test - [x] Regression test - [x] Unit Test - [ ] Manual test (add detailed scripts or steps below) - [ ] No need to test or manual test. Explain why: - [ ] This is a refactor/code format and no logic has been changed. - [ ] Previous test can cover this change. - [ ] No code files have been changed. - [ ] Other reason Unit tests: ```shell DORIS_GCC_HOME=/usr mvn test -pl fe-common,fe-core -am -Dskip.clean=true -Dcheckstyle.skip=true -DfailIfNoTests=false -Dtest=org.apache.doris.datasource.paimon.PaimonMetadataOpsTest,org.apache.doris.datasource.iceberg.IcebergMetadataOpTest ``` Result: 26 tests passed (18 Paimon and 8 Iceberg). The external regression cases were updated but were not executed locally because they require the full external service environment. - Behavior changed: - [ ] No. - [x] Yes. Database properties are accepted and forwarded according to catalog capability; operational location changes are rejected when the upstream implementation cannot honor their placement semantics. - Does this need documentation? - [x] No. - [ ] Yes. ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label
1 parent f1d3604 commit 2c3ae38

7 files changed

Lines changed: 305 additions & 11 deletions

File tree

‎fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergMetadataOps.java‎

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
public class IcebergMetadataOps implements ExternalMetadataOps {
101101

102102
private static final Logger LOG = LogManager.getLogger(IcebergMetadataOps.class);
103+
private static final String PROP_LOCATION = "location";
103104
protected Catalog catalog;
104105
protected ExternalCatalog dorisCatalog;
105106
protected SupportsNamespaces nsCatalog;
@@ -250,15 +251,34 @@ private boolean performCreateDb(String dbName, boolean ifNotExists, Map<String,
250251
}
251252
if (!properties.isEmpty() && dorisCatalog instanceof IcebergExternalCatalog) {
252253
String icebergCatalogType = ((IcebergExternalCatalog) dorisCatalog).getIcebergCatalogType();
253-
if (!IcebergExternalCatalog.ICEBERG_HMS.equals(icebergCatalogType)) {
254-
throw new DdlException(
255-
"Not supported: create database with properties for iceberg catalog type: " + icebergCatalogType);
256-
}
254+
validateDatabaseProperties(icebergCatalogType, properties);
257255
}
258256
nsCatalog.createNamespace(getNamespace(dbName), properties);
259257
return false;
260258
}
261259

260+
private boolean supportsDatabaseProperties(String catalogType) {
261+
return IcebergExternalCatalog.ICEBERG_HMS.equals(catalogType)
262+
|| IcebergExternalCatalog.ICEBERG_JDBC.equals(catalogType)
263+
|| IcebergExternalCatalog.ICEBERG_GLUE.equals(catalogType);
264+
}
265+
266+
private boolean supportsDatabaseLocation(String catalogType) {
267+
return IcebergExternalCatalog.ICEBERG_HMS.equals(catalogType)
268+
|| IcebergExternalCatalog.ICEBERG_GLUE.equals(catalogType);
269+
}
270+
271+
private void validateDatabaseProperties(String catalogType, Map<String, String> properties) throws DdlException {
272+
if (!supportsDatabaseProperties(catalogType)) {
273+
throw new DdlException(
274+
"Not supported: create database with properties for iceberg catalog type: " + catalogType);
275+
}
276+
if (properties.containsKey(PROP_LOCATION) && !supportsDatabaseLocation(catalogType)) {
277+
throw new DdlException("Not supported: database property 'location' for iceberg catalog type: "
278+
+ catalogType + " because it does not determine the default table location");
279+
}
280+
}
281+
262282
@Override
263283
public void dropDbImpl(String dbName, boolean ifExists, boolean force) throws DdlException {
264284
try {

‎fe/fe-core/src/main/java/org/apache/doris/datasource/paimon/PaimonMetadataOps.java‎

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
import org.apache.paimon.catalog.Identifier;
5353
import org.apache.paimon.schema.Schema;
5454
import org.apache.paimon.schema.SchemaChange;
55+
import org.apache.paimon.schema.SchemaManager;
5556
import org.apache.paimon.types.DataField;
5657
import org.apache.paimon.types.DataType;
5758

@@ -109,16 +110,36 @@ private boolean performCreateDb(String dbName, boolean ifNotExists, Map<String,
109110

110111
if (!properties.isEmpty() && dorisCatalog instanceof PaimonExternalCatalog) {
111112
String catalogType = ((PaimonExternalCatalog) dorisCatalog).getCatalogType();
112-
if (!PaimonExternalCatalog.PAIMON_HMS.equals(catalogType)) {
113-
throw new DdlException(
114-
"Not supported: create database with properties for paimon catalog type: " + catalogType);
115-
}
113+
validateDatabaseProperties(catalogType, properties);
116114
}
117115

118116
catalog.createDatabase(dbName, ifNotExists, properties);
119117
return false;
120118
}
121119

120+
private boolean supportsDatabaseProperties(String catalogType) {
121+
return PaimonExternalCatalog.PAIMON_HMS.equals(catalogType)
122+
|| PaimonExternalCatalog.PAIMON_JDBC.equals(catalogType)
123+
|| PaimonExternalCatalog.PAIMON_REST.equals(catalogType)
124+
|| PaimonExternalCatalog.PAIMON_DLF.equals(catalogType);
125+
}
126+
127+
private boolean supportsDatabaseLocation(String catalogType) {
128+
return PaimonExternalCatalog.PAIMON_HMS.equals(catalogType)
129+
|| PaimonExternalCatalog.PAIMON_DLF.equals(catalogType);
130+
}
131+
132+
private void validateDatabaseProperties(String catalogType, Map<String, String> properties) throws DdlException {
133+
if (!supportsDatabaseProperties(catalogType)) {
134+
throw new DdlException(
135+
"Not supported: create database with properties for paimon catalog type: " + catalogType);
136+
}
137+
if (properties.containsKey(PROP_LOCATION) && !supportsDatabaseLocation(catalogType)) {
138+
throw new DdlException("Not supported: database property 'location' for paimon catalog type: "
139+
+ catalogType + " because it does not determine the default table location");
140+
}
141+
}
142+
122143
@Override
123144
public void afterCreateDb() {
124145
dorisCatalog.resetMetaCacheNames();
@@ -533,6 +554,13 @@ private void refreshTable(ExternalTable dorisTable, long updateTime) {
533554
@Override
534555
public void updateTableProperties(ExternalTable dorisTable, Map<String, String> properties, long updateTime)
535556
throws UserException {
557+
try {
558+
properties.keySet().forEach(SchemaManager::checkAlterTablePath);
559+
} catch (UnsupportedOperationException e) {
560+
throw new UserException("Failed to set properties for Paimon table " + dorisTable.getName()
561+
+ ": " + ExceptionUtils.getRootCauseMessage(e), e);
562+
}
563+
536564
List<SchemaChange> changes = new ArrayList<>(properties.size());
537565
properties.forEach((key, value) -> changes.add(SchemaChange.setOption(key, value)));
538566
alterTable(dorisTable, changes, "set properties", updateTime);

‎fe/fe-core/src/test/java/org/apache/doris/datasource/iceberg/IcebergMetadataOpTest.java‎

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import org.apache.doris.catalog.Column;
2121
import org.apache.doris.catalog.Type;
22+
import org.apache.doris.common.DdlException;
2223
import org.apache.doris.common.security.authentication.ExecutionAuthenticator;
2324
import org.apache.doris.datasource.CatalogProperty;
2425
import org.apache.doris.datasource.ExternalDatabase;
@@ -160,6 +161,111 @@ public void testPerformCreateTableRespectsCatalogDefaultFormatVersion() throws E
160161
propsCaptor.getValue(), catalogProps));
161162
}
162163

164+
@Test
165+
public void testCreateDatabaseWithPropertiesForSupportedCatalogs() throws Exception {
166+
List<String> supportedCatalogTypes = Arrays.asList(
167+
IcebergExternalCatalog.ICEBERG_HMS,
168+
IcebergExternalCatalog.ICEBERG_JDBC,
169+
IcebergExternalCatalog.ICEBERG_GLUE);
170+
for (String catalogType : supportedCatalogTypes) {
171+
String dbName = catalogType + "_db";
172+
Catalog icebergCatalog = Mockito.mock(Catalog.class,
173+
Mockito.withSettings().extraInterfaces(SupportsNamespaces.class));
174+
SupportsNamespaces namespaceCatalog = (SupportsNamespaces) icebergCatalog;
175+
IcebergExternalCatalog dorisCatalog = Mockito.mock(IcebergExternalCatalog.class);
176+
Mockito.when(dorisCatalog.getExecutionAuthenticator()).thenReturn(new ExecutionAuthenticator() {});
177+
Mockito.when(dorisCatalog.getProperties()).thenReturn(Collections.emptyMap());
178+
Mockito.when(dorisCatalog.getIcebergCatalogType()).thenReturn(catalogType);
179+
Mockito.when(namespaceCatalog.namespaceExists(Namespace.of(dbName))).thenReturn(false);
180+
IcebergMetadataOps ops = new IcebergMetadataOps(dorisCatalog, icebergCatalog);
181+
Map<String, String> properties = Collections.singletonMap("owner", "doris");
182+
183+
Assert.assertFalse(ops.createDbImpl(dbName, false, properties));
184+
185+
Mockito.verify(namespaceCatalog).createNamespace(Namespace.of(dbName), properties);
186+
}
187+
}
188+
189+
@Test
190+
public void testCreateDatabaseWithLocationForSupportedCatalogs() throws Exception {
191+
List<String> supportedCatalogTypes = Arrays.asList(
192+
IcebergExternalCatalog.ICEBERG_HMS,
193+
IcebergExternalCatalog.ICEBERG_GLUE);
194+
for (String catalogType : supportedCatalogTypes) {
195+
String dbName = catalogType + "_location_db";
196+
Catalog icebergCatalog = Mockito.mock(Catalog.class,
197+
Mockito.withSettings().extraInterfaces(SupportsNamespaces.class));
198+
SupportsNamespaces namespaceCatalog = (SupportsNamespaces) icebergCatalog;
199+
IcebergExternalCatalog dorisCatalog = Mockito.mock(IcebergExternalCatalog.class);
200+
Mockito.when(dorisCatalog.getExecutionAuthenticator()).thenReturn(new ExecutionAuthenticator() {});
201+
Mockito.when(dorisCatalog.getProperties()).thenReturn(Collections.emptyMap());
202+
Mockito.when(dorisCatalog.getIcebergCatalogType()).thenReturn(catalogType);
203+
Mockito.when(namespaceCatalog.namespaceExists(Namespace.of(dbName))).thenReturn(false);
204+
IcebergMetadataOps ops = new IcebergMetadataOps(dorisCatalog, icebergCatalog);
205+
Map<String, String> properties = Collections.singletonMap(
206+
"location", "s3://warehouse/" + dbName);
207+
208+
Assert.assertFalse(ops.createDbImpl(dbName, false, properties));
209+
210+
Mockito.verify(namespaceCatalog).createNamespace(Namespace.of(dbName), properties);
211+
}
212+
}
213+
214+
@Test
215+
public void testCreateDatabaseWithLocationForJdbcCatalogIsRejected() {
216+
String dbName = "jdbc_location_db";
217+
Catalog icebergCatalog = Mockito.mock(Catalog.class,
218+
Mockito.withSettings().extraInterfaces(SupportsNamespaces.class));
219+
SupportsNamespaces namespaceCatalog = (SupportsNamespaces) icebergCatalog;
220+
IcebergExternalCatalog dorisCatalog = Mockito.mock(IcebergExternalCatalog.class);
221+
Mockito.when(dorisCatalog.getExecutionAuthenticator()).thenReturn(new ExecutionAuthenticator() {});
222+
Mockito.when(dorisCatalog.getProperties()).thenReturn(Collections.emptyMap());
223+
Mockito.when(dorisCatalog.getIcebergCatalogType()).thenReturn(IcebergExternalCatalog.ICEBERG_JDBC);
224+
Mockito.when(namespaceCatalog.namespaceExists(Namespace.of(dbName))).thenReturn(false);
225+
IcebergMetadataOps ops = new IcebergMetadataOps(dorisCatalog, icebergCatalog);
226+
Map<String, String> properties = Collections.singletonMap(
227+
"location", "s3://warehouse/" + dbName);
228+
229+
DdlException exception = Assert.assertThrows(
230+
DdlException.class,
231+
() -> ops.createDbImpl(dbName, false, properties));
232+
233+
Assert.assertTrue(exception.getMessage().contains(
234+
"database property 'location' for iceberg catalog type: jdbc"));
235+
Mockito.verify(namespaceCatalog, Mockito.never())
236+
.createNamespace(Mockito.any(Namespace.class), Mockito.anyMap());
237+
}
238+
239+
@Test
240+
public void testCreateDatabaseWithPropertiesForUnsupportedCatalogs() {
241+
List<String> unsupportedCatalogTypes = Arrays.asList(
242+
IcebergExternalCatalog.ICEBERG_HADOOP,
243+
IcebergExternalCatalog.ICEBERG_REST,
244+
IcebergExternalCatalog.ICEBERG_DLF,
245+
IcebergExternalCatalog.ICEBERG_S3_TABLES);
246+
for (String catalogType : unsupportedCatalogTypes) {
247+
String dbName = catalogType + "_db";
248+
Catalog icebergCatalog = Mockito.mock(Catalog.class,
249+
Mockito.withSettings().extraInterfaces(SupportsNamespaces.class));
250+
SupportsNamespaces namespaceCatalog = (SupportsNamespaces) icebergCatalog;
251+
IcebergExternalCatalog dorisCatalog = Mockito.mock(IcebergExternalCatalog.class);
252+
Mockito.when(dorisCatalog.getExecutionAuthenticator()).thenReturn(new ExecutionAuthenticator() {});
253+
Mockito.when(dorisCatalog.getProperties()).thenReturn(Collections.emptyMap());
254+
Mockito.when(dorisCatalog.getIcebergCatalogType()).thenReturn(catalogType);
255+
Mockito.when(namespaceCatalog.namespaceExists(Namespace.of(dbName))).thenReturn(false);
256+
IcebergMetadataOps ops = new IcebergMetadataOps(dorisCatalog, icebergCatalog);
257+
Map<String, String> properties = Collections.singletonMap("owner", "doris");
258+
259+
DdlException exception = Assert.assertThrows(
260+
DdlException.class,
261+
() -> ops.createDbImpl(dbName, false, properties));
262+
263+
Assert.assertTrue(exception.getMessage().contains("iceberg catalog type: " + catalogType));
264+
Mockito.verify(namespaceCatalog, Mockito.never())
265+
.createNamespace(Mockito.any(Namespace.class), Mockito.anyMap());
266+
}
267+
}
268+
163269
private IcebergExternalCatalog mockHmsCatalog(Map<String, String> catalogProperties) {
164270
IcebergExternalCatalog dorisCatalog = Mockito.mock(IcebergExternalCatalog.class);
165271
Mockito.when(dorisCatalog.getExecutionAuthenticator()).thenReturn(new ExecutionAuthenticator() {

‎fe/fe-core/src/test/java/org/apache/doris/datasource/paimon/PaimonMetadataOpsTest.java‎

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
import java.nio.file.Files;
6161
import java.nio.file.Path;
6262
import java.util.ArrayList;
63+
import java.util.Arrays;
6364
import java.util.HashMap;
6465
import java.util.LinkedHashMap;
6566
import java.util.List;
@@ -186,6 +187,25 @@ public void testUpdateTablePropertiesUsesOneAtomicAlter() throws Exception {
186187
changesCaptor.getValue());
187188
}
188189

190+
@Test
191+
public void testUpdateTablePropertiesRejectsPathBeforeRemoteAlter() throws Exception {
192+
String tableName = getTableName();
193+
Catalog remoteCatalog = Mockito.mock(Catalog.class);
194+
ExternalCatalog dorisCatalog = Mockito.mock(ExternalCatalog.class);
195+
PaimonMetadataOps propertyOps = newMetadataOps(dorisCatalog, remoteCatalog);
196+
Map<String, String> properties = new LinkedHashMap<>();
197+
properties.put("snapshot.num-retained.max", "10");
198+
properties.put("PATH", "s3://warehouse/relocated_table");
199+
200+
UserException exception = Assert.assertThrows(UserException.class,
201+
() -> propertyOps.updateTableProperties(mockExternalTable(tableName), properties, 123L));
202+
203+
Assert.assertTrue(exception.getMessage().contains("Change path is not supported yet"));
204+
Mockito.verify(remoteCatalog, Mockito.never())
205+
.alterTable(Mockito.any(Identifier.class), Mockito.anyList(), Mockito.anyBoolean());
206+
Mockito.verify(dorisCatalog, Mockito.never()).getDbForReplay(Mockito.anyString());
207+
}
208+
189209
@Test
190210
public void testUpdateTablePropertiesRejectsInvalidBatchAtomically() throws Exception {
191211
String tableName = getTableName();
@@ -449,4 +469,102 @@ public void testDropDB() {
449469
Assert.assertTrue(t.getMessage().contains("database doesn't exist"));
450470
}
451471
}
472+
473+
@Test
474+
public void testCreateDatabaseWithPropertiesForSupportedCatalogs() throws Exception {
475+
List<String> supportedCatalogTypes = Arrays.asList(
476+
PaimonExternalCatalog.PAIMON_HMS,
477+
PaimonExternalCatalog.PAIMON_JDBC,
478+
PaimonExternalCatalog.PAIMON_REST,
479+
PaimonExternalCatalog.PAIMON_DLF);
480+
for (String catalogType : supportedCatalogTypes) {
481+
String remoteDbName = catalogType + "_db";
482+
Catalog remoteCatalog = Mockito.mock(Catalog.class);
483+
PaimonExternalCatalog dorisCatalog = Mockito.mock(PaimonExternalCatalog.class);
484+
Mockito.when(dorisCatalog.getExecutionAuthenticator()).thenReturn(new ExecutionAuthenticator() {});
485+
Mockito.when(dorisCatalog.getCatalogType()).thenReturn(catalogType);
486+
Mockito.doThrow(new Catalog.DatabaseNotExistException(remoteDbName))
487+
.when(remoteCatalog).getDatabase(remoteDbName);
488+
PaimonMetadataOps catalogOps = new PaimonMetadataOps(dorisCatalog, remoteCatalog);
489+
HashMap<String, String> properties = Maps.newHashMap();
490+
properties.put("owner", "doris");
491+
492+
Assert.assertFalse(catalogOps.createDbImpl(remoteDbName, false, properties));
493+
494+
Mockito.verify(remoteCatalog).createDatabase(remoteDbName, false, properties);
495+
}
496+
}
497+
498+
@Test
499+
public void testCreateDatabaseWithLocationForSupportedCatalogs() throws Exception {
500+
List<String> supportedCatalogTypes = Arrays.asList(
501+
PaimonExternalCatalog.PAIMON_HMS,
502+
PaimonExternalCatalog.PAIMON_DLF);
503+
for (String catalogType : supportedCatalogTypes) {
504+
String remoteDbName = catalogType + "_location_db";
505+
Catalog remoteCatalog = Mockito.mock(Catalog.class);
506+
PaimonExternalCatalog dorisCatalog = Mockito.mock(PaimonExternalCatalog.class);
507+
Mockito.when(dorisCatalog.getExecutionAuthenticator()).thenReturn(new ExecutionAuthenticator() {});
508+
Mockito.when(dorisCatalog.getCatalogType()).thenReturn(catalogType);
509+
Mockito.doThrow(new Catalog.DatabaseNotExistException(remoteDbName))
510+
.when(remoteCatalog).getDatabase(remoteDbName);
511+
PaimonMetadataOps catalogOps = new PaimonMetadataOps(dorisCatalog, remoteCatalog);
512+
HashMap<String, String> properties = Maps.newHashMap();
513+
properties.put("location", "s3://warehouse/" + remoteDbName);
514+
515+
Assert.assertFalse(catalogOps.createDbImpl(remoteDbName, false, properties));
516+
517+
Mockito.verify(remoteCatalog).createDatabase(remoteDbName, false, properties);
518+
}
519+
}
520+
521+
@Test
522+
public void testCreateDatabaseWithLocationForCatalogsThatIgnoreItIsRejected() throws Exception {
523+
List<String> unsupportedCatalogTypes = Arrays.asList(
524+
PaimonExternalCatalog.PAIMON_JDBC,
525+
PaimonExternalCatalog.PAIMON_REST);
526+
for (String catalogType : unsupportedCatalogTypes) {
527+
String remoteDbName = catalogType + "_location_db";
528+
Catalog remoteCatalog = Mockito.mock(Catalog.class);
529+
PaimonExternalCatalog dorisCatalog = Mockito.mock(PaimonExternalCatalog.class);
530+
Mockito.when(dorisCatalog.getExecutionAuthenticator()).thenReturn(new ExecutionAuthenticator() {});
531+
Mockito.when(dorisCatalog.getCatalogType()).thenReturn(catalogType);
532+
Mockito.doThrow(new Catalog.DatabaseNotExistException(remoteDbName))
533+
.when(remoteCatalog).getDatabase(remoteDbName);
534+
PaimonMetadataOps catalogOps = new PaimonMetadataOps(dorisCatalog, remoteCatalog);
535+
HashMap<String, String> properties = Maps.newHashMap();
536+
properties.put("location", "s3://warehouse/" + remoteDbName);
537+
538+
DdlException exception = Assert.assertThrows(
539+
DdlException.class,
540+
() -> catalogOps.createDbImpl(remoteDbName, false, properties));
541+
542+
Assert.assertTrue(exception.getMessage().contains(
543+
"database property 'location' for paimon catalog type: " + catalogType));
544+
Mockito.verify(remoteCatalog, Mockito.never())
545+
.createDatabase(Mockito.anyString(), Mockito.anyBoolean(), Mockito.anyMap());
546+
}
547+
}
548+
549+
@Test
550+
public void testCreateDatabaseWithPropertiesForFilesystemCatalogIsRejected() throws Exception {
551+
String filesystemDbName = "filesystem_db";
552+
Catalog remoteCatalog = Mockito.mock(Catalog.class);
553+
PaimonExternalCatalog dorisCatalog = Mockito.mock(PaimonExternalCatalog.class);
554+
Mockito.when(dorisCatalog.getExecutionAuthenticator()).thenReturn(new ExecutionAuthenticator() {});
555+
Mockito.when(dorisCatalog.getCatalogType()).thenReturn(PaimonExternalCatalog.PAIMON_FILESYSTEM);
556+
Mockito.doThrow(new Catalog.DatabaseNotExistException(filesystemDbName))
557+
.when(remoteCatalog).getDatabase(filesystemDbName);
558+
PaimonMetadataOps filesystemOps = new PaimonMetadataOps(dorisCatalog, remoteCatalog);
559+
HashMap<String, String> properties = Maps.newHashMap();
560+
properties.put("owner", "doris");
561+
562+
DdlException exception = Assert.assertThrows(
563+
DdlException.class,
564+
() -> filesystemOps.createDbImpl(filesystemDbName, false, properties));
565+
566+
Assert.assertTrue(exception.getMessage().contains("paimon catalog type: filesystem"));
567+
Mockito.verify(remoteCatalog, Mockito.never())
568+
.createDatabase(Mockito.anyString(), Mockito.anyBoolean(), Mockito.anyMap());
569+
}
452570
}

0 commit comments

Comments
 (0)