Skip to content

Commit

Permalink
Jdbc driver is compatible with multiple versions (#4930)
Browse files Browse the repository at this point in the history
* Jdbc driver is compatible with multiple versions

* code formatting

* Update reference method
  • Loading branch information
sjgllgh authored Oct 23, 2023
1 parent 95f229a commit ec9d7f5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.linkis.ujes.jdbc

import org.apache.linkis.common.utils.{Logging, Utils}
import org.apache.linkis.manager.label.builder.factory.LabelBuilderFactoryContext
import org.apache.linkis.manager.label.constant.LabelKeyConstant
import org.apache.linkis.manager.label.entity.engine.{EngineType, EngineTypeLabel, RunType}
import org.apache.linkis.manager.label.utils.EngineTypeLabelCreator
Expand Down Expand Up @@ -126,7 +127,14 @@ class LinkisSQLConnection(private[jdbc] val ujesClient: UJESClient, props: Prope
if (params != null & params.length() > 0) {
params.split(PARAM_SPLIT).map(_.split(KV_SPLIT)).foreach {
case Array(k, v) if k.equals(UJESSQLDriver.ENGINE_TYPE) =>
return EngineTypeLabelCreator.createEngineTypeLabel(v)
if (v.contains('-')) {
val factory = LabelBuilderFactoryContext.getLabelBuilderFactory
val label = factory.createLabel(classOf[EngineTypeLabel])
label.setStringValue(v)
return label
} else {
return EngineTypeLabelCreator.createEngineTypeLabel(v)
}
case _ =>
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public Boolean isEmpty() {
}

@Override
protected void setStringValue(String stringValue) {
public void setStringValue(String stringValue) {
if (StringUtils.isNotBlank(stringValue)) {
try {
HashMap<String, String> valueMap =
Expand Down

0 comments on commit ec9d7f5

Please sign in to comment.