github-actions[bot] commented on code in PR #29812:
URL: https://github.com/apache/doris/pull/29812#discussion_r1447310854
##########
be/src/vec/functions/function_ip.h:
##########
@@ -832,4 +835,118 @@ class FunctionIsIPAddressInRange : public IFunction {
}
};
+class FunctionIPv6CIDRToRange : public IFunction {
+public:
+ static constexpr auto name = "ipv6_cidr_to_range";
+ static FunctionPtr create() { return
std::make_shared<FunctionIPv6CIDRToRange>(); }
+
+ String get_name() const override { return name; }
+
+ size_t get_number_of_arguments() const override { return 2; }
+
+ DataTypePtr get_return_type_impl(const DataTypes& arguments) const
override {
Review Comment:
warning: method 'get_return_type_impl' can be made static
[readability-convert-member-functions-to-static]
```suggestion
static DataTypePtr get_return_type_impl(const DataTypes& arguments)
override {
```
##########
be/src/vec/functions/function_ip.h:
##########
@@ -832,4 +835,118 @@
}
};
+class FunctionIPv6CIDRToRange : public IFunction {
+public:
+ static constexpr auto name = "ipv6_cidr_to_range";
+ static FunctionPtr create() { return
std::make_shared<FunctionIPv6CIDRToRange>(); }
+
+ String get_name() const override { return name; }
+
+ size_t get_number_of_arguments() const override { return 2; }
+
+ DataTypePtr get_return_type_impl(const DataTypes& arguments) const
override {
+ const auto& ipv6_type = arguments[0];
+ if (!is_string(remove_nullable(ipv6_type)) &&
!is_ipv6(remove_nullable(ipv6_type))) {
+ throw Exception(
+ ErrorCode::INVALID_ARGUMENT,
+ "Illegal type {} of first argument of function {},
expected String or IPv6",
+ ipv6_type->get_name(), get_name());
+ }
+ const auto& cidr_type = arguments[1];
+ if (!is_integer(remove_nullable(cidr_type))) {
+ throw Exception(
+ ErrorCode::INVALID_ARGUMENT,
+ "Illegal type {} of second argument of function {},
expected Integer",
+ cidr_type->get_name(), get_name());
+ }
+ DataTypePtr element = std::make_shared<DataTypeIPv6>();
+ return make_nullable(std::make_shared<DataTypeStruct>(
+ DataTypes{element, element}, Strings{"min", "max"}));
+ }
+
+ bool use_default_implementation_for_nulls() const override { return true; }
+
+ Status execute_impl(FunctionContext* context, Block& block, const
ColumnNumbers& arguments,
+ size_t result, size_t input_rows_count) const override
{
Review Comment:
warning: method 'execute_impl' can be made static
[readability-convert-member-functions-to-static]
```suggestion
static Status execute_impl(FunctionContext* context, Block& block, const
ColumnNumbers& arguments,
size_t result, size_t input_rows_count) override {
```
--
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]