zclllyybb commented on code in PR #35390:
URL: https://github.com/apache/doris/pull/35390#discussion_r1614768308
##########
be/src/vec/functions/functions_geo.cpp:
##########
@@ -290,30 +307,38 @@ struct StAngle {
auto return_type = block.get_data_type(result);
MutableColumnPtr res = return_type->create_column();
- auto p1 =
block.get_by_position(arguments[0]).column->convert_to_full_column_if_const();
- auto p2 =
block.get_by_position(arguments[1]).column->convert_to_full_column_if_const();
- auto p3 =
block.get_by_position(arguments[2]).column->convert_to_full_column_if_const();
- const auto size = p1->size();
+ Columns cols(3);
+ bool col_const[3];
+ for (int i = 0; i < arguments.size(); ++i) {
+ std::tie(cols[i], col_const[i]) =
+
unpack_if_const(block.get_by_position(arguments[i]).column);
+ }
+
+ const auto size =
+ std::max_element(cols.begin(), cols.end(),
+ [](auto& col1, auto& col2) { return
col1->size() < col2->size(); })
+ ->get()
+ ->size();
GeoPoint point1;
GeoPoint point2;
GeoPoint point3;
for (int row = 0; row < size; ++row) {
Review Comment:
test this loop to check if `index_check_const` was called every time
--
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]