zhiqiang-hhhh commented on code in PR #55184:
URL: https://github.com/apache/doris/pull/55184#discussion_r2297200970


##########
be/src/vec/functions/array/function_array_distance.h:
##########
@@ -140,27 +137,14 @@ class FunctionArrayDistance : public IFunction {
         }
 
         // prepare return data
-        auto dst = ColumnFloat64::create(input_rows_count);
+        auto dst = ColumnType::create(input_rows_count);
         auto& dst_data = dst->get_data();
-        auto dst_null_column = ColumnUInt8::create(input_rows_count, 0);
-        auto& dst_null_data = dst_null_column->get_data();
 
         const auto& offsets1 = *arr1.offsets_ptr;
         const auto& offsets2 = *arr2.offsets_ptr;
-        const auto& nested_col1 = assert_cast<const 
ColumnFloat64*>(arr1.nested_col.get());
-        const auto& nested_col2 = assert_cast<const 
ColumnFloat64*>(arr2.nested_col.get());
+        const auto& nested_col1 = assert_cast<const 
ColumnType*>(arr1.nested_col.get());

Review Comment:
   what if input column is nullable



##########
be/src/olap/rowset/segment_v2/ann_index/ann_topn_runtime.cpp:
##########
@@ -78,19 +75,11 @@ Status AnnTopNRuntime::prepare(RuntimeState* state, const 
RowDescriptor& row_des
                                      vir_col_expr->debug_string());
     }
 
-    std::shared_ptr<vectorized::VCastExpr> cast_to_array_expr =
-            
std::dynamic_pointer_cast<vectorized::VCastExpr>(distance_fn_call->children()[0]);
-
-    if (cast_to_array_expr == nullptr) {
-        return Status::InternalError("Ann topn expr expect cast_to_array_expr, 
got\n{}",
-                                     
distance_fn_call->children()[0]->debug_string());
-    }
-
     std::shared_ptr<vectorized::VSlotRef> slot_ref =
-            
std::dynamic_pointer_cast<vectorized::VSlotRef>(cast_to_array_expr->children()[0]);
+            
std::dynamic_pointer_cast<vectorized::VSlotRef>(distance_fn_call->children()[0]);

Review Comment:
   why cast_to_array is remove? 



##########
be/src/olap/rowset/segment_v2/ann_index/ann_topn_runtime.cpp:
##########
@@ -78,19 +75,11 @@ Status AnnTopNRuntime::prepare(RuntimeState* state, const 
RowDescriptor& row_des
                                      vir_col_expr->debug_string());
     }
 
-    std::shared_ptr<vectorized::VCastExpr> cast_to_array_expr =
-            
std::dynamic_pointer_cast<vectorized::VCastExpr>(distance_fn_call->children()[0]);
-
-    if (cast_to_array_expr == nullptr) {
-        return Status::InternalError("Ann topn expr expect cast_to_array_expr, 
got\n{}",
-                                     
distance_fn_call->children()[0]->debug_string());
-    }
-
     std::shared_ptr<vectorized::VSlotRef> slot_ref =
-            
std::dynamic_pointer_cast<vectorized::VSlotRef>(cast_to_array_expr->children()[0]);
+            
std::dynamic_pointer_cast<vectorized::VSlotRef>(distance_fn_call->children()[0]);

Review Comment:
   why cast_to_array is removed? 



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

Reply via email to