github-actions[bot] commented on code in PR #40573: URL: https://github.com/apache/doris/pull/40573#discussion_r1795198533
########## be/src/vec/columns/column_object.cpp: ########## @@ -341,7 +345,44 @@ void get_field_info_impl(const Field& field, FieldInfo* info) { }; } +void get_base_field_info(const Field& field, FieldInfo* info) { + if (field.get_type_id() == TypeIndex::Array) { + if (field.safe_get<Array>().empty()) { + info->scalar_type_id = TypeIndex::Nothing; + ++info->num_dimensions; + info->have_nulls = true; + info->need_convert = false; + } else { + ++info->num_dimensions; + get_base_field_info(field.safe_get<Array>()[0], info); + } + return; + } + + // handle scalar types + info->scalar_type_id = field.get_type_id(); + info->have_nulls = true; + info->need_convert = false; + info->scale = field.get_scale(); + info->precision = field.get_precision(); + + // Currently the jsonb type should be the top level type, so we should not wrap it in array, + // see create_array_of_type. + // TODO we need to support array<jsonb> correctly + if (UNLIKELY(field.get_type_id() == TypeIndex::JSONB && info->num_dimensions > 0)) { Review Comment: warning: boolean expression can be simplified by DeMorgan's theorem [readability-simplify-boolean-expr] ```cpp if (UNLIKELY(field.get_type_id() == TypeIndex::JSONB && info->num_dimensions > 0)) { ^ ``` <details> <summary>Additional context</summary> **be/src/common/compiler_util.h:35:** expanded from macro 'UNLIKELY' ```cpp #define UNLIKELY(expr) __builtin_expect(!!(expr), 0) ^ ``` </details> ########## be/src/vec/data_types/serde/data_type_array_serde.h: ########## @@ -20,6 +20,7 @@ #include <glog/logging.h> Review Comment: warning: 'glog/logging.h' file not found [clang-diagnostic-error] ```cpp #include <glog/logging.h> ^ ``` ########## be/src/vec/data_types/data_type_factory.cpp: ########## @@ -248,7 +248,8 @@ DataTypePtr DataTypeFactory::create_data_type(const TypeDescriptor& col_desc, bo return nested; } -DataTypePtr DataTypeFactory::create_data_type(const TypeIndex& type_index, bool is_nullable) { +DataTypePtr DataTypeFactory::create_data_type(const TypeIndex& type_index, bool is_nullable, Review Comment: warning: function 'create_data_type' exceeds recommended size/complexity thresholds [readability-function-size] ```cpp DataTypePtr DataTypeFactory::create_data_type(const TypeIndex& type_index, bool is_nullable, ^ ``` <details> <summary>Additional context</summary> **be/src/vec/data_types/data_type_factory.cpp:250:** 114 lines including whitespace and comments (threshold 80) ```cpp DataTypePtr DataTypeFactory::create_data_type(const TypeIndex& type_index, bool is_nullable, ^ ``` </details> -- 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