Skip to content

Commit

Permalink
Dev 1.10.0 sdk support shell return (#670)
Browse files Browse the repository at this point in the history
* Add a method to obtain the result set, getResultSet is used to obtain the result set

* jdbc driver support shell return

* jdbc driver support shell return

* Code optimization

---------

Co-authored-by: “v_kkhuang” <“[email protected]”>
  • Loading branch information
v-kkhuang and “v_kkhuang” authored Dec 13, 2024
1 parent 4b0c2db commit 46a1d1d
Showing 1 changed file with 17 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,23 @@ class UJESSQLResultSet(
if (null == resultSetResult) {
return
}
metaData = resultSetResult.getMetadata.asInstanceOf[util.List[util.Map[String, String]]]
if (null != metaData) {
for (cursor <- 1 to metaData.size()) {
val col = metaData.get(cursor - 1)
resultSetMetaData.setColumnNameProperties(cursor, col.get("columnName"))
resultSetMetaData.setDataTypeProperties(cursor, col.get("dataType"))
resultSetMetaData.setCommentPropreties(cursor, col.get("comment"))
val metaTmp = resultSetResult.getMetadata
if ("NULL".equals(String.valueOf(metaTmp))) {
val fileContentList = resultSetResult.getFileContent.asInstanceOf[util.List[util.List[String]]]
if (null != fileContentList) {
resultSetMetaData.setColumnNameProperties(1, "linkis_string")
resultSetMetaData.setDataTypeProperties(1, "String")
resultSetMetaData.setCommentPropreties(1, "NULL")
}
} else {
metaData = metaTmp.asInstanceOf[util.List[util.Map[String, String]]]
if (null != metaData) {
for (cursor <- 1 to metaData.size()) {
val col = metaData.get(cursor - 1)
resultSetMetaData.setColumnNameProperties(cursor, col.get("columnName"))
resultSetMetaData.setDataTypeProperties(cursor, col.get("dataType"))
resultSetMetaData.setCommentPropreties(cursor, col.get("comment"))
}
}
}
}
Expand All @@ -194,12 +204,6 @@ class UJESSQLResultSet(
resultSetResult.getFileContent.asInstanceOf[util.ArrayList[util.ArrayList[String]]]
}

def getResultSet(): util.ArrayList[util.ArrayList[String]] = {
resultSetResultInit()
resultSetInit()
resultSetRow
}

private def init(): Unit = {
resultSetResultInit()
metaDataInit()
Expand Down

0 comments on commit 46a1d1d

Please sign in to comment.