linrrzqqq commented on code in PR #63049:
URL: https://github.com/apache/doris/pull/63049#discussion_r3296684442
##########
be/src/exprs/function/geo/functions_geo.cpp:
##########
@@ -917,6 +919,174 @@ struct StDistance {
}
};
+struct StNumGeometries {
+ static constexpr auto NAME = "st_numgeometries";
+ static const size_t NUM_ARGS = 1;
+ using Type = DataTypeInt64;
+
+ static Status execute(Block& block, const ColumnNumbers& arguments, size_t
result) {
+ DCHECK_EQ(arguments.size(), 1);
+
+ auto col =
block.get_by_position(arguments[0]).column->convert_to_full_column_if_const();
Review Comment:
1. No need to call `convert_to_full_column_if_const`.
If all columns are constant, Doris will automatically expand all columns
before execute. You can refer to
`PreparedFunctionImpl::default_implementation_for_constant_arguments` in
function.cpp.
2. Directly use `auto col =
ColumnView<TYPE_STRING>::create(block.get_by_position(arguments[0]).column)` to
avoid the overhead of subsequent virtual function calls.
--
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]