Skip to content

Commit

Permalink
Core: Remove usage of ClickHouse client deprecated API (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
pan3793 committed Feb 6, 2024
1 parent 0ddb752 commit 83dae96
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class NodeClient(val nodeSpec: NodeSpec) extends AutoCloseable with Logging {
val queryId = nextQueryId()
val sql = s"INSERT INTO `$database`.`$table` FORMAT $inputFormat"
onExecuteQuery(queryId, sql)
val req = client.connect(node).write()
val req = client.write(node)
.query(sql, queryId)
.decompressClientRequest(inputCompressionType)
.format(ClickHouseFormat.valueOf(outputFormat))
Expand All @@ -131,7 +131,7 @@ class NodeClient(val nodeSpec: NodeSpec) extends AutoCloseable with Logging {
): Either[CHException, SimpleOutput[OUT]] = {
val queryId = nextQueryId()
onExecuteQuery(queryId, sql)
val req = client.connect(node)
val req = client.read(node)
.query(sql, queryId).asInstanceOf[ClickHouseRequest[_]]
.format(ClickHouseFormat.valueOf(outputFormat)).asInstanceOf[ClickHouseRequest[_]]
settings.foreach { case (k, v) => req.set(k, v).asInstanceOf[ClickHouseRequest[_]] }
Expand Down Expand Up @@ -165,7 +165,7 @@ class NodeClient(val nodeSpec: NodeSpec) extends AutoCloseable with Logging {
): ClickHouseResponse = {
val queryId = nextQueryId()
onExecuteQuery(queryId, sql)
val req = client.connect(node)
val req = client.read(node)
.query(sql, queryId).asInstanceOf[ClickHouseRequest[_]]
.compressServerResponse(outputCompressionType).asInstanceOf[ClickHouseRequest[_]]
.format(ClickHouseFormat.valueOf(outputFormat)).asInstanceOf[ClickHouseRequest[_]]
Expand Down

0 comments on commit 83dae96

Please sign in to comment.