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


##########
be/src/vec/functions/function_bitmap_variadic.cpp:
##########
@@ -54,18 +96,39 @@ namespace doris::vectorized {
         using TData = std::vector<BitmapValue>;                                
                    \
         using ResTData = typename ColumnVector<Int64>::Container;              
                    \
         static Status vector_vector(ColumnPtr argument_columns[], size_t 
col_size,                 \
-                                    size_t input_rows_count, ResTData& res) {  
                    \
-            TData vals = assert_cast<const 
ColumnBitmap*>(argument_columns[0].get())->get_data();  \
+                                    size_t input_rows_count, ResTData& res, 
IColumn* res_nulls) {  \
+            TData vals;                                                        
                    \
+            if (auto* nullable = 
check_and_get_column<ColumnNullable>(*argument_columns[0])) {     \
+                const auto& nested_col_ptr = 
nullable->get_nested_column_ptr();                    \
+                vals = assert_cast<const 
ColumnBitmap*>(nested_col_ptr.get())->get_data();         \
+            } else {                                                           
                    \
+                vals = assert_cast<const 
ColumnBitmap*>(argument_columns[0].get())->get_data();    \
+            }                                                                  
                    \
             for (size_t col = 1; col < col_size; ++col) {                      
                    \
-                auto& col_data =                                               
                    \
-                        assert_cast<const 
ColumnBitmap*>(argument_columns[col].get())->get_data(); \
+                const ColumnBitmap::Container* col_data_ptr;                   
                    \
+                if (auto* nullable =                                           
                    \
+                            
check_and_get_column<ColumnNullable>(*argument_columns[col])) {        \
+                    const auto& nested_col_ptr = 
nullable->get_nested_column_ptr();                \
+                    col_data_ptr =                                             
                    \
+                            &(assert_cast<const 
ColumnBitmap*>(nested_col_ptr.get())->get_data()); \
+                } else {                                                       
                    \
+                    col_data_ptr = &(assert_cast<const 
ColumnBitmap*>(argument_columns[col].get()) \
+                                             ->get_data());                    
                    \
+                }                                                              
                    \
+                const auto& col_data = *col_data_ptr;                          
                    \
                 for (size_t row = 0; row < input_rows_count; ++row) {          
                    \
                     vals[row] OP col_data[row];                                
                    \
                 }                                                              
                    \
             }                                                                  
                    \
             for (size_t row = 0; row < input_rows_count; ++row) {              
                    \
                 res[row] = vals[row].cardinality();                            
                    \
             }                                                                  
                    \
+            if (res_nulls) {                                                   
                    \

Review Comment:
   delete the code. better init the ColumnUInt8 by constructor



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