yiguolei commented on code in PR #68664:
URL: https://github.com/apache/doris/pull/68664#discussion_r4145170953
##########
be/src/core/data_type/storage_field_type.h:
##########
@@ -17,16 +17,199 @@
#pragma once
+#include "common/exception.h"
#include "core/data_type/define_primitive_type.h"
+#include "storage/field_type.h"
namespace doris {
-enum class FieldType;
+// The FieldType a segment stores a PrimitiveType's values as, and back. Both
+// directions are constexpr, so a template can pick the storage traits of a
+// compute-layer type; at run time an unmapped type throws.
-// Throws Exception when the primitive type has no storage field type mapping.
-[[nodiscard]] FieldType primitive_type_to_storage_field_type(PrimitiveType
type);
+// NOLINTNEXTLINE(readability-function-size): keep the exhaustive mapping
together for auditability.
+constexpr FieldType primitive_type_to_storage_field_type(PrimitiveType type) {
Review Comment:
这个跟PrimitiveTypeTraits 这里的定义是啥区别?
template <>
struct PrimitiveTypeTraits<TYPE_BOOLEAN> {
using CppType = UInt8;
using StorageFieldType = CppType;
using DataType = DataTypeBool;
using ColumnType = ColumnUInt8;
};
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]