[enhancement](serialize) add dcheck to ensure pb type is set (#24645)
should check the pb's type is set, or the deserialize will core. should not return unknown type because deserialize will core. --------- Co-authored-by: yiguolei <yiguolei@gmail.com>
This commit is contained in:
@ -827,6 +827,7 @@ Status Block::serialize(int be_exec_version, PBlock* pblock,
|
||||
for (const auto& c : *this) {
|
||||
PColumnMeta* pcm = pblock->add_column_metas();
|
||||
c.to_pb_column_meta(pcm);
|
||||
DCHECK(pcm->type() != PGenericType::UNKNOWN) << " forget to set pb type";
|
||||
// get serialized size
|
||||
content_uncompressed_size +=
|
||||
c.type->get_uncompressed_serialized_bytes(*(c.column), pblock->be_exec_version());
|
||||
|
||||
@ -174,6 +174,7 @@ PGenericType_TypeId IDataType::get_pdata_type(const IDataType* data_type) {
|
||||
case TypeIndex::TimeV2:
|
||||
return PGenericType::TIMEV2;
|
||||
default:
|
||||
LOG(FATAL) << fmt::format("could not mapping type {} to pb type", data_type->get_type_id());
|
||||
return PGenericType::UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user