@@ -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)
359362Status 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)
416425Status 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
0 commit comments