mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-18 20:32:43 +00:00
Fixes addressing review comments
This commit is contained in:
parent
11371e886c
commit
490efd2efa
@ -53,6 +53,7 @@ namespace ErrorCodes
|
||||
{
|
||||
extern const int NO_COLUMNS_SERIALIZED_TO_PROTOBUF_FIELDS;
|
||||
extern const int MULTIPLE_COLUMNS_SERIALIZED_TO_SAME_PROTOBUF_FIELD;
|
||||
extern const int NO_COLUMN_SERIALIZED_TO_REQUIRED_PROTOBUF_FIELD;
|
||||
extern const int DATA_TYPE_INCOMPATIBLE_WITH_PROTOBUF_FIELD;
|
||||
extern const int PROTOBUF_FIELD_NOT_REPEATED;
|
||||
extern const int PROTOBUF_BAD_CAST;
|
||||
@ -167,8 +168,6 @@ namespace
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
if (field_descriptor.options().has_packed())
|
||||
return field_descriptor.options().packed();
|
||||
return field_descriptor.is_packed();
|
||||
}
|
||||
|
||||
@ -3444,6 +3443,20 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
/// Check that we've found matching columns for all the required fields.
|
||||
if (reader_or_writer.writer)
|
||||
{
|
||||
for (int i : collections::range(message_descriptor.field_count()))
|
||||
{
|
||||
const auto & field_descriptor = *message_descriptor.field(i);
|
||||
if (field_descriptor.is_required() && !field_descriptors_in_use.count(&field_descriptor))
|
||||
throw Exception(
|
||||
ErrorCodes::NO_COLUMN_SERIALIZED_TO_REQUIRED_PROTOBUF_FIELD,
|
||||
"Field {} is required to be set",
|
||||
quoteString(field_descriptor.full_name()));
|
||||
}
|
||||
}
|
||||
|
||||
if (field_descs.empty())
|
||||
return nullptr;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user