This is an automated email from the ASF dual-hosted git repository.

morrysnow pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.1 by this push:
     new 1d2dbde38a5 branch-3.1: [opt](catalog) throw explict error when 
operation is not supported #51589 (#52469)
1d2dbde38a5 is described below

commit 1d2dbde38a52c7f09c6678df6f10e03131008238
Author: Mingyu Chen (Rayner) <[email protected]>
AuthorDate: Mon Jun 30 10:40:13 2025 +0800

    branch-3.1: [opt](catalog) throw explict error when operation is not 
supported #51589 (#52469)
    
    bp #51589
---
 .../org/apache/doris/datasource/ExternalCatalog.java  | 19 +++++++------------
 1 file changed, 7 insertions(+), 12 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 9ad0aa3b8b9..439254bf9eb 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
@@ -225,14 +225,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();
         }
@@ -1002,8 +1001,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);
@@ -1025,8 +1023,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);
@@ -1048,8 +1045,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 {
             boolean res = metadataOps.createTable(stmt);
@@ -1075,8 +1071,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);
@@ -1181,7 +1176,7 @@ public abstract class ExternalCatalog
     public void truncateTable(TruncateTableStmt stmt) throws DdlException {
         makeSureInitialized();
         if (metadataOps == null) {
-            throw new UnsupportedOperationException("Truncate table not 
supported in " + getName());
+            throw new DdlException("Truncate table is not supported for 
catalog: " + getName());
         }
         try {
             TableRef tableRef = stmt.getTblRef();


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

Reply via email to