Skip to content

Commit 39580ca

Browse files
committed
chore: lint
1 parent 75a56f0 commit 39580ca

File tree

3 files changed

+32
-20
lines changed

3 files changed

+32
-20
lines changed

google/cloud/bigtable/internal/partial_result_set_source.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@ Status PartialResultSetSource::BufferProtoRows() {
229229

230230
while (parsed_value != proto_values.end()) {
231231
for (auto const& column : proto_schema.columns()) {
232-
auto type_value_match_result = bigtable::Value::TypeAndValuesMatch(column.type(),
233-
*parsed_value);
232+
auto type_value_match_result =
233+
bigtable::Value::TypeAndValuesMatch(column.type(), *parsed_value);
234234
if (!type_value_match_result.ok()) {
235235
return type_value_match_result;
236236
}

google/cloud/bigtable/value.cc

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -340,14 +340,17 @@ std::ostream& operator<<(std::ostream& os, Value const& v) {
340340
}
341341

342342
// NOLINTNEXTLINE(misc-no-recursion)
343-
Status Value::TypeAndArrayValuesMatch(google::bigtable::v2::Type const& type,
344-
google::bigtable::v2::Value const& value) {
343+
Status Value::TypeAndArrayValuesMatch(
344+
google::bigtable::v2::Type const& type,
345+
google::bigtable::v2::Value const& value) {
345346
if (!value.has_array_value()) {
346-
return internal::InternalError("Value kind must be ARRAY_VALUE for columns of type: MAP");
347+
return internal::InternalError(
348+
"Value kind must be ARRAY_VALUE for columns of type: MAP");
347349
}
348350
auto const& vals = value.array_value().values();
349351
for (auto const& val : vals) {
350-
auto const element_match_result = TypeAndValuesMatch(type.array_type().element_type(), val);
352+
auto const element_match_result =
353+
TypeAndValuesMatch(type.array_type().element_type(), val);
351354
if (!element_match_result.ok()) {
352355
return element_match_result;
353356
}
@@ -357,16 +360,18 @@ Status Value::TypeAndArrayValuesMatch(google::bigtable::v2::Type const& type,
357360

358361
// NOLINTNEXTLINE(misc-no-recursion)
359362
Status Value::TypeAndMapValuesMatch(google::bigtable::v2::Type const& type,
360-
google::bigtable::v2::Value const& value) {
363+
google::bigtable::v2::Value const& value) {
361364
if (!value.has_array_value()) {
362-
return internal::InternalError("Value kind must be ARRAY_VALUE for columns of type: MAP");
365+
return internal::InternalError(
366+
"Value kind must be ARRAY_VALUE for columns of type: MAP");
363367
}
364368
auto key_type = type.map_type().key_type();
365369
auto value_type = type.map_type().value_type();
366370
auto const& vals = value.array_value().values();
367371
for (auto const& val : vals) {
368372
if (!val.has_array_value() || val.array_value().values_size() != 2) {
369-
return internal::InternalError("ARRAY_VALUE must contain entries of 2 values");
373+
return internal::InternalError(
374+
"ARRAY_VALUE must contain entries of 2 values");
370375
}
371376
auto map_key = val.array_value().values(0);
372377
auto map_value = val.array_value().values(1);
@@ -385,15 +390,19 @@ Status Value::TypeAndMapValuesMatch(google::bigtable::v2::Type const& type,
385390
}
386391

387392
// NOLINTNEXTLINE(misc-no-recursion)
388-
Status Value::TypeAndStructValuesMatch(google::bigtable::v2::Type const& type,
389-
google::bigtable::v2::Value const& value) {
393+
Status Value::TypeAndStructValuesMatch(
394+
google::bigtable::v2::Type const& type,
395+
google::bigtable::v2::Value const& value) {
390396
if (!value.has_array_value()) {
391-
return internal::InternalError("Value kind must be ARRAY_VALUE for columns of type: STRUCT");
397+
return internal::InternalError(
398+
"Value kind must be ARRAY_VALUE for columns of type: STRUCT");
392399
}
393400
auto fields = type.struct_type().fields();
394401
auto values = value.array_value().values();
395402
if (fields.size() != values.size()) {
396-
auto const message = absl::Substitute("received Struct with $0 values, but metadata has $1 fields", values.size(), fields.size());
403+
auto const message = absl::Substitute(
404+
"received Struct with $0 values, but metadata has $1 fields",
405+
values.size(), fields.size());
397406
return internal::InternalError(message);
398407
}
399408
for (int i = 0; i < fields.size(); ++i) {
@@ -414,10 +423,12 @@ Status Value::TypeAndStructValuesMatch(google::bigtable::v2::Type const& type,
414423
*/
415424
// NOLINTNEXTLINE(misc-no-recursion)
416425
Status Value::TypeAndValuesMatch(google::bigtable::v2::Type const& type,
417-
google::bigtable::v2::Value const& value) {
426+
google::bigtable::v2::Value const& value) {
418427
using google::bigtable::v2::Type;
419-
auto make_mismatch_metadata_status = [&](std::string const& value_kind, std::string const& type_name) {
420-
auto const message = absl::Substitute("Value kind must be $0 for columns of type: $1", value_kind, type_name);
428+
auto make_mismatch_metadata_status = [&](std::string const& value_kind,
429+
std::string const& type_name) {
430+
auto const message = absl::Substitute(
431+
"Value kind must be $0 for columns of type: $1", value_kind, type_name);
421432
return internal::InternalError(message);
422433
};
423434
// Null values are allowed by default

google/cloud/bigtable/value.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,13 +316,14 @@ class Value {
316316
}
317317

318318
static Status TypeAndValuesMatch(google::bigtable::v2::Type const& type,
319-
google::bigtable::v2::Value const& value);
319+
google::bigtable::v2::Value const& value);
320320

321321
private:
322-
static Status TypeAndArrayValuesMatch(google::bigtable::v2::Type const& type,
323-
google::bigtable::v2::Value const& value);
322+
static Status TypeAndArrayValuesMatch(
323+
google::bigtable::v2::Type const& type,
324+
google::bigtable::v2::Value const& value);
324325
static Status TypeAndMapValuesMatch(google::bigtable::v2::Type const& type,
325-
google::bigtable::v2::Value const& value);
326+
google::bigtable::v2::Value const& value);
326327
static Status TypeAndStructValuesMatch(
327328
google::bigtable::v2::Type const& type,
328329
google::bigtable::v2::Value const& value);

0 commit comments

Comments
 (0)