xiaokang commented on code in PR #33890:
URL: https://github.com/apache/doris/pull/33890#discussion_r1590200381


##########
be/src/vec/columns/column_object.cpp:
##########
@@ -148,6 +151,84 @@ class FieldVisitorToNumberOfDimensions : public 
StaticVisitor<size_t> {
     }
 };
 
+// Visitor that allows to get type of scalar field
+// but include contain complex field.This is a faster version
+// for FieldVisitorToScalarType which does not support complex field.
+class SimpleFieldVisitorToScarlarType : public StaticVisitor<size_t> {

Review Comment:
   typo SimpleFieldVisitorToScalarType



##########
be/src/vec/columns/column_object.cpp:
##########
@@ -308,18 +399,29 @@ void ColumnObject::Subcolumn::insert(Field field, 
FieldInfo info) {
         value_dim = 0;
         type_changed = true;
     }
+    // Always expected nullable at present
     if (is_nullable && !is_nothing(base_type)) {
         base_type = make_nullable(base_type);
     }
-
     const auto& least_common_base_type = least_common_type.get_base();
+    const auto& nested_common_base_type =
+            is_nullable ? static_cast<const 
DataTypeNullable&>(*least_common_base_type)
+                                  .get_nested_type()
+                        : least_common_base_type;
+    const auto& nested_base_type =
+            is_nullable ? static_cast<const 
DataTypeNullable&>(*base_type).get_nested_type()
+                        : base_type;
+
     if (data.empty()) {
         add_new_column_part(create_array_of_type(std::move(base_type), 
value_dim, is_nullable));
-    } else if (!least_common_base_type->equals(*base_type) && 
!is_nothing(base_type)) {
-        if (!schema_util::is_conversion_required_between_integers(*base_type,
-                                                                  
*least_common_base_type)) {
+    } else if (!nested_common_base_type->equals(*nested_base_type) &&
+               !is_nothing(nested_base_type)) {
+        if 
(schema_util::is_conversion_required_between_integers(*nested_base_type,
+                                                                 
*nested_common_base_type)) {
+            LOG_EVERY_N(INFO, 100) << "Conversion between " << 
base_type->get_name() << " and "
+                                   << least_common_base_type->get_name();
             get_least_supertype<LeastSupertypeOnError::Jsonb>(

Review Comment:
   Is least_common_base_type changed after calling get_least_supertype? If no, 
where is get_least_supertype updated?



-- 
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

Reply via email to