HappenLee commented on code in PR #48537:
URL: https://github.com/apache/doris/pull/48537#discussion_r1992159534


##########
be/src/vec/exprs/table_function/vexplode.cpp:
##########
@@ -58,98 +62,188 @@ Status VExplodeTableFunction::_process_init_variant(Block* 
block, int value_colu
             return Status::NotSupported("explode not support none array type 
{}",
                                         
variant_column.get_root_type()->get_name());
         }
-        _detail.nested_type = array_type->get_nested_type();
+        data.nested_type = array_type->get_nested_type();
     } else {
         // null root, use nothing type
-        _array_column = 
ColumnNullable::create(ColumnArray::create(ColumnNothing::create(0)),
-                                               ColumnUInt8::create(0));
-        
_array_column->assume_mutable()->insert_many_defaults(variant_column.size());
-        _detail.nested_type = std::make_shared<DataTypeNothing>();
+        array_column = 
ColumnNullable::create(ColumnArray::create(ColumnNothing::create(0)),
+                                              ColumnUInt8::create(0));
+        
array_column->assume_mutable()->insert_many_defaults(variant_column.size());
+        data.nested_type = std::make_shared<DataTypeNothing>();
     }
     return Status::OK();
 }
 
 Status VExplodeTableFunction::process_init(Block* block, RuntimeState* state) {
-    CHECK(_expr_context->root()->children().size() == 1)
-            << "VExplodeTableFunction only support 1 child but has "
+    CHECK(_expr_context->root()->children().size() >= 1)
+            << "VExplodeTableFunction support 1 or more child but has "
             << _expr_context->root()->children().size();
 
     int value_column_idx = -1;
-    
RETURN_IF_ERROR(_expr_context->root()->children()[0]->execute(_expr_context.get(),
 block,
-                                                                  
&value_column_idx));
-    if 
(WhichDataType(remove_nullable(block->get_by_position(value_column_idx).type))
-                .is_variant_type()) {
-        RETURN_IF_ERROR(_process_init_variant(block, value_column_idx));
-    } else {
-        _array_column =
-                
block->get_by_position(value_column_idx).column->convert_to_full_column_if_const();
-    }
-    if (!extract_column_array_info(*_array_column, _detail)) {
-        return Status::NotSupported("column type {} not supported now",
-                                    
block->get_by_position(value_column_idx).column->get_name());
+    _multi_detail.resize(_expr_context->root()->children().size());
+    _array_offsets.resize(_expr_context->root()->children().size());
+    _array_columns.resize(_expr_context->root()->children().size());
+
+    for (int i = 0; i < _expr_context->root()->children().size(); i++) {
+        
RETURN_IF_ERROR(_expr_context->root()->children()[i]->execute(_expr_context.get(),
 block,
+                                                                      
&value_column_idx));
+        ColumnArrayExecutionData detail = ColumnArrayExecutionData();

Review Comment:
   why ColumnArrayExecutionData& detail = _multi_detail[i] and remove line 103



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