github-actions[bot] commented on code in PR #21641:
URL: https://github.com/apache/doris/pull/21641#discussion_r1334926724


##########
be/src/vec/data_types/data_type_ipv6.h:
##########
@@ -0,0 +1,87 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#pragma once
+
+#include <gen_cpp/Types_types.h>

Review Comment:
   warning: 'gen_cpp/Types_types.h' file not found [clang-diagnostic-error]
   ```cpp
   #include <gen_cpp/Types_types.h>
            ^
   ```
   



##########
be/src/vec/data_types/data_type_ipv6.h:
##########
@@ -0,0 +1,87 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#pragma once
+
+#include <gen_cpp/Types_types.h>
+#include <stddef.h>
+
+#include <algorithm>
+#include <boost/iterator/iterator_facade.hpp>
+#include <string>
+
+#include "common/status.h"
+#include "runtime/define_primitive_type.h"
+#include "vec/core/types.h"
+#include "vec/data_types/data_type.h"
+#include "vec/data_types/data_type_ipv4.h"
+#include "vec/data_types/data_type_number_base.h"
+#include "vec/data_types/serde/data_type_ipv6_serde.h"
+
+namespace doris {
+namespace vectorized {
+class BufferWritable;
+class ReadBuffer;
+class IColumn;
+} // namespace vectorized
+} // namespace doris
+
+namespace doris::vectorized {
+
+class DataTypeIPv6 final : public DataTypeNumberBase<IPv6> {
+public:
+    TypeIndex get_type_id() const override { return TypeIndex::IPv6; }

Review Comment:
   warning: function 'get_type_id' should be marked [[nodiscard]] 
[modernize-use-nodiscard]
   
   ```suggestion
       [[nodiscard]] TypeIndex get_type_id() const override { return 
TypeIndex::IPv6; }
   ```
   



##########
be/src/vec/data_types/data_type_ipv6.h:
##########
@@ -0,0 +1,87 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#pragma once
+
+#include <gen_cpp/Types_types.h>
+#include <stddef.h>
+
+#include <algorithm>
+#include <boost/iterator/iterator_facade.hpp>
+#include <string>
+
+#include "common/status.h"
+#include "runtime/define_primitive_type.h"
+#include "vec/core/types.h"
+#include "vec/data_types/data_type.h"
+#include "vec/data_types/data_type_ipv4.h"
+#include "vec/data_types/data_type_number_base.h"
+#include "vec/data_types/serde/data_type_ipv6_serde.h"
+
+namespace doris {
+namespace vectorized {
+class BufferWritable;
+class ReadBuffer;
+class IColumn;
+} // namespace vectorized
+} // namespace doris
+
+namespace doris::vectorized {
+
+class DataTypeIPv6 final : public DataTypeNumberBase<IPv6> {
+public:
+    TypeIndex get_type_id() const override { return TypeIndex::IPv6; }
+    PrimitiveType get_type_as_primitive_type() const override { return 
TYPE_IPV6; }

Review Comment:
   warning: function 'get_type_as_primitive_type' should be marked 
[[nodiscard]] [modernize-use-nodiscard]
   
   ```suggestion
       [[nodiscard]] PrimitiveType get_type_as_primitive_type() const override 
{ return TYPE_IPV6; }
   ```
   



##########
be/src/vec/data_types/data_type_ipv6.h:
##########
@@ -0,0 +1,87 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#pragma once
+
+#include <gen_cpp/Types_types.h>
+#include <stddef.h>
+
+#include <algorithm>
+#include <boost/iterator/iterator_facade.hpp>
+#include <string>
+
+#include "common/status.h"
+#include "runtime/define_primitive_type.h"
+#include "vec/core/types.h"
+#include "vec/data_types/data_type.h"
+#include "vec/data_types/data_type_ipv4.h"
+#include "vec/data_types/data_type_number_base.h"
+#include "vec/data_types/serde/data_type_ipv6_serde.h"
+
+namespace doris {
+namespace vectorized {
+class BufferWritable;
+class ReadBuffer;
+class IColumn;
+} // namespace vectorized
+} // namespace doris
+
+namespace doris::vectorized {
+
+class DataTypeIPv6 final : public DataTypeNumberBase<IPv6> {
+public:
+    TypeIndex get_type_id() const override { return TypeIndex::IPv6; }
+    PrimitiveType get_type_as_primitive_type() const override { return 
TYPE_IPV6; }
+    TPrimitiveType::type get_type_as_tprimitive_type() const override {

Review Comment:
   warning: function 'get_type_as_tprimitive_type' should be marked 
[[nodiscard]] [modernize-use-nodiscard]
   
   ```suggestion
       [[nodiscard]] TPrimitiveType::type get_type_as_tprimitive_type() const 
override {
   ```
   



##########
be/src/vec/data_types/data_type_ipv6.h:
##########
@@ -0,0 +1,87 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#pragma once
+
+#include <gen_cpp/Types_types.h>
+#include <stddef.h>
+
+#include <algorithm>
+#include <boost/iterator/iterator_facade.hpp>
+#include <string>
+
+#include "common/status.h"
+#include "runtime/define_primitive_type.h"
+#include "vec/core/types.h"
+#include "vec/data_types/data_type.h"
+#include "vec/data_types/data_type_ipv4.h"
+#include "vec/data_types/data_type_number_base.h"
+#include "vec/data_types/serde/data_type_ipv6_serde.h"
+
+namespace doris {
+namespace vectorized {
+class BufferWritable;
+class ReadBuffer;
+class IColumn;
+} // namespace vectorized
+} // namespace doris
+
+namespace doris::vectorized {
+
+class DataTypeIPv6 final : public DataTypeNumberBase<IPv6> {
+public:
+    TypeIndex get_type_id() const override { return TypeIndex::IPv6; }
+    PrimitiveType get_type_as_primitive_type() const override { return 
TYPE_IPV6; }
+    TPrimitiveType::type get_type_as_tprimitive_type() const override {
+        return TPrimitiveType::IPV6;
+    }
+    const char* get_family_name() const override { return "IPv6"; }

Review Comment:
   warning: function 'get_family_name' should be marked [[nodiscard]] 
[modernize-use-nodiscard]
   
   ```suggestion
       [[nodiscard]] const char* get_family_name() const override { return 
"IPv6"; }
   ```
   



##########
be/src/vec/data_types/data_type_ipv6.h:
##########
@@ -0,0 +1,87 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#pragma once
+
+#include <gen_cpp/Types_types.h>
+#include <stddef.h>
+
+#include <algorithm>
+#include <boost/iterator/iterator_facade.hpp>
+#include <string>
+
+#include "common/status.h"
+#include "runtime/define_primitive_type.h"
+#include "vec/core/types.h"
+#include "vec/data_types/data_type.h"
+#include "vec/data_types/data_type_ipv4.h"
+#include "vec/data_types/data_type_number_base.h"
+#include "vec/data_types/serde/data_type_ipv6_serde.h"
+
+namespace doris {
+namespace vectorized {
+class BufferWritable;
+class ReadBuffer;
+class IColumn;
+} // namespace vectorized
+} // namespace doris
+
+namespace doris::vectorized {
+
+class DataTypeIPv6 final : public DataTypeNumberBase<IPv6> {
+public:
+    TypeIndex get_type_id() const override { return TypeIndex::IPv6; }
+    PrimitiveType get_type_as_primitive_type() const override { return 
TYPE_IPV6; }
+    TPrimitiveType::type get_type_as_tprimitive_type() const override {
+        return TPrimitiveType::IPV6;
+    }
+    const char* get_family_name() const override { return "IPv6"; }
+    std::string do_get_name() const override { return "IPv6"; }

Review Comment:
   warning: function 'do_get_name' should be marked [[nodiscard]] 
[modernize-use-nodiscard]
   
   ```suggestion
       [[nodiscard]] std::string do_get_name() const override { return "IPv6"; }
   ```
   



##########
be/src/vec/data_types/data_type_ipv6.h:
##########
@@ -0,0 +1,87 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#pragma once
+
+#include <gen_cpp/Types_types.h>
+#include <stddef.h>
+
+#include <algorithm>
+#include <boost/iterator/iterator_facade.hpp>
+#include <string>
+
+#include "common/status.h"
+#include "runtime/define_primitive_type.h"
+#include "vec/core/types.h"
+#include "vec/data_types/data_type.h"
+#include "vec/data_types/data_type_ipv4.h"
+#include "vec/data_types/data_type_number_base.h"
+#include "vec/data_types/serde/data_type_ipv6_serde.h"
+
+namespace doris {
+namespace vectorized {
+class BufferWritable;
+class ReadBuffer;
+class IColumn;
+} // namespace vectorized
+} // namespace doris
+
+namespace doris::vectorized {
+
+class DataTypeIPv6 final : public DataTypeNumberBase<IPv6> {
+public:
+    TypeIndex get_type_id() const override { return TypeIndex::IPv6; }
+    PrimitiveType get_type_as_primitive_type() const override { return 
TYPE_IPV6; }
+    TPrimitiveType::type get_type_as_tprimitive_type() const override {
+        return TPrimitiveType::IPV6;
+    }
+    const char* get_family_name() const override { return "IPv6"; }
+    std::string do_get_name() const override { return "IPv6"; }
+
+    bool can_be_inside_nullable() const override { return true; }

Review Comment:
   warning: function 'can_be_inside_nullable' should be marked [[nodiscard]] 
[modernize-use-nodiscard]
   
   ```suggestion
       [[nodiscard]] bool can_be_inside_nullable() const override { return 
true; }
   ```
   



##########
be/src/vec/data_types/data_type_ipv6.h:
##########
@@ -0,0 +1,87 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#pragma once
+
+#include <gen_cpp/Types_types.h>
+#include <stddef.h>
+
+#include <algorithm>
+#include <boost/iterator/iterator_facade.hpp>
+#include <string>
+
+#include "common/status.h"
+#include "runtime/define_primitive_type.h"
+#include "vec/core/types.h"
+#include "vec/data_types/data_type.h"
+#include "vec/data_types/data_type_ipv4.h"
+#include "vec/data_types/data_type_number_base.h"
+#include "vec/data_types/serde/data_type_ipv6_serde.h"
+
+namespace doris {
+namespace vectorized {
+class BufferWritable;
+class ReadBuffer;
+class IColumn;
+} // namespace vectorized
+} // namespace doris
+
+namespace doris::vectorized {
+
+class DataTypeIPv6 final : public DataTypeNumberBase<IPv6> {
+public:
+    TypeIndex get_type_id() const override { return TypeIndex::IPv6; }
+    PrimitiveType get_type_as_primitive_type() const override { return 
TYPE_IPV6; }
+    TPrimitiveType::type get_type_as_tprimitive_type() const override {
+        return TPrimitiveType::IPV6;
+    }
+    const char* get_family_name() const override { return "IPv6"; }
+    std::string do_get_name() const override { return "IPv6"; }
+
+    bool can_be_inside_nullable() const override { return true; }
+
+    bool equals(const IDataType& rhs) const override;

Review Comment:
   warning: function 'equals' should be marked [[nodiscard]] 
[modernize-use-nodiscard]
   
   ```suggestion
       [[nodiscard]] bool equals(const IDataType& rhs) const override;
   ```
   



##########
be/src/vec/data_types/data_type_ipv6.h:
##########
@@ -0,0 +1,87 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#pragma once
+
+#include <gen_cpp/Types_types.h>
+#include <stddef.h>
+
+#include <algorithm>
+#include <boost/iterator/iterator_facade.hpp>
+#include <string>
+
+#include "common/status.h"
+#include "runtime/define_primitive_type.h"
+#include "vec/core/types.h"
+#include "vec/data_types/data_type.h"
+#include "vec/data_types/data_type_ipv4.h"
+#include "vec/data_types/data_type_number_base.h"
+#include "vec/data_types/serde/data_type_ipv6_serde.h"
+
+namespace doris {
+namespace vectorized {
+class BufferWritable;
+class ReadBuffer;
+class IColumn;
+} // namespace vectorized
+} // namespace doris
+
+namespace doris::vectorized {
+
+class DataTypeIPv6 final : public DataTypeNumberBase<IPv6> {
+public:
+    TypeIndex get_type_id() const override { return TypeIndex::IPv6; }
+    PrimitiveType get_type_as_primitive_type() const override { return 
TYPE_IPV6; }
+    TPrimitiveType::type get_type_as_tprimitive_type() const override {
+        return TPrimitiveType::IPV6;
+    }
+    const char* get_family_name() const override { return "IPv6"; }
+    std::string do_get_name() const override { return "IPv6"; }
+
+    bool can_be_inside_nullable() const override { return true; }
+
+    bool equals(const IDataType& rhs) const override;
+    std::string to_string(const IColumn& column, size_t row_num) const 
override;
+    void to_string(const IColumn& column, size_t row_num, BufferWritable& 
ostr) const override;
+    Status from_string(ReadBuffer& rb, IColumn* column) const override;
+
+    static std::string convert_ipv6_to_string(IPv6 ipv6);
+    static bool convert_string_to_ipv6(IPv6& x, std::string ipv6);
+
+    Field get_field(const TExprNode& node) const override {

Review Comment:
   warning: function 'get_field' should be marked [[nodiscard]] 
[modernize-use-nodiscard]
   
   ```suggestion
       [[nodiscard]] Field get_field(const TExprNode& node) const override {
   ```
   



##########
be/src/vec/data_types/data_type_ipv6.h:
##########
@@ -0,0 +1,87 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#pragma once
+
+#include <gen_cpp/Types_types.h>
+#include <stddef.h>
+
+#include <algorithm>
+#include <boost/iterator/iterator_facade.hpp>
+#include <string>
+
+#include "common/status.h"
+#include "runtime/define_primitive_type.h"
+#include "vec/core/types.h"
+#include "vec/data_types/data_type.h"
+#include "vec/data_types/data_type_ipv4.h"
+#include "vec/data_types/data_type_number_base.h"
+#include "vec/data_types/serde/data_type_ipv6_serde.h"
+
+namespace doris {
+namespace vectorized {
+class BufferWritable;
+class ReadBuffer;
+class IColumn;
+} // namespace vectorized
+} // namespace doris
+
+namespace doris::vectorized {
+
+class DataTypeIPv6 final : public DataTypeNumberBase<IPv6> {
+public:
+    TypeIndex get_type_id() const override { return TypeIndex::IPv6; }
+    PrimitiveType get_type_as_primitive_type() const override { return 
TYPE_IPV6; }
+    TPrimitiveType::type get_type_as_tprimitive_type() const override {
+        return TPrimitiveType::IPV6;
+    }
+    const char* get_family_name() const override { return "IPv6"; }
+    std::string do_get_name() const override { return "IPv6"; }
+
+    bool can_be_inside_nullable() const override { return true; }
+
+    bool equals(const IDataType& rhs) const override;
+    std::string to_string(const IColumn& column, size_t row_num) const 
override;

Review Comment:
   warning: function 'to_string' should be marked [[nodiscard]] 
[modernize-use-nodiscard]
   
   ```suggestion
       [[nodiscard]] std::string to_string(const IColumn& column, size_t 
row_num) const override;
   ```
   



##########
be/src/vec/data_types/data_type_ipv6.h:
##########
@@ -0,0 +1,87 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#pragma once
+
+#include <gen_cpp/Types_types.h>
+#include <stddef.h>
+
+#include <algorithm>
+#include <boost/iterator/iterator_facade.hpp>
+#include <string>
+
+#include "common/status.h"
+#include "runtime/define_primitive_type.h"
+#include "vec/core/types.h"
+#include "vec/data_types/data_type.h"
+#include "vec/data_types/data_type_ipv4.h"
+#include "vec/data_types/data_type_number_base.h"
+#include "vec/data_types/serde/data_type_ipv6_serde.h"
+
+namespace doris {
+namespace vectorized {
+class BufferWritable;
+class ReadBuffer;
+class IColumn;
+} // namespace vectorized
+} // namespace doris
+
+namespace doris::vectorized {
+
+class DataTypeIPv6 final : public DataTypeNumberBase<IPv6> {
+public:
+    TypeIndex get_type_id() const override { return TypeIndex::IPv6; }
+    PrimitiveType get_type_as_primitive_type() const override { return 
TYPE_IPV6; }
+    TPrimitiveType::type get_type_as_tprimitive_type() const override {
+        return TPrimitiveType::IPV6;
+    }
+    const char* get_family_name() const override { return "IPv6"; }
+    std::string do_get_name() const override { return "IPv6"; }
+
+    bool can_be_inside_nullable() const override { return true; }
+
+    bool equals(const IDataType& rhs) const override;
+    std::string to_string(const IColumn& column, size_t row_num) const 
override;
+    void to_string(const IColumn& column, size_t row_num, BufferWritable& 
ostr) const override;
+    Status from_string(ReadBuffer& rb, IColumn* column) const override;
+
+    static std::string convert_ipv6_to_string(IPv6 ipv6);
+    static bool convert_string_to_ipv6(IPv6& x, std::string ipv6);
+
+    Field get_field(const TExprNode& node) const override {
+        IPv6 value;
+        if (!convert_string_to_ipv6(value, node.ipv6_literal.value)) {
+            throw doris::Exception(doris::ErrorCode::INVALID_ARGUMENT,
+                                   "Invalid value: {} for type IPv6", 
node.ipv6_literal.value);
+        }
+        return value;
+    }
+
+    MutableColumnPtr create_column() const override;

Review Comment:
   warning: function 'create_column' should be marked [[nodiscard]] 
[modernize-use-nodiscard]
   
   ```suggestion
       [[nodiscard]] MutableColumnPtr create_column() const override;
   ```
   



##########
be/src/vec/data_types/data_type_ipv6.h:
##########
@@ -0,0 +1,87 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#pragma once
+
+#include <gen_cpp/Types_types.h>
+#include <stddef.h>
+
+#include <algorithm>
+#include <boost/iterator/iterator_facade.hpp>
+#include <string>
+
+#include "common/status.h"
+#include "runtime/define_primitive_type.h"
+#include "vec/core/types.h"
+#include "vec/data_types/data_type.h"
+#include "vec/data_types/data_type_ipv4.h"
+#include "vec/data_types/data_type_number_base.h"
+#include "vec/data_types/serde/data_type_ipv6_serde.h"
+
+namespace doris {
+namespace vectorized {
+class BufferWritable;
+class ReadBuffer;
+class IColumn;
+} // namespace vectorized
+} // namespace doris
+
+namespace doris::vectorized {
+
+class DataTypeIPv6 final : public DataTypeNumberBase<IPv6> {
+public:
+    TypeIndex get_type_id() const override { return TypeIndex::IPv6; }
+    PrimitiveType get_type_as_primitive_type() const override { return 
TYPE_IPV6; }
+    TPrimitiveType::type get_type_as_tprimitive_type() const override {
+        return TPrimitiveType::IPV6;
+    }
+    const char* get_family_name() const override { return "IPv6"; }
+    std::string do_get_name() const override { return "IPv6"; }
+
+    bool can_be_inside_nullable() const override { return true; }
+
+    bool equals(const IDataType& rhs) const override;
+    std::string to_string(const IColumn& column, size_t row_num) const 
override;
+    void to_string(const IColumn& column, size_t row_num, BufferWritable& 
ostr) const override;
+    Status from_string(ReadBuffer& rb, IColumn* column) const override;
+
+    static std::string convert_ipv6_to_string(IPv6 ipv6);
+    static bool convert_string_to_ipv6(IPv6& x, std::string ipv6);
+
+    Field get_field(const TExprNode& node) const override {
+        IPv6 value;
+        if (!convert_string_to_ipv6(value, node.ipv6_literal.value)) {
+            throw doris::Exception(doris::ErrorCode::INVALID_ARGUMENT,
+                                   "Invalid value: {} for type IPv6", 
node.ipv6_literal.value);
+        }
+        return value;
+    }
+
+    MutableColumnPtr create_column() const override;
+
+    DataTypeSerDeSPtr get_serde() const override { return 
std::make_shared<DataTypeIPv6SerDe>(); }

Review Comment:
   warning: function 'get_serde' should be marked [[nodiscard]] 
[modernize-use-nodiscard]
   
   ```suggestion
       [[nodiscard]] DataTypeSerDeSPtr get_serde() const override { return 
std::make_shared<DataTypeIPv6SerDe>(); }
   ```
   



##########
be/src/vec/data_types/serde/data_type_ipv4_serde.h:
##########
@@ -0,0 +1,54 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#pragma once
+
+#include <gen_cpp/types.pb.h>

Review Comment:
   warning: 'gen_cpp/types.pb.h' file not found [clang-diagnostic-error]
   ```cpp
   #include <gen_cpp/types.pb.h>
            ^
   ```
   



##########
be/src/vec/functions/function_ip.h:
##########
@@ -26,62 +26,55 @@
 #include "vec/columns/column_vector.h"
 #include "vec/common/format_ip.h"
 #include "vec/core/column_with_type_and_name.h"
+#include "vec/data_types/data_type_ipv4.h"
+#include "vec/data_types/data_type_ipv6.h"
 #include "vec/data_types/data_type_string.h"
 #include "vec/functions/function.h"
 #include "vec/functions/simple_function_factory.h"
 
 namespace doris::vectorized {
 
-/** If mask_tail_octets > 0, the last specified number of octets will be 
filled with "xxx".
-  */
-template <size_t mask_tail_octets, typename Name>
+template <typename Name>
 class FunctionIPv4NumToString : public IFunction {
 private:
     template <typename ArgType>
     Status execute_type(Block& block, const ColumnWithTypeAndName& argument, 
size_t result) const {
         using ColumnType = ColumnVector<ArgType>;
         const ColumnPtr& column = argument.column;
 
-        if (const ColumnType* col = typeid_cast<const 
ColumnType*>(column.get())) {
-            const typename ColumnType::Container& vec_in = col->get_data();
+        if (const ColumnType* col_src = typeid_cast<const 
ColumnType*>(column.get())) {
+            const typename ColumnType::Container& vec_in = col_src->get_data();
             auto col_res = ColumnString::create();
-
-            ColumnString::Chars& vec_res = col_res->get_chars();
-            ColumnString::Offsets& offsets_res = col_res->get_offsets();
-
-            vec_res.resize(vec_in.size() *
-                           (IPV4_MAX_TEXT_LENGTH + 1)); /// the longest value 
is: 255.255.255.255\0
-            offsets_res.resize(vec_in.size());
-            char* begin = reinterpret_cast<char*>(vec_res.data());
-            char* pos = begin;
-
             auto null_map = ColumnUInt8::create(vec_in.size(), 0);
-            size_t src_size = std::min(sizeof(ArgType), (unsigned long)4);
+
             for (size_t i = 0; i < vec_in.size(); ++i) {
                 auto value = vec_in[i];
                 if (value < IPV4_MIN_NUM_VALUE || value > IPV4_MAX_NUM_VALUE) {
-                    offsets_res[i] = pos - begin;
+                    col_res->insert_default();
                     null_map->get_data()[i] = 1;
                 } else {
-                    formatIPv4(reinterpret_cast<const unsigned 
char*>(&vec_in[i]), src_size, pos,
-                               mask_tail_octets, "xxx");
-                    offsets_res[i] = pos - begin;
+                    vectorized::IPv4 ipv4_val = 
static_cast<vectorized::IPv4>(value);
+                    std::string ipv4_str = IPv4Value::to_string(ipv4_val);

Review Comment:
   warning: variable 'ipv4_str' is not initialized 
[cppcoreguidelines-init-variables]
   
   ```suggestion
                       std::string ipv4_str = 0 = 
IPv4Value::to_string(ipv4_val);
   ```
   



##########
be/src/vec/data_types/serde/data_type_ipv6_serde.h:
##########
@@ -0,0 +1,57 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+#pragma once
+
+#include <gen_cpp/types.pb.h>

Review Comment:
   warning: 'gen_cpp/types.pb.h' file not found [clang-diagnostic-error]
   ```cpp
   #include <gen_cpp/types.pb.h>
            ^
   ```
   



##########
be/src/vec/functions/function_ip.h:
##########
@@ -117,4 +110,408 @@ class FunctionIPv4NumToString : public IFunction {
                 argument.name, get_name());
     }
 };
+
+template <typename Name>
+class FunctionIPv4StringToNum : public IFunction {
+private:
+    Status execute_type(Block& block, const ColumnWithTypeAndName& argument, 
size_t result) const {
+        const ColumnPtr& column = argument.column;
+
+        if (const ColumnString* col_src = typeid_cast<const 
ColumnString*>(column.get())) {
+            auto col_res = ColumnInt64::create();
+            auto null_map = ColumnUInt8::create(col_src->size(), 0);
+
+            for (size_t i = 0; i < col_src->size(); ++i) {
+                auto ipv4_str = col_src->get_data_at(i).to_string();
+                vectorized::IPv4 ipv4_val;

Review Comment:
   warning: variable 'ipv4_val' is not initialized 
[cppcoreguidelines-init-variables]
   
   ```suggestion
                   vectorized::IPv4 ipv4_val = 0;
   ```
   



##########
be/src/vec/functions/function_ip.h:
##########
@@ -117,4 +110,408 @@ class FunctionIPv4NumToString : public IFunction {
                 argument.name, get_name());
     }
 };
+
+template <typename Name>
+class FunctionIPv4StringToNum : public IFunction {
+private:
+    Status execute_type(Block& block, const ColumnWithTypeAndName& argument, 
size_t result) const {
+        const ColumnPtr& column = argument.column;
+
+        if (const ColumnString* col_src = typeid_cast<const 
ColumnString*>(column.get())) {
+            auto col_res = ColumnInt64::create();
+            auto null_map = ColumnUInt8::create(col_src->size(), 0);
+
+            for (size_t i = 0; i < col_src->size(); ++i) {
+                auto ipv4_str = col_src->get_data_at(i).to_string();
+                vectorized::IPv4 ipv4_val;
+                if (!IPv4Value::from_string(ipv4_val, ipv4_str) || 
ipv4_str.size() > IPV4_MAX_TEXT_LENGTH) {
+                    null_map->get_data()[i] = 1;
+                    col_res->insert_default();
+                } else {
+                    col_res->insert_value(ipv4_val);
+                }
+            }
+
+            DCHECK_EQ(col_res->size(), col_src->size());
+            DCHECK_EQ(col_res->size(), null_map->size());
+
+            block.replace_by_position(
+                    result, ColumnNullable::create(std::move(col_res), 
std::move(null_map)));
+            return Status::OK();
+        } else {
+            return Status::RuntimeError("Illegal column {} of argument of 
function {}",
+                                        argument.column->get_name(), 
get_name());
+        }
+    }
+
+public:
+    static constexpr auto name = Name::name;
+    static FunctionPtr create() {
+        return std::make_shared<FunctionIPv4StringToNum<Name>>();
+    }
+
+    String get_name() const override { return name; }

Review Comment:
   warning: function 'get_name' should be marked [[nodiscard]] 
[modernize-use-nodiscard]
   
   ```suggestion
       [[nodiscard]] String get_name() const override { return name; }
   ```
   



##########
be/src/vec/functions/function_ip.h:
##########
@@ -117,4 +110,408 @@ class FunctionIPv4NumToString : public IFunction {
                 argument.name, get_name());
     }
 };
+
+template <typename Name>
+class FunctionIPv4StringToNum : public IFunction {
+private:
+    Status execute_type(Block& block, const ColumnWithTypeAndName& argument, 
size_t result) const {
+        const ColumnPtr& column = argument.column;
+
+        if (const ColumnString* col_src = typeid_cast<const 
ColumnString*>(column.get())) {
+            auto col_res = ColumnInt64::create();
+            auto null_map = ColumnUInt8::create(col_src->size(), 0);
+
+            for (size_t i = 0; i < col_src->size(); ++i) {
+                auto ipv4_str = col_src->get_data_at(i).to_string();
+                vectorized::IPv4 ipv4_val;
+                if (!IPv4Value::from_string(ipv4_val, ipv4_str) || 
ipv4_str.size() > IPV4_MAX_TEXT_LENGTH) {
+                    null_map->get_data()[i] = 1;
+                    col_res->insert_default();
+                } else {
+                    col_res->insert_value(ipv4_val);
+                }
+            }
+
+            DCHECK_EQ(col_res->size(), col_src->size());
+            DCHECK_EQ(col_res->size(), null_map->size());
+
+            block.replace_by_position(
+                    result, ColumnNullable::create(std::move(col_res), 
std::move(null_map)));
+            return Status::OK();
+        } else {
+            return Status::RuntimeError("Illegal column {} of argument of 
function {}",
+                                        argument.column->get_name(), 
get_name());
+        }
+    }
+
+public:
+    static constexpr auto name = Name::name;
+    static FunctionPtr create() {
+        return std::make_shared<FunctionIPv4StringToNum<Name>>();
+    }
+
+    String get_name() const override { return name; }
+
+    size_t get_number_of_arguments() const override { return 1; }

Review Comment:
   warning: function 'get_number_of_arguments' should be marked [[nodiscard]] 
[modernize-use-nodiscard]
   
   ```suggestion
       [[nodiscard]] size_t get_number_of_arguments() const override { return 
1; }
   ```
   



##########
be/src/vec/functions/function_ip.h:
##########
@@ -117,4 +110,408 @@ class FunctionIPv4NumToString : public IFunction {
                 argument.name, get_name());
     }
 };
+
+template <typename Name>
+class FunctionIPv4StringToNum : public IFunction {
+private:
+    Status execute_type(Block& block, const ColumnWithTypeAndName& argument, 
size_t result) const {
+        const ColumnPtr& column = argument.column;
+
+        if (const ColumnString* col_src = typeid_cast<const 
ColumnString*>(column.get())) {
+            auto col_res = ColumnInt64::create();
+            auto null_map = ColumnUInt8::create(col_src->size(), 0);
+
+            for (size_t i = 0; i < col_src->size(); ++i) {
+                auto ipv4_str = col_src->get_data_at(i).to_string();
+                vectorized::IPv4 ipv4_val;
+                if (!IPv4Value::from_string(ipv4_val, ipv4_str) || 
ipv4_str.size() > IPV4_MAX_TEXT_LENGTH) {
+                    null_map->get_data()[i] = 1;
+                    col_res->insert_default();
+                } else {
+                    col_res->insert_value(ipv4_val);
+                }
+            }
+
+            DCHECK_EQ(col_res->size(), col_src->size());
+            DCHECK_EQ(col_res->size(), null_map->size());
+
+            block.replace_by_position(
+                    result, ColumnNullable::create(std::move(col_res), 
std::move(null_map)));
+            return Status::OK();
+        } else {
+            return Status::RuntimeError("Illegal column {} of argument of 
function {}",
+                                        argument.column->get_name(), 
get_name());
+        }
+    }
+
+public:
+    static constexpr auto name = Name::name;
+    static FunctionPtr create() {
+        return std::make_shared<FunctionIPv4StringToNum<Name>>();
+    }
+
+    String get_name() const override { return name; }
+
+    size_t get_number_of_arguments() const override { return 1; }
+
+    DataTypePtr get_return_type_impl(const DataTypes& arguments) const 
override {
+        return make_nullable(std::make_shared<DataTypeInt64>());
+    }
+
+    bool use_default_implementation_for_nulls() const override { return true; }

Review Comment:
   warning: function 'use_default_implementation_for_nulls' should be marked 
[[nodiscard]] [modernize-use-nodiscard]
   
   ```suggestion
       [[nodiscard]] bool use_default_implementation_for_nulls() const override 
{ return true; }
   ```
   



##########
be/src/vec/functions/function_ip.h:
##########
@@ -117,4 +110,408 @@ class FunctionIPv4NumToString : public IFunction {
                 argument.name, get_name());
     }
 };
+
+template <typename Name>
+class FunctionIPv4StringToNum : public IFunction {
+private:
+    Status execute_type(Block& block, const ColumnWithTypeAndName& argument, 
size_t result) const {
+        const ColumnPtr& column = argument.column;
+
+        if (const ColumnString* col_src = typeid_cast<const 
ColumnString*>(column.get())) {
+            auto col_res = ColumnInt64::create();
+            auto null_map = ColumnUInt8::create(col_src->size(), 0);
+
+            for (size_t i = 0; i < col_src->size(); ++i) {
+                auto ipv4_str = col_src->get_data_at(i).to_string();
+                vectorized::IPv4 ipv4_val;
+                if (!IPv4Value::from_string(ipv4_val, ipv4_str) || 
ipv4_str.size() > IPV4_MAX_TEXT_LENGTH) {
+                    null_map->get_data()[i] = 1;
+                    col_res->insert_default();
+                } else {
+                    col_res->insert_value(ipv4_val);
+                }
+            }
+
+            DCHECK_EQ(col_res->size(), col_src->size());
+            DCHECK_EQ(col_res->size(), null_map->size());
+
+            block.replace_by_position(
+                    result, ColumnNullable::create(std::move(col_res), 
std::move(null_map)));
+            return Status::OK();
+        } else {
+            return Status::RuntimeError("Illegal column {} of argument of 
function {}",
+                                        argument.column->get_name(), 
get_name());
+        }
+    }
+
+public:
+    static constexpr auto name = Name::name;
+    static FunctionPtr create() {
+        return std::make_shared<FunctionIPv4StringToNum<Name>>();
+    }
+
+    String get_name() const override { return name; }
+
+    size_t get_number_of_arguments() const override { return 1; }
+
+    DataTypePtr get_return_type_impl(const DataTypes& arguments) const 
override {
+        return make_nullable(std::make_shared<DataTypeInt64>());
+    }
+
+    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) override {
+        ColumnWithTypeAndName& argument = block.get_by_position(arguments[0]);
+
+        DCHECK(argument.type->get_type_id() == TypeIndex::String);
+
+        return execute_type(block, argument, result);
+    }
+};
+
+template <typename Name>
+class FunctionIPv4StringToNumOrDefault : public IFunction {
+private:
+    Status execute_type(Block& block, const ColumnWithTypeAndName& argument, 
size_t result) const {
+        const ColumnPtr& column = argument.column;
+
+        if (const ColumnString* col_src = typeid_cast<const 
ColumnString*>(column.get())) {
+            auto col_res = ColumnInt64::create();
+
+            for (size_t i = 0; i < col_src->size(); ++i) {
+                auto ipv4_str = col_src->get_data_at(i).to_string();
+                vectorized::IPv4 ipv4_val;

Review Comment:
   warning: variable 'ipv4_val' is not initialized 
[cppcoreguidelines-init-variables]
   
   ```suggestion
                   vectorized::IPv4 ipv4_val = 0;
   ```
   



##########
be/src/vec/functions/function_ip.h:
##########
@@ -117,4 +110,408 @@ class FunctionIPv4NumToString : public IFunction {
                 argument.name, get_name());
     }
 };
+
+template <typename Name>
+class FunctionIPv4StringToNum : public IFunction {
+private:
+    Status execute_type(Block& block, const ColumnWithTypeAndName& argument, 
size_t result) const {
+        const ColumnPtr& column = argument.column;
+
+        if (const ColumnString* col_src = typeid_cast<const 
ColumnString*>(column.get())) {
+            auto col_res = ColumnInt64::create();
+            auto null_map = ColumnUInt8::create(col_src->size(), 0);
+
+            for (size_t i = 0; i < col_src->size(); ++i) {
+                auto ipv4_str = col_src->get_data_at(i).to_string();
+                vectorized::IPv4 ipv4_val;
+                if (!IPv4Value::from_string(ipv4_val, ipv4_str) || 
ipv4_str.size() > IPV4_MAX_TEXT_LENGTH) {
+                    null_map->get_data()[i] = 1;
+                    col_res->insert_default();
+                } else {
+                    col_res->insert_value(ipv4_val);
+                }
+            }
+
+            DCHECK_EQ(col_res->size(), col_src->size());
+            DCHECK_EQ(col_res->size(), null_map->size());
+
+            block.replace_by_position(
+                    result, ColumnNullable::create(std::move(col_res), 
std::move(null_map)));
+            return Status::OK();
+        } else {
+            return Status::RuntimeError("Illegal column {} of argument of 
function {}",
+                                        argument.column->get_name(), 
get_name());
+        }
+    }
+
+public:
+    static constexpr auto name = Name::name;
+    static FunctionPtr create() {
+        return std::make_shared<FunctionIPv4StringToNum<Name>>();
+    }
+
+    String get_name() const override { return name; }
+
+    size_t get_number_of_arguments() const override { return 1; }
+
+    DataTypePtr get_return_type_impl(const DataTypes& arguments) const 
override {

Review Comment:
   warning: function 'get_return_type_impl' should be marked [[nodiscard]] 
[modernize-use-nodiscard]
   
   ```suggestion
       [[nodiscard]] DataTypePtr get_return_type_impl(const DataTypes& 
arguments) const override {
   ```
   



##########
be/src/vec/functions/function_ip.h:
##########
@@ -117,4 +110,408 @@ class FunctionIPv4NumToString : public IFunction {
                 argument.name, get_name());
     }
 };
+
+template <typename Name>
+class FunctionIPv4StringToNum : public IFunction {
+private:
+    Status execute_type(Block& block, const ColumnWithTypeAndName& argument, 
size_t result) const {
+        const ColumnPtr& column = argument.column;
+
+        if (const ColumnString* col_src = typeid_cast<const 
ColumnString*>(column.get())) {
+            auto col_res = ColumnInt64::create();
+            auto null_map = ColumnUInt8::create(col_src->size(), 0);
+
+            for (size_t i = 0; i < col_src->size(); ++i) {
+                auto ipv4_str = col_src->get_data_at(i).to_string();
+                vectorized::IPv4 ipv4_val;
+                if (!IPv4Value::from_string(ipv4_val, ipv4_str) || 
ipv4_str.size() > IPV4_MAX_TEXT_LENGTH) {
+                    null_map->get_data()[i] = 1;
+                    col_res->insert_default();
+                } else {
+                    col_res->insert_value(ipv4_val);
+                }
+            }
+
+            DCHECK_EQ(col_res->size(), col_src->size());
+            DCHECK_EQ(col_res->size(), null_map->size());
+
+            block.replace_by_position(
+                    result, ColumnNullable::create(std::move(col_res), 
std::move(null_map)));
+            return Status::OK();
+        } else {
+            return Status::RuntimeError("Illegal column {} of argument of 
function {}",
+                                        argument.column->get_name(), 
get_name());
+        }
+    }
+
+public:
+    static constexpr auto name = Name::name;
+    static FunctionPtr create() {
+        return std::make_shared<FunctionIPv4StringToNum<Name>>();
+    }
+
+    String get_name() const override { return name; }
+
+    size_t get_number_of_arguments() const override { return 1; }
+
+    DataTypePtr get_return_type_impl(const DataTypes& arguments) const 
override {
+        return make_nullable(std::make_shared<DataTypeInt64>());
+    }
+
+    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) override {
+        ColumnWithTypeAndName& argument = block.get_by_position(arguments[0]);
+
+        DCHECK(argument.type->get_type_id() == TypeIndex::String);
+
+        return execute_type(block, argument, result);
+    }
+};
+
+template <typename Name>
+class FunctionIPv4StringToNumOrDefault : public IFunction {
+private:
+    Status execute_type(Block& block, const ColumnWithTypeAndName& argument, 
size_t result) const {
+        const ColumnPtr& column = argument.column;
+
+        if (const ColumnString* col_src = typeid_cast<const 
ColumnString*>(column.get())) {
+            auto col_res = ColumnInt64::create();
+
+            for (size_t i = 0; i < col_src->size(); ++i) {
+                auto ipv4_str = col_src->get_data_at(i).to_string();
+                vectorized::IPv4 ipv4_val;
+                if (!IPv4Value::from_string(ipv4_val, ipv4_str) || 
ipv4_str.size() > IPV4_MAX_TEXT_LENGTH) {
+                    col_res->insert_value(0);
+                } else {
+                    col_res->insert_value(ipv4_val);
+                }
+            }
+
+            DCHECK_EQ(col_res->size(), col_src->size());
+
+            block.replace_by_position(
+                    result, ColumnNullable::create(std::move(col_res), 
ColumnUInt8::create(col_src->size(), 0)));
+            return Status::OK();
+        } else {
+            return Status::RuntimeError("Illegal column {} of argument of 
function {}",
+                                        argument.column->get_name(), 
get_name());
+        }
+    }
+
+public:
+    static constexpr auto name = Name::name;
+    static FunctionPtr create() {
+        return std::make_shared<FunctionIPv4StringToNumOrDefault<Name>>();
+    }
+
+    String get_name() const override { return name; }
+
+    size_t get_number_of_arguments() const override { return 1; }

Review Comment:
   warning: function 'get_number_of_arguments' should be marked [[nodiscard]] 
[modernize-use-nodiscard]
   
   ```suggestion
       [[nodiscard]] size_t get_number_of_arguments() const override { return 
1; }
   ```
   



##########
be/src/vec/functions/function_ip.h:
##########
@@ -117,4 +110,408 @@ class FunctionIPv4NumToString : public IFunction {
                 argument.name, get_name());
     }
 };
+
+template <typename Name>
+class FunctionIPv4StringToNum : public IFunction {
+private:
+    Status execute_type(Block& block, const ColumnWithTypeAndName& argument, 
size_t result) const {
+        const ColumnPtr& column = argument.column;
+
+        if (const ColumnString* col_src = typeid_cast<const 
ColumnString*>(column.get())) {
+            auto col_res = ColumnInt64::create();
+            auto null_map = ColumnUInt8::create(col_src->size(), 0);
+
+            for (size_t i = 0; i < col_src->size(); ++i) {
+                auto ipv4_str = col_src->get_data_at(i).to_string();
+                vectorized::IPv4 ipv4_val;
+                if (!IPv4Value::from_string(ipv4_val, ipv4_str) || 
ipv4_str.size() > IPV4_MAX_TEXT_LENGTH) {
+                    null_map->get_data()[i] = 1;
+                    col_res->insert_default();
+                } else {
+                    col_res->insert_value(ipv4_val);
+                }
+            }
+
+            DCHECK_EQ(col_res->size(), col_src->size());
+            DCHECK_EQ(col_res->size(), null_map->size());
+
+            block.replace_by_position(
+                    result, ColumnNullable::create(std::move(col_res), 
std::move(null_map)));
+            return Status::OK();
+        } else {
+            return Status::RuntimeError("Illegal column {} of argument of 
function {}",
+                                        argument.column->get_name(), 
get_name());
+        }
+    }
+
+public:
+    static constexpr auto name = Name::name;
+    static FunctionPtr create() {
+        return std::make_shared<FunctionIPv4StringToNum<Name>>();
+    }
+
+    String get_name() const override { return name; }
+
+    size_t get_number_of_arguments() const override { return 1; }
+
+    DataTypePtr get_return_type_impl(const DataTypes& arguments) const 
override {
+        return make_nullable(std::make_shared<DataTypeInt64>());
+    }
+
+    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) override {
+        ColumnWithTypeAndName& argument = block.get_by_position(arguments[0]);
+
+        DCHECK(argument.type->get_type_id() == TypeIndex::String);
+
+        return execute_type(block, argument, result);
+    }
+};
+
+template <typename Name>
+class FunctionIPv4StringToNumOrDefault : public IFunction {
+private:
+    Status execute_type(Block& block, const ColumnWithTypeAndName& argument, 
size_t result) const {
+        const ColumnPtr& column = argument.column;
+
+        if (const ColumnString* col_src = typeid_cast<const 
ColumnString*>(column.get())) {
+            auto col_res = ColumnInt64::create();
+
+            for (size_t i = 0; i < col_src->size(); ++i) {
+                auto ipv4_str = col_src->get_data_at(i).to_string();
+                vectorized::IPv4 ipv4_val;
+                if (!IPv4Value::from_string(ipv4_val, ipv4_str) || 
ipv4_str.size() > IPV4_MAX_TEXT_LENGTH) {
+                    col_res->insert_value(0);
+                } else {
+                    col_res->insert_value(ipv4_val);
+                }
+            }
+
+            DCHECK_EQ(col_res->size(), col_src->size());
+
+            block.replace_by_position(
+                    result, ColumnNullable::create(std::move(col_res), 
ColumnUInt8::create(col_src->size(), 0)));
+            return Status::OK();
+        } else {
+            return Status::RuntimeError("Illegal column {} of argument of 
function {}",
+                                        argument.column->get_name(), 
get_name());
+        }
+    }
+
+public:
+    static constexpr auto name = Name::name;
+    static FunctionPtr create() {
+        return std::make_shared<FunctionIPv4StringToNumOrDefault<Name>>();
+    }
+
+    String get_name() const override { return name; }

Review Comment:
   warning: function 'get_name' should be marked [[nodiscard]] 
[modernize-use-nodiscard]
   
   ```suggestion
       [[nodiscard]] String get_name() const override { return name; }
   ```
   



##########
be/src/vec/functions/function_ip.h:
##########
@@ -117,4 +110,408 @@ class FunctionIPv4NumToString : public IFunction {
                 argument.name, get_name());
     }
 };
+
+template <typename Name>
+class FunctionIPv4StringToNum : public IFunction {
+private:
+    Status execute_type(Block& block, const ColumnWithTypeAndName& argument, 
size_t result) const {
+        const ColumnPtr& column = argument.column;
+
+        if (const ColumnString* col_src = typeid_cast<const 
ColumnString*>(column.get())) {
+            auto col_res = ColumnInt64::create();
+            auto null_map = ColumnUInt8::create(col_src->size(), 0);
+
+            for (size_t i = 0; i < col_src->size(); ++i) {
+                auto ipv4_str = col_src->get_data_at(i).to_string();
+                vectorized::IPv4 ipv4_val;
+                if (!IPv4Value::from_string(ipv4_val, ipv4_str) || 
ipv4_str.size() > IPV4_MAX_TEXT_LENGTH) {
+                    null_map->get_data()[i] = 1;
+                    col_res->insert_default();
+                } else {
+                    col_res->insert_value(ipv4_val);
+                }
+            }
+
+            DCHECK_EQ(col_res->size(), col_src->size());
+            DCHECK_EQ(col_res->size(), null_map->size());
+
+            block.replace_by_position(
+                    result, ColumnNullable::create(std::move(col_res), 
std::move(null_map)));
+            return Status::OK();
+        } else {
+            return Status::RuntimeError("Illegal column {} of argument of 
function {}",
+                                        argument.column->get_name(), 
get_name());
+        }
+    }
+
+public:
+    static constexpr auto name = Name::name;
+    static FunctionPtr create() {
+        return std::make_shared<FunctionIPv4StringToNum<Name>>();
+    }
+
+    String get_name() const override { return name; }
+
+    size_t get_number_of_arguments() const override { return 1; }
+
+    DataTypePtr get_return_type_impl(const DataTypes& arguments) const 
override {
+        return make_nullable(std::make_shared<DataTypeInt64>());
+    }
+
+    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) override {
+        ColumnWithTypeAndName& argument = block.get_by_position(arguments[0]);
+
+        DCHECK(argument.type->get_type_id() == TypeIndex::String);
+
+        return execute_type(block, argument, result);
+    }
+};
+
+template <typename Name>
+class FunctionIPv4StringToNumOrDefault : public IFunction {
+private:
+    Status execute_type(Block& block, const ColumnWithTypeAndName& argument, 
size_t result) const {
+        const ColumnPtr& column = argument.column;
+
+        if (const ColumnString* col_src = typeid_cast<const 
ColumnString*>(column.get())) {
+            auto col_res = ColumnInt64::create();
+
+            for (size_t i = 0; i < col_src->size(); ++i) {
+                auto ipv4_str = col_src->get_data_at(i).to_string();
+                vectorized::IPv4 ipv4_val;
+                if (!IPv4Value::from_string(ipv4_val, ipv4_str) || 
ipv4_str.size() > IPV4_MAX_TEXT_LENGTH) {
+                    col_res->insert_value(0);
+                } else {
+                    col_res->insert_value(ipv4_val);
+                }
+            }
+
+            DCHECK_EQ(col_res->size(), col_src->size());
+
+            block.replace_by_position(
+                    result, ColumnNullable::create(std::move(col_res), 
ColumnUInt8::create(col_src->size(), 0)));
+            return Status::OK();
+        } else {
+            return Status::RuntimeError("Illegal column {} of argument of 
function {}",
+                                        argument.column->get_name(), 
get_name());
+        }
+    }
+
+public:
+    static constexpr auto name = Name::name;
+    static FunctionPtr create() {
+        return std::make_shared<FunctionIPv4StringToNumOrDefault<Name>>();
+    }
+
+    String get_name() const override { return name; }
+
+    size_t get_number_of_arguments() const override { return 1; }
+
+    DataTypePtr get_return_type_impl(const DataTypes& arguments) const 
override {

Review Comment:
   warning: function 'get_return_type_impl' should be marked [[nodiscard]] 
[modernize-use-nodiscard]
   
   ```suggestion
       [[nodiscard]] DataTypePtr get_return_type_impl(const DataTypes& 
arguments) const override {
   ```
   



##########
be/src/vec/functions/function_ip.h:
##########
@@ -117,4 +110,408 @@ class FunctionIPv4NumToString : public IFunction {
                 argument.name, get_name());
     }
 };
+
+template <typename Name>
+class FunctionIPv4StringToNum : public IFunction {
+private:
+    Status execute_type(Block& block, const ColumnWithTypeAndName& argument, 
size_t result) const {
+        const ColumnPtr& column = argument.column;
+
+        if (const ColumnString* col_src = typeid_cast<const 
ColumnString*>(column.get())) {
+            auto col_res = ColumnInt64::create();
+            auto null_map = ColumnUInt8::create(col_src->size(), 0);
+
+            for (size_t i = 0; i < col_src->size(); ++i) {
+                auto ipv4_str = col_src->get_data_at(i).to_string();
+                vectorized::IPv4 ipv4_val;
+                if (!IPv4Value::from_string(ipv4_val, ipv4_str) || 
ipv4_str.size() > IPV4_MAX_TEXT_LENGTH) {
+                    null_map->get_data()[i] = 1;
+                    col_res->insert_default();
+                } else {
+                    col_res->insert_value(ipv4_val);
+                }
+            }
+
+            DCHECK_EQ(col_res->size(), col_src->size());
+            DCHECK_EQ(col_res->size(), null_map->size());
+
+            block.replace_by_position(
+                    result, ColumnNullable::create(std::move(col_res), 
std::move(null_map)));
+            return Status::OK();
+        } else {
+            return Status::RuntimeError("Illegal column {} of argument of 
function {}",
+                                        argument.column->get_name(), 
get_name());
+        }
+    }
+
+public:
+    static constexpr auto name = Name::name;
+    static FunctionPtr create() {
+        return std::make_shared<FunctionIPv4StringToNum<Name>>();
+    }
+
+    String get_name() const override { return name; }
+
+    size_t get_number_of_arguments() const override { return 1; }
+
+    DataTypePtr get_return_type_impl(const DataTypes& arguments) const 
override {
+        return make_nullable(std::make_shared<DataTypeInt64>());
+    }
+
+    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) override {
+        ColumnWithTypeAndName& argument = block.get_by_position(arguments[0]);
+
+        DCHECK(argument.type->get_type_id() == TypeIndex::String);
+
+        return execute_type(block, argument, result);
+    }
+};
+
+template <typename Name>
+class FunctionIPv4StringToNumOrDefault : public IFunction {
+private:
+    Status execute_type(Block& block, const ColumnWithTypeAndName& argument, 
size_t result) const {
+        const ColumnPtr& column = argument.column;
+
+        if (const ColumnString* col_src = typeid_cast<const 
ColumnString*>(column.get())) {
+            auto col_res = ColumnInt64::create();
+
+            for (size_t i = 0; i < col_src->size(); ++i) {
+                auto ipv4_str = col_src->get_data_at(i).to_string();
+                vectorized::IPv4 ipv4_val;
+                if (!IPv4Value::from_string(ipv4_val, ipv4_str) || 
ipv4_str.size() > IPV4_MAX_TEXT_LENGTH) {
+                    col_res->insert_value(0);
+                } else {
+                    col_res->insert_value(ipv4_val);
+                }
+            }
+
+            DCHECK_EQ(col_res->size(), col_src->size());
+
+            block.replace_by_position(
+                    result, ColumnNullable::create(std::move(col_res), 
ColumnUInt8::create(col_src->size(), 0)));
+            return Status::OK();
+        } else {
+            return Status::RuntimeError("Illegal column {} of argument of 
function {}",
+                                        argument.column->get_name(), 
get_name());
+        }
+    }
+
+public:
+    static constexpr auto name = Name::name;
+    static FunctionPtr create() {
+        return std::make_shared<FunctionIPv4StringToNumOrDefault<Name>>();
+    }
+
+    String get_name() const override { return name; }
+
+    size_t get_number_of_arguments() const override { return 1; }
+
+    DataTypePtr get_return_type_impl(const DataTypes& arguments) const 
override {
+        return make_nullable(std::make_shared<DataTypeInt64>());
+    }
+
+    bool use_default_implementation_for_nulls() const override { return true; }

Review Comment:
   warning: function 'use_default_implementation_for_nulls' should be marked 
[[nodiscard]] [modernize-use-nodiscard]
   
   ```suggestion
       [[nodiscard]] bool use_default_implementation_for_nulls() const override 
{ return true; }
   ```
   



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