This is an automated email from the ASF dual-hosted git repository.
dataroaring pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-3.0 by this push:
new 868cc911b2a [fix](iceberg)Table operations are not supported for
catalogs of the dlf type for 3.0 #50696 (#50956)
868cc911b2a is described below
commit 868cc911b2a7914ab7658996e5679bda6c841b88
Author: wuwenchi <[email protected]>
AuthorDate: Tue Jun 24 16:05:34 2025 +0800
[fix](iceberg)Table operations are not supported for catalogs of the dlf
type for 3.0 #50696 (#50956)
bp: #50696
---
.../iceberg/IcebergDLFExternalCatalog.java | 33 ++++++++++++++++++++++
.../dlf/client/IcebergDLFExternalCatalogTest.java | 15 ++++++++++
2 files changed, 48 insertions(+)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergDLFExternalCatalog.java
b/fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergDLFExternalCatalog.java
index d3f192754ab..048117bce53 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergDLFExternalCatalog.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergDLFExternalCatalog.java
@@ -17,10 +17,18 @@
package org.apache.doris.datasource.iceberg;
+import org.apache.doris.analysis.CreateDbStmt;
+import org.apache.doris.analysis.CreateTableStmt;
+import org.apache.doris.analysis.DropDbStmt;
+import org.apache.doris.analysis.DropTableStmt;
+import org.apache.doris.analysis.TruncateTableStmt;
+import org.apache.doris.common.DdlException;
+import org.apache.doris.common.UserException;
import org.apache.doris.datasource.CatalogProperty;
import org.apache.doris.datasource.iceberg.dlf.DLFCatalog;
import org.apache.doris.datasource.property.PropertyConverter;
import org.apache.doris.datasource.property.constants.HMSProperties;
+import org.apache.doris.nereids.exceptions.NotSupportedException;
import java.util.Map;
@@ -45,4 +53,29 @@ public class IcebergDLFExternalCatalog extends
IcebergExternalCatalog {
dlfCatalog.initialize(catalogName, catalogProperties);
catalog = dlfCatalog;
}
+
+ @Override
+ public void createDb(CreateDbStmt stmt) throws DdlException {
+ throw new NotSupportedException("iceberg catalog with dlf type not
supports 'create database'");
+ }
+
+ @Override
+ public void dropDb(DropDbStmt stmt) throws DdlException {
+ throw new NotSupportedException("iceberg catalog with dlf type not
supports 'drop database'");
+ }
+
+ @Override
+ public boolean createTable(CreateTableStmt stmt) throws UserException {
+ throw new NotSupportedException("iceberg catalog with dlf type not
supports 'create table'");
+ }
+
+ @Override
+ public void dropTable(DropTableStmt stmt) throws DdlException {
+ throw new NotSupportedException("iceberg catalog with dlf type not
supports 'drop table'");
+ }
+
+ @Override
+ public void truncateTable(TruncateTableStmt stmt) throws DdlException {
+ throw new NotSupportedException("iceberg catalog with dlf type not
supports 'truncate table'");
+ }
}
diff --git
a/fe/fe-core/src/test/java/org/apache/doris/datasource/iceberg/dlf/client/IcebergDLFExternalCatalogTest.java
b/fe/fe-core/src/test/java/org/apache/doris/datasource/iceberg/dlf/client/IcebergDLFExternalCatalogTest.java
index bbd39b7b71b..b14f5a217b3 100644
---
a/fe/fe-core/src/test/java/org/apache/doris/datasource/iceberg/dlf/client/IcebergDLFExternalCatalogTest.java
+++
b/fe/fe-core/src/test/java/org/apache/doris/datasource/iceberg/dlf/client/IcebergDLFExternalCatalogTest.java
@@ -17,6 +17,9 @@
package org.apache.doris.datasource.iceberg.dlf.client;
+import org.apache.doris.datasource.iceberg.IcebergDLFExternalCatalog;
+import org.apache.doris.nereids.exceptions.NotSupportedException;
+
import org.apache.hadoop.conf.Configuration;
import org.junit.Assert;
import org.junit.Test;
@@ -38,4 +41,16 @@ public class IcebergDLFExternalCatalogTest {
Assert.assertNotSame(dlfClientPool1, dlfClientPool2);
}
+
+ @Test
+ public void testNotSupportOperation() {
+ HashMap<String, String> props = new HashMap<>();
+ IcebergDLFExternalCatalog catalog = new IcebergDLFExternalCatalog(1,
"test", "test", props, "test");
+ Assert.assertThrows(NotSupportedException.class, () ->
catalog.createDb(null));
+ Assert.assertThrows(NotSupportedException.class, () ->
catalog.dropDb(null));
+ Assert.assertThrows(NotSupportedException.class, () ->
catalog.createTable(null));
+ Assert.assertThrows(NotSupportedException.class, () ->
catalog.dropTable(null));
+ Assert.assertThrows(NotSupportedException.class, () ->
catalog.dropTable(null));
+ Assert.assertThrows(NotSupportedException.class, () ->
catalog.truncateTable(null));
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]