Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,17 @@

package org.apache.doris.datasource.iceberg;

import org.apache.doris.analysis.CreateDbStmt;
import org.apache.doris.analysis.CreateTableStmt;
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;

Expand All @@ -45,4 +52,35 @@ protected void initCatalog() {
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(String dbName, boolean ifExists, boolean force) 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 dropTable(String dbName, String tableName, boolean isView, boolean isMtmv, boolean ifExists,
boolean force) 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'");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -38,4 +41,16 @@ public void testDatabaseList() {
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("", true, true));
Assert.assertThrows(NotSupportedException.class, () -> catalog.createTable(null));
Assert.assertThrows(NotSupportedException.class, () -> catalog.dropTable(null));
Assert.assertThrows(NotSupportedException.class, () -> catalog.dropTable("", "", true, true, true, true));
Assert.assertThrows(NotSupportedException.class, () -> catalog.truncateTable(null));
}
}
Loading