From 31d799e5d58c3fd26cd142450adc59f69467ce18 Mon Sep 17 00:00:00 2001 From: BugsGuru Date: Fri, 27 Feb 2026 14:17:11 +0800 Subject: [PATCH 1/2] feat: add support for Hive and DM database types in constant definitions - Updated SupportedDataExportDBTypes to include DBTypeHive and DBTypeDM for improved database type management. --- internal/dms/pkg/constant/const.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/dms/pkg/constant/const.go b/internal/dms/pkg/constant/const.go index 97dea141..3bde6303 100644 --- a/internal/dms/pkg/constant/const.go +++ b/internal/dms/pkg/constant/const.go @@ -273,6 +273,8 @@ var SupportedDataExportDBTypes = map[DBType]struct{}{ DBTypeOracle: {}, DBTypeSQLServer: {}, DBTypeOceanBaseMySQL: {}, + DBTypeHive: {}, + DBTypeDM: {}, } type FilterCondition struct { From da5e24bcaa6907018c1a58a23072f50e5b97626a Mon Sep 17 00:00:00 2001 From: BugsGuru Date: Fri, 27 Feb 2026 14:18:18 +0800 Subject: [PATCH 2/2] fix: database type export support check --- internal/dms/biz/db_service.go | 3 +-- internal/dms/pkg/constant/const.go | 11 ++++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/internal/dms/biz/db_service.go b/internal/dms/biz/db_service.go index 46622e2e..7350d9d1 100644 --- a/internal/dms/biz/db_service.go +++ b/internal/dms/biz/db_service.go @@ -484,8 +484,7 @@ func filterExportSupportedDb(dbServices []*DBService, opPermissionType dmsCommon } ret := make([]*DBService, 0) for _, item := range dbServices { - _, ok := pkgConst.SupportedDataExportDBTypes[pkgConst.DBType(item.DBType)] - if ok { + if pkgConst.CheckDBTypeIfDataExportSupported(item.DBType) { ret = append(ret, item) } } diff --git a/internal/dms/pkg/constant/const.go b/internal/dms/pkg/constant/const.go index 3bde6303..fbe4a798 100644 --- a/internal/dms/pkg/constant/const.go +++ b/internal/dms/pkg/constant/const.go @@ -267,7 +267,7 @@ const ( DBTypeGaussDB DBType = "GaussDB / openGauss" ) -var SupportedDataExportDBTypes = map[DBType]struct{}{ +var supportedDataExportDBTypes = map[DBType]struct{}{ DBTypeMySQL: {}, DBTypePostgreSQL: {}, DBTypeOracle: {}, @@ -277,6 +277,15 @@ var SupportedDataExportDBTypes = map[DBType]struct{}{ DBTypeDM: {}, } +func CheckDBTypeIfDataExportSupported(dbtype string) bool { + dbType, err := ParseDBType(dbtype) + if err != nil { + return false + } + _, ok := supportedDataExportDBTypes[dbType] + return ok +} + type FilterCondition struct { // Filter For Preload Table Table string