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 da4ddf853d3 branch-3.0: [opt](catalog) throw explicit error when 
operation is not supported(#51589) (#52199)
da4ddf853d3 is described below

commit da4ddf853d311f25981a66be1b4caa123f37c1c4
Author: Mingyu Chen (Rayner) <[email protected]>
AuthorDate: Tue Jun 24 18:13:40 2025 +0800

    branch-3.0: [opt](catalog) throw explicit error when operation is not 
supported(#51589) (#52199)
    
    bp #51589
---
 .../org/apache/doris/datasource/ExternalCatalog.java    | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/datasource/ExternalCatalog.java 
b/fe/fe-core/src/main/java/org/apache/doris/datasource/ExternalCatalog.java
index 0b391ca0435..23d6cb958d4 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/datasource/ExternalCatalog.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/ExternalCatalog.java
@@ -219,14 +219,13 @@ public abstract class ExternalCatalog
     }
 
     /**
-     * set some default properties when creating catalog
+     * Lists all database names in this catalog.
      *
      * @return list of database names in this catalog
      */
     protected List<String> listDatabaseNames() {
         if (metadataOps == null) {
-            throw new UnsupportedOperationException("Unsupported operation: "
-                    + "listDatabaseNames from remote client when init catalog 
with " + logType.name());
+            throw new UnsupportedOperationException("List databases is not 
supported for catalog: " + getName());
         } else {
             return metadataOps.listDatabaseNames();
         }
@@ -1001,8 +1000,7 @@ public abstract class ExternalCatalog
     public void createDb(CreateDbStmt stmt) throws DdlException {
         makeSureInitialized();
         if (metadataOps == null) {
-            LOG.warn("createDb not implemented");
-            return;
+            throw new DdlException("Create database is not supported for 
catalog: " + getName());
         }
         try {
             metadataOps.createDb(stmt);
@@ -1016,8 +1014,7 @@ public abstract class ExternalCatalog
     public void dropDb(DropDbStmt stmt) throws DdlException {
         makeSureInitialized();
         if (metadataOps == null) {
-            LOG.warn("dropDb not implemented");
-            return;
+            throw new DdlException("Drop database is not supported for 
catalog: " + getName());
         }
         try {
             metadataOps.dropDb(stmt);
@@ -1031,8 +1028,7 @@ public abstract class ExternalCatalog
     public boolean createTable(CreateTableStmt stmt) throws UserException {
         makeSureInitialized();
         if (metadataOps == null) {
-            LOG.warn("createTable not implemented");
-            return false;
+            throw new DdlException("Create table is not supported for catalog: 
" + getName());
         }
         try {
             return metadataOps.createTable(stmt);
@@ -1046,8 +1042,7 @@ public abstract class ExternalCatalog
     public void dropTable(DropTableStmt stmt) throws DdlException {
         makeSureInitialized();
         if (metadataOps == null) {
-            LOG.warn("dropTable not implemented");
-            return;
+            throw new DdlException("Drop table is not supported for catalog: " 
+ getName());
         }
         try {
             metadataOps.dropTable(stmt);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to