diff --git a/core/core-backend/src/main/java/io/dataease/copilot/manage/CopilotManage.java b/core/core-backend/src/main/java/io/dataease/copilot/manage/CopilotManage.java index 16d69f2345..ef986b8dcd 100644 --- a/core/core-backend/src/main/java/io/dataease/copilot/manage/CopilotManage.java +++ b/core/core-backend/src/main/java/io/dataease/copilot/manage/CopilotManage.java @@ -114,7 +114,7 @@ public class CopilotManage { } DatasourceSchemaDTO ds = dsMap.entrySet().iterator().next().getValue(); - String type = ds.getType();// 数据库类型,如mysql,oracle等,可能需要映射成copilot需要的类型 + String type = engine(ds.getType());// 数据库类型,如mysql,oracle等,可能需要映射成copilot需要的类型 datasetDataManage.buildFieldName(sqlMap, allFields); List strings = transCreateTableFields(allFields); @@ -468,4 +468,19 @@ public class CopilotManage { return copilotSQL; } } + + private String engine(String type) { + switch (type) { + case "ck": + return "ClickHouse"; + case "pg": + return "PostgreSQL"; + case "mysql": + return "MySQL"; + case "sqlServer": + return "SQL Server"; + default: + return type; + } + } }