From f1c469598571c4a575a510d87a6579dcba2db4d3 Mon Sep 17 00:00:00 2001 From: Mahdi Malverdi Date: Sat, 21 Dec 2024 16:04:46 +0330 Subject: [PATCH] reformat the codes Closes #369 --- .../com/clickhouse/spark/write/ClickHouseWriter.scala | 10 ++++++++-- .../com/clickhouse/spark/write/ClickHouseWriter.scala | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/ClickHouseWriter.scala b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/ClickHouseWriter.scala index 675d552d..6383c1f1 100644 --- a/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/ClickHouseWriter.scala +++ b/spark-3.3/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/ClickHouseWriter.scala @@ -233,8 +233,14 @@ abstract class ClickHouseWriter(writeJob: WriteJobDescription) writeJob.writeOptions.retryInterval ) { var startWriteTime = System.currentTimeMillis - client.syncInsertOutputJSONEachRow(database, table, format, codec, new ByteArrayInputStream(data), settings) - match { + client.syncInsertOutputJSONEachRow( + database, + table, + format, + codec, + new ByteArrayInputStream(data), + settings + ) match { case Right(_) => writeTime = System.currentTimeMillis - startWriteTime _totalWriteTime.add(writeTime) diff --git a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/ClickHouseWriter.scala b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/ClickHouseWriter.scala index 2abb4508..c3d7d106 100644 --- a/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/ClickHouseWriter.scala +++ b/spark-3.4/clickhouse-spark/src/main/scala/com/clickhouse/spark/write/ClickHouseWriter.scala @@ -259,8 +259,14 @@ abstract class ClickHouseWriter(writeJob: WriteJobDescription) writeJob.writeOptions.retryInterval ) { var startWriteTime = System.currentTimeMillis - client.syncInsertOutputJSONEachRow(database, table, format, codec, new ByteArrayInputStream(data), settings) - match { + client.syncInsertOutputJSONEachRow( + database, + table, + format, + codec, + new ByteArrayInputStream(data), + settings + ) match { case Right(_) => writeTime = System.currentTimeMillis - startWriteTime _totalWriteTime.add(writeTime)