This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.1 by this push:
new 03b26066960 [opt](catalog) throw explict error when operation is not
supported (#51589) (#51723)
03b26066960 is described below
commit 03b260669606633d7b537febf3e7f06a419a48b8
Author: Mingyu Chen (Rayner) <[email protected]>
AuthorDate: Mon Jun 16 17:09:14 2025 +0800
[opt](catalog) throw explict error when operation is not supported (#51589)
(#51723)
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 81d3e15d90f..bd3d966ac37 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
@@ -206,14 +206,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();
}
@@ -983,8 +982,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);
@@ -998,8 +996,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);
@@ -1013,8 +1010,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);
@@ -1028,8 +1024,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);
@@ -1126,7 +1121,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]