bp #39343
This commit is contained in:
@ -194,6 +194,21 @@ public class CreateTableInfo {
|
||||
return ImmutableList.of(tableName);
|
||||
}
|
||||
|
||||
private void checkEngineWithCatalog() {
|
||||
if (engineName.equals(ENGINE_OLAP)) {
|
||||
if (!ctlName.equals(InternalCatalog.INTERNAL_CATALOG_NAME)) {
|
||||
throw new AnalysisException("Cannot create olap table out of internal catalog."
|
||||
+ " Make sure 'engine' type is specified when use the catalog: " + ctlName);
|
||||
}
|
||||
}
|
||||
CatalogIf catalog = Env.getCurrentEnv().getCatalogMgr().getCatalog(ctlName);
|
||||
if (catalog instanceof HMSExternalCatalog && !engineName.equals(ENGINE_HIVE)) {
|
||||
throw new AnalysisException("Hms type catalog can only use `hive` engine.");
|
||||
} else if (catalog instanceof IcebergExternalCatalog && !engineName.equals(ENGINE_ICEBERG)) {
|
||||
throw new AnalysisException("Iceberg type catalog can only use `iceberg` engine.");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* analyze create table info
|
||||
*/
|
||||
@ -231,12 +246,7 @@ public class CreateTableInfo {
|
||||
throw new AnalysisException(e.getMessage(), e);
|
||||
}
|
||||
|
||||
if (engineName.equals(ENGINE_OLAP)) {
|
||||
if (!ctlName.equals(InternalCatalog.INTERNAL_CATALOG_NAME)) {
|
||||
throw new AnalysisException("Cannot create olap table out of internal catalog."
|
||||
+ " Make sure 'engine' type is specified when use the catalog: " + ctlName);
|
||||
}
|
||||
}
|
||||
checkEngineWithCatalog();
|
||||
|
||||
// analyze table name
|
||||
if (Strings.isNullOrEmpty(dbName)) {
|
||||
|
||||
Reference in New Issue
Block a user