From e0a7ced0ee96319ad16882b91c16c8f7be5ad6cd Mon Sep 17 00:00:00 2001 From: aiceflower Date: Mon, 13 Jan 2025 12:59:59 +0800 Subject: [PATCH] code optimization --- .../manager/engineplugin/jdbc/conf/JDBCConfiguration.scala | 2 +- .../linkis/manager/engineplugin/jdbc/executor/JDBCHelper.java | 2 +- .../engineplugin/jdbc/executor/JDBCMultiDatasourceParser.scala | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/linkis-engineconn-plugins/jdbc/src/main/scala/org/apache/linkis/manager/engineplugin/jdbc/conf/JDBCConfiguration.scala b/linkis-engineconn-plugins/jdbc/src/main/scala/org/apache/linkis/manager/engineplugin/jdbc/conf/JDBCConfiguration.scala index 819110e229..4d262b6db4 100644 --- a/linkis-engineconn-plugins/jdbc/src/main/scala/org/apache/linkis/manager/engineplugin/jdbc/conf/JDBCConfiguration.scala +++ b/linkis-engineconn-plugins/jdbc/src/main/scala/org/apache/linkis/manager/engineplugin/jdbc/conf/JDBCConfiguration.scala @@ -32,7 +32,7 @@ object JDBCConfiguration { val JDBC_KERBEROS_ENABLE = CommonVars[Boolean]("wds.linkis.keytab.enable", false) - val CHANGE_DS_TYPE_TO_MYSQL = CommonVars[Boolean]("linkis.change.ds.type.to.mysql", true).getValue + val CHANGE_DS_TYPE_TO_MYSQL = CommonVars[String]("linkis.change.ds.type.to.mysql", "starrocks").getValue val DS_TYPES_TO_EXECUTE_TASK_BY_JDBC = CommonVars[String]("linkis.can.execute.task.ds.types.by.jdbc", "starrocks").getValue diff --git a/linkis-engineconn-plugins/jdbc/src/main/scala/org/apache/linkis/manager/engineplugin/jdbc/executor/JDBCHelper.java b/linkis-engineconn-plugins/jdbc/src/main/scala/org/apache/linkis/manager/engineplugin/jdbc/executor/JDBCHelper.java index 8117c617de..b3c0ea37bd 100644 --- a/linkis-engineconn-plugins/jdbc/src/main/scala/org/apache/linkis/manager/engineplugin/jdbc/executor/JDBCHelper.java +++ b/linkis-engineconn-plugins/jdbc/src/main/scala/org/apache/linkis/manager/engineplugin/jdbc/executor/JDBCHelper.java @@ -146,7 +146,7 @@ public static String getTypeStr(int type) { retVal = BinaryType.typeName(); break; case Types.DECIMAL: - retVal = new DecimalType("decimal", 3).typeName(); + retVal = StringType.typeName(); break; case Types.ARRAY: retVal = ArrayType.typeName(); diff --git a/linkis-engineconn-plugins/jdbc/src/main/scala/org/apache/linkis/manager/engineplugin/jdbc/executor/JDBCMultiDatasourceParser.scala b/linkis-engineconn-plugins/jdbc/src/main/scala/org/apache/linkis/manager/engineplugin/jdbc/executor/JDBCMultiDatasourceParser.scala index f6605791a8..06748445ee 100644 --- a/linkis-engineconn-plugins/jdbc/src/main/scala/org/apache/linkis/manager/engineplugin/jdbc/executor/JDBCMultiDatasourceParser.scala +++ b/linkis-engineconn-plugins/jdbc/src/main/scala/org/apache/linkis/manager/engineplugin/jdbc/executor/JDBCMultiDatasourceParser.scala @@ -137,7 +137,7 @@ object JDBCMultiDatasourceParser extends Logging { MessageFormat.format(UNSUPPORTED_DS_TYPE.getErrorDesc, dbType) ) } - if (CHANGE_DS_TYPE_TO_MYSQL) { + if (CHANGE_DS_TYPE_TO_MYSQL.contains(dbType)) { dbType = "mysql" }