freesinger commented on code in PR #10322: URL: https://github.com/apache/doris/pull/10322#discussion_r933111884
########## be/src/vec/core/field.h: ########## @@ -572,13 +671,21 @@ class Field { create(reinterpret_cast<const char*>(data), size); } + void create_json(const unsigned char* data, size_t size) { + new (&storage) JsonField(reinterpret_cast<const char*>(data), size); + which = Types::JSON; + } + ALWAYS_INLINE void destroy() { if (which < Types::MIN_NON_POD) return; switch (which) { case Types::String: destroy<String>(); break; + case Types::JSON: + destroy<JsonField>(); Review Comment: ```C++ template <typename T> void destroy() { T* MAY_ALIAS ptr = reinterpret_cast<T*>(&storage); ptr->~T(); } ``` [Line707](https://github.com/freesinger/incubator-doris/blob/878d392fb89991c9e80f9fff0936fe3ce97350de/be/src/vec/core/field.h#L707) -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org