xiaokang commented on code in PR #39022:
URL: https://github.com/apache/doris/pull/39022#discussion_r1718194624
##########
be/src/vec/columns/column_object.cpp:
##########
@@ -884,8 +996,62 @@ void ColumnObject::get(size_t n, Field& res) const {
auto& object = res.get<VariantMap&>();
for (const auto& entry : subcolumns) {
- auto it = object.try_emplace(entry->path.get_path()).first;
- entry->data.get(n, it->second);
+ Field field;
+ entry->data.get(n, field);
+ // Notice: we treat null as empty field
+ if (field.get_type() != Field::Types::Null) {
+ object.try_emplace(entry->path.get_path(), field);
+ }
+ }
+ if (object.empty()) {
+ res = Null();
+ }
+}
+
+void ColumnObject::add_nested_subcolumn(const PathInData& key, const
FieldInfo& field_info,
+ size_t new_size) {
+ if (!key.has_nested_part()) {
+ throw doris::Exception(ErrorCode::INTERNAL_ERROR,
+ "Cannot add Nested subcolumn, because path
doesn't contain Nested");
+ }
+
+ bool inserted = false;
+ /// We find node that represents the same Nested type as @key.
+ const auto* nested_node = subcolumns.find_best_match(key);
Review Comment:
eg. request key is a.b.c, but a.b is a nested node and a.b is returned, then
all operation is performed on a.b instead of a.b.c.
--
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]