This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.0 by this push:
new 35cea9644b [enhancement](serialize) add dcheck to ensure pb type is
set (#24645)
35cea9644b is described below
commit 35cea9644bb52e231e6eac4fa9c375772fcf4f1e
Author: yiguolei <[email protected]>
AuthorDate: Wed Sep 20 10:42:28 2023 +0800
[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 <[email protected]>
---
be/src/vec/core/block.cpp | 1 +
be/src/vec/data_types/data_type.cpp | 1 +
2 files changed, 2 insertions(+)
diff --git a/be/src/vec/core/block.cpp b/be/src/vec/core/block.cpp
index ec07e7fc17..7a5505b42b 100644
--- a/be/src/vec/core/block.cpp
+++ b/be/src/vec/core/block.cpp
@@ -823,6 +823,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());
diff --git a/be/src/vec/data_types/data_type.cpp
b/be/src/vec/data_types/data_type.cpp
index 7ab7a99ca3..8b7a094dcf 100644
--- a/be/src/vec/data_types/data_type.cpp
+++ b/be/src/vec/data_types/data_type.cpp
@@ -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;
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]