Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions clickhouse/columns/string.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,20 @@ ColumnFixedString::ColumnFixedString(size_t n)
{
}

ColumnFixedString::ColumnFixedString(size_t n, const std::vector<std::string_view>& data)
: ColumnFixedString(n)
{
for (const auto& v : data)
Append(v);
}

ColumnFixedString::ColumnFixedString(size_t n, const std::vector<std::string>& data)
: ColumnFixedString(n)
{
for (const auto& v : data)
Append(v);
}

void ColumnFixedString::Append(std::string_view str) {
if (str.size() > string_size_) {
throw ValidationError("Expected string of length not greater than "
Expand Down
10 changes: 3 additions & 7 deletions clickhouse/columns/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,10 @@ class ColumnFixedString : public Column {

explicit ColumnFixedString(size_t n);

template <typename Values>
ColumnFixedString(size_t n, const Values & values)
Comment thread
1261385937 marked this conversation as resolved.
: ColumnFixedString(n)
{
for (const auto & v : values)
Append(v);
}
explicit ColumnFixedString(size_t n, const std::vector<std::string_view>& data);

explicit ColumnFixedString(size_t n, const std::vector<std::string>& data);

/// Appends one element to the column.
void Append(std::string_view str);

Expand Down
2 changes: 0 additions & 2 deletions clickhouse/query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace clickhouse {

const std::string Query::default_query_id = {};

Query::Query()
{ }

Expand Down
2 changes: 1 addition & 1 deletion clickhouse/query.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class Query : public QueryEvents {
return *this;
}

static const std::string default_query_id;
static constexpr char default_query_id[] = "";

private:
void OnData(const Block& block) override {
Expand Down