aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/clickhouse/client/client.cpp
diff options
context:
space:
mode:
authorAlexSm <alex@ydb.tech>2024-01-04 15:09:05 +0100
committerGitHub <noreply@github.com>2024-01-04 15:09:05 +0100
commitdab291146f6cd7d35684e3a1150e5bb1c412982c (patch)
tree36ef35f6cacb6432845a4a33f940c95871036b32 /library/cpp/clickhouse/client/client.cpp
parent63660ad5e7512029fd0218e7a636580695a24e1f (diff)
downloadydb-dab291146f6cd7d35684e3a1150e5bb1c412982c.tar.gz
Library import 5, delete go dependencies (#832)
* Library import 5, delete go dependencies * Fix yt client
Diffstat (limited to 'library/cpp/clickhouse/client/client.cpp')
-rw-r--r--library/cpp/clickhouse/client/client.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/library/cpp/clickhouse/client/client.cpp b/library/cpp/clickhouse/client/client.cpp
index b0b2613bb5..576731ed76 100644
--- a/library/cpp/clickhouse/client/client.cpp
+++ b/library/cpp/clickhouse/client/client.cpp
@@ -64,7 +64,7 @@ namespace NClickHouse {
void ExecuteQuery(TQuery query);
- void Insert(const TString& table_name, const TBlock& block);
+ void Insert(const TString& table_name, const TBlock& block, const TString& query_id);
void Ping();
@@ -75,7 +75,7 @@ namespace NClickHouse {
bool ReceivePacket(ui64* server_packet = nullptr);
- void SendQuery(const TString& query);
+ void SendQuery(const TString& query, const TString& query_id);
void SendData(const TBlock& block);
@@ -183,7 +183,7 @@ namespace NClickHouse {
RetryGuard([this]() { Ping(); });
}
- SendQuery(query.GetText());
+ SendQuery(query.GetText(), query.GetId());
ui64 server_packet = 0;
while (ReceivePacket(&server_packet)) {
@@ -195,7 +195,7 @@ namespace NClickHouse {
}
}
- void TClient::TImpl::Insert(const TString& table_name, const TBlock& block) {
+ void TClient::TImpl::Insert(const TString& table_name, const TBlock& block, const TString& query_id) {
if (Options_.PingBeforeQuery) {
RetryGuard([this]() { Ping(); });
}
@@ -216,7 +216,7 @@ namespace NClickHouse {
}
}
- SendQuery("INSERT INTO " + table_name + " ( " + fields_section + " ) VALUES");
+ SendQuery("INSERT INTO " + table_name + " ( " + fields_section + " ) VALUES", query_id);
ui64 server_packet(0);
// Receive data packet.
@@ -536,9 +536,9 @@ namespace NClickHouse {
return exception_received;
}
- void TClient::TImpl::SendQuery(const TString& query) {
+ void TClient::TImpl::SendQuery(const TString& query, const TString& query_id) {
TWireFormat::WriteUInt64(&Output_, ClientCodes::Query);
- TWireFormat::WriteString(&Output_, TString());
+ TWireFormat::WriteString(&Output_, query_id);
/// Client info.
if (ServerInfo_.Revision >= DBMS_MIN_REVISION_WITH_CLIENT_INFO) {
@@ -744,16 +744,16 @@ namespace NClickHouse {
Impl_->ExecuteQuery(query);
}
- void TClient::Select(const TString& query, TSelectCallback cb) {
- Execute(TQuery(query).OnData(cb));
+ void TClient::Select(const TString& query, TSelectCallback cb, const TString& query_id) {
+ Execute(TQuery(query, query_id).OnData(cb));
}
void TClient::Select(const TQuery& query) {
Execute(query);
}
- void TClient::Insert(const TString& table_name, const TBlock& block) {
- Impl_->Insert(table_name, block);
+ void TClient::Insert(const TString& table_name, const TBlock& block, const TString& query_id) {
+ Impl_->Insert(table_name, block, query_id);
}
void TClient::Ping() {