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


##########
be/src/vec/core/wide_integer.h:
##########
@@ -0,0 +1,302 @@
+// 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.
+///////////////////////////////////////////////////////////////
+//  Distributed under the Boost Software License, Version 1.0.
+//  (See at http://www.boost.org/LICENSE_1_0.txt)
+///////////////////////////////////////////////////////////////
+
+/*  Divide and multiply
+ *
+ *
+ * Copyright (c) 2008
+ * Evan Teran
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, provided
+ * that the above copyright notice appears in all copies and that both the
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the same name not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. We make no representations about the
+ * suitability this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+// This file is copied from
+// 
https://github.com/ClickHouse/ClickHouse/blob/master/base/base/wide_integer.h
+// and modified by Doris
+#pragma once
+
+#include <cstdint>
+#include <initializer_list>
+#include <limits>
+#include <type_traits>
+
+// NOLINTBEGIN(*)
+
+namespace wide {
+template <size_t Bits, typename Signed>
+class integer;
+}
+
+namespace std {
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+struct common_type<wide::integer<Bits, Signed>, wide::integer<Bits2, Signed2>>;
+
+template <size_t Bits, typename Signed, typename Arithmetic>
+struct common_type<wide::integer<Bits, Signed>, Arithmetic>;
+
+template <typename Arithmetic, size_t Bits, typename Signed>
+struct common_type<Arithmetic, wide::integer<Bits, Signed>>;
+
+} // namespace std
+
+namespace wide {
+
+template <size_t Bits, typename Signed>
+class integer {
+public:
+    using base_type = uint64_t;
+    using signed_base_type = int64_t;
+
+    // ctors
+    constexpr integer() noexcept = default;
+
+    template <typename T>
+    constexpr integer(T rhs) noexcept;
+
+    template <typename T>
+    constexpr integer(std::initializer_list<T> il) noexcept;
+
+    // assignment
+    template <size_t Bits2, typename Signed2>
+    constexpr integer<Bits, Signed>& operator=(const integer<Bits2, Signed2>& 
rhs) noexcept;
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator=(Arithmetic rhs) noexcept;
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator*=(const Arithmetic& rhs);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator/=(const Arithmetic& rhs);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator+=(const Arithmetic& rhs) 
noexcept(
+            std::is_same_v<Signed, unsigned>);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator-=(const Arithmetic& rhs) 
noexcept(
+            std::is_same_v<Signed, unsigned>);
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator%=(const Integral& rhs);
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator&=(const Integral& rhs) noexcept;
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator|=(const Integral& rhs) noexcept;
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator^=(const Integral& rhs) noexcept;
+
+    constexpr integer<Bits, Signed>& operator<<=(int n) noexcept;
+    constexpr integer<Bits, Signed>& operator>>=(int n) noexcept;
+
+    constexpr integer<Bits, Signed>& operator++() 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed> operator++(int) 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed>& operator--() 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed> operator--(int) 
noexcept(std::is_same_v<Signed, unsigned>);
+
+    // observers
+
+    constexpr explicit operator bool() const noexcept;
+
+    template <typename T, typename = std::enable_if_t<std::is_arithmetic_v<T>, 
T>>
+    constexpr operator T() const noexcept;
+
+    constexpr operator long double() const noexcept;
+    constexpr operator double() const noexcept;
+    constexpr operator float() const noexcept;
+
+    struct _impl;
+
+    base_type items[_impl::item_count];
+
+private:
+    template <size_t Bits2, typename Signed2>

Review Comment:
   warning: unknown type name 'size_t'; did you mean 'std::size_t'? 
[clang-diagnostic-error]
   
   ```suggestion
       template <std::size_t Bits2, typename Signed2>
   ```
   <details>
   <summary>Additional context</summary>
   
   **/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:279:** 'std::size_t' 
declared here
   ```cpp
     typedef __SIZE_TYPE__      size_t;
                            ^
   ```
   
   </details>
   



##########
be/src/vec/core/wide_integer.h:
##########
@@ -0,0 +1,302 @@
+// 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.
+///////////////////////////////////////////////////////////////
+//  Distributed under the Boost Software License, Version 1.0.
+//  (See at http://www.boost.org/LICENSE_1_0.txt)
+///////////////////////////////////////////////////////////////
+
+/*  Divide and multiply
+ *
+ *
+ * Copyright (c) 2008
+ * Evan Teran
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, provided
+ * that the above copyright notice appears in all copies and that both the
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the same name not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. We make no representations about the
+ * suitability this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+// This file is copied from
+// 
https://github.com/ClickHouse/ClickHouse/blob/master/base/base/wide_integer.h
+// and modified by Doris
+#pragma once
+
+#include <cstdint>
+#include <initializer_list>
+#include <limits>
+#include <type_traits>
+
+// NOLINTBEGIN(*)
+
+namespace wide {
+template <size_t Bits, typename Signed>
+class integer;
+}
+
+namespace std {
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+struct common_type<wide::integer<Bits, Signed>, wide::integer<Bits2, Signed2>>;
+
+template <size_t Bits, typename Signed, typename Arithmetic>
+struct common_type<wide::integer<Bits, Signed>, Arithmetic>;
+
+template <typename Arithmetic, size_t Bits, typename Signed>
+struct common_type<Arithmetic, wide::integer<Bits, Signed>>;
+
+} // namespace std
+
+namespace wide {
+
+template <size_t Bits, typename Signed>
+class integer {
+public:
+    using base_type = uint64_t;
+    using signed_base_type = int64_t;
+
+    // ctors
+    constexpr integer() noexcept = default;
+
+    template <typename T>
+    constexpr integer(T rhs) noexcept;
+
+    template <typename T>
+    constexpr integer(std::initializer_list<T> il) noexcept;
+
+    // assignment
+    template <size_t Bits2, typename Signed2>
+    constexpr integer<Bits, Signed>& operator=(const integer<Bits2, Signed2>& 
rhs) noexcept;
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator=(Arithmetic rhs) noexcept;
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator*=(const Arithmetic& rhs);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator/=(const Arithmetic& rhs);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator+=(const Arithmetic& rhs) 
noexcept(
+            std::is_same_v<Signed, unsigned>);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator-=(const Arithmetic& rhs) 
noexcept(
+            std::is_same_v<Signed, unsigned>);
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator%=(const Integral& rhs);
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator&=(const Integral& rhs) noexcept;
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator|=(const Integral& rhs) noexcept;
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator^=(const Integral& rhs) noexcept;
+
+    constexpr integer<Bits, Signed>& operator<<=(int n) noexcept;
+    constexpr integer<Bits, Signed>& operator>>=(int n) noexcept;
+
+    constexpr integer<Bits, Signed>& operator++() 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed> operator++(int) 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed>& operator--() 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed> operator--(int) 
noexcept(std::is_same_v<Signed, unsigned>);
+
+    // observers
+
+    constexpr explicit operator bool() const noexcept;
+
+    template <typename T, typename = std::enable_if_t<std::is_arithmetic_v<T>, 
T>>
+    constexpr operator T() const noexcept;
+
+    constexpr operator long double() const noexcept;
+    constexpr operator double() const noexcept;
+    constexpr operator float() const noexcept;
+
+    struct _impl;
+
+    base_type items[_impl::item_count];
+
+private:
+    template <size_t Bits2, typename Signed2>
+    friend class integer;
+
+    friend class std::numeric_limits<integer<Bits, signed>>;
+    friend class std::numeric_limits<integer<Bits, unsigned>>;
+};
+
+using Int256 = integer<256, signed>;
+using UInt256 = integer<256, unsigned>;
+
+template <typename T>
+static constexpr bool ArithmeticConcept() noexcept;
+
+template <class T1, class T2>
+using _only_arithmetic =
+        typename std::enable_if<ArithmeticConcept<T1>() && 
ArithmeticConcept<T2>()>::type;
+
+template <typename T>
+static constexpr bool IntegralConcept() noexcept;
+
+template <class T, class T2>
+using _only_integer = typename std::enable_if<IntegralConcept<T>() && 
IntegralConcept<T2>()>::type;
+
+// Unary operators
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator~(const integer<Bits, Signed>& lhs) 
noexcept;
+
+template <size_t Bits, typename Signed>

Review Comment:
   warning: unknown type name 'size_t'; did you mean 'std::size_t'? 
[clang-diagnostic-error]
   
   ```suggestion
   template <std::size_t Bits, typename Signed>
   ```
   <details>
   <summary>Additional context</summary>
   
   **/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:279:** 'std::size_t' 
declared here
   ```cpp
     typedef __SIZE_TYPE__      size_t;
                            ^
   ```
   
   </details>
   



##########
be/src/vec/core/wide_integer.h:
##########
@@ -0,0 +1,302 @@
+// 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.
+///////////////////////////////////////////////////////////////
+//  Distributed under the Boost Software License, Version 1.0.
+//  (See at http://www.boost.org/LICENSE_1_0.txt)
+///////////////////////////////////////////////////////////////
+
+/*  Divide and multiply
+ *
+ *
+ * Copyright (c) 2008
+ * Evan Teran
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, provided
+ * that the above copyright notice appears in all copies and that both the
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the same name not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. We make no representations about the
+ * suitability this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+// This file is copied from
+// 
https://github.com/ClickHouse/ClickHouse/blob/master/base/base/wide_integer.h
+// and modified by Doris
+#pragma once
+
+#include <cstdint>
+#include <initializer_list>
+#include <limits>
+#include <type_traits>
+
+// NOLINTBEGIN(*)
+
+namespace wide {
+template <size_t Bits, typename Signed>
+class integer;
+}
+
+namespace std {
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+struct common_type<wide::integer<Bits, Signed>, wide::integer<Bits2, Signed2>>;
+
+template <size_t Bits, typename Signed, typename Arithmetic>
+struct common_type<wide::integer<Bits, Signed>, Arithmetic>;
+
+template <typename Arithmetic, size_t Bits, typename Signed>
+struct common_type<Arithmetic, wide::integer<Bits, Signed>>;
+
+} // namespace std
+
+namespace wide {
+
+template <size_t Bits, typename Signed>
+class integer {
+public:
+    using base_type = uint64_t;
+    using signed_base_type = int64_t;
+
+    // ctors
+    constexpr integer() noexcept = default;
+
+    template <typename T>
+    constexpr integer(T rhs) noexcept;
+
+    template <typename T>
+    constexpr integer(std::initializer_list<T> il) noexcept;
+
+    // assignment
+    template <size_t Bits2, typename Signed2>

Review Comment:
   warning: unknown type name 'size_t'; did you mean 'std::size_t'? 
[clang-diagnostic-error]
   
   ```suggestion
       template <std::size_t Bits2, typename Signed2>
   ```
   <details>
   <summary>Additional context</summary>
   
   **/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:279:** 'std::size_t' 
declared here
   ```cpp
     typedef __SIZE_TYPE__      size_t;
                            ^
   ```
   
   </details>
   



##########
be/src/vec/core/wide_integer.h:
##########
@@ -0,0 +1,302 @@
+// 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.
+///////////////////////////////////////////////////////////////
+//  Distributed under the Boost Software License, Version 1.0.
+//  (See at http://www.boost.org/LICENSE_1_0.txt)
+///////////////////////////////////////////////////////////////
+
+/*  Divide and multiply
+ *
+ *
+ * Copyright (c) 2008
+ * Evan Teran
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, provided
+ * that the above copyright notice appears in all copies and that both the
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the same name not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. We make no representations about the
+ * suitability this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+// This file is copied from
+// 
https://github.com/ClickHouse/ClickHouse/blob/master/base/base/wide_integer.h
+// and modified by Doris
+#pragma once
+
+#include <cstdint>
+#include <initializer_list>
+#include <limits>
+#include <type_traits>
+
+// NOLINTBEGIN(*)
+
+namespace wide {
+template <size_t Bits, typename Signed>
+class integer;
+}
+
+namespace std {
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+struct common_type<wide::integer<Bits, Signed>, wide::integer<Bits2, Signed2>>;
+
+template <size_t Bits, typename Signed, typename Arithmetic>
+struct common_type<wide::integer<Bits, Signed>, Arithmetic>;
+
+template <typename Arithmetic, size_t Bits, typename Signed>
+struct common_type<Arithmetic, wide::integer<Bits, Signed>>;
+
+} // namespace std
+
+namespace wide {
+
+template <size_t Bits, typename Signed>
+class integer {
+public:
+    using base_type = uint64_t;
+    using signed_base_type = int64_t;
+
+    // ctors
+    constexpr integer() noexcept = default;
+
+    template <typename T>
+    constexpr integer(T rhs) noexcept;
+
+    template <typename T>
+    constexpr integer(std::initializer_list<T> il) noexcept;
+
+    // assignment
+    template <size_t Bits2, typename Signed2>
+    constexpr integer<Bits, Signed>& operator=(const integer<Bits2, Signed2>& 
rhs) noexcept;
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator=(Arithmetic rhs) noexcept;
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator*=(const Arithmetic& rhs);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator/=(const Arithmetic& rhs);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator+=(const Arithmetic& rhs) 
noexcept(
+            std::is_same_v<Signed, unsigned>);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator-=(const Arithmetic& rhs) 
noexcept(
+            std::is_same_v<Signed, unsigned>);
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator%=(const Integral& rhs);
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator&=(const Integral& rhs) noexcept;
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator|=(const Integral& rhs) noexcept;
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator^=(const Integral& rhs) noexcept;
+
+    constexpr integer<Bits, Signed>& operator<<=(int n) noexcept;
+    constexpr integer<Bits, Signed>& operator>>=(int n) noexcept;
+
+    constexpr integer<Bits, Signed>& operator++() 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed> operator++(int) 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed>& operator--() 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed> operator--(int) 
noexcept(std::is_same_v<Signed, unsigned>);
+
+    // observers
+
+    constexpr explicit operator bool() const noexcept;
+
+    template <typename T, typename = std::enable_if_t<std::is_arithmetic_v<T>, 
T>>
+    constexpr operator T() const noexcept;
+
+    constexpr operator long double() const noexcept;
+    constexpr operator double() const noexcept;
+    constexpr operator float() const noexcept;
+
+    struct _impl;
+
+    base_type items[_impl::item_count];
+
+private:
+    template <size_t Bits2, typename Signed2>
+    friend class integer;
+
+    friend class std::numeric_limits<integer<Bits, signed>>;
+    friend class std::numeric_limits<integer<Bits, unsigned>>;
+};
+
+using Int256 = integer<256, signed>;
+using UInt256 = integer<256, unsigned>;
+
+template <typename T>
+static constexpr bool ArithmeticConcept() noexcept;
+
+template <class T1, class T2>
+using _only_arithmetic =
+        typename std::enable_if<ArithmeticConcept<T1>() && 
ArithmeticConcept<T2>()>::type;
+
+template <typename T>
+static constexpr bool IntegralConcept() noexcept;
+
+template <class T, class T2>
+using _only_integer = typename std::enable_if<IntegralConcept<T>() && 
IntegralConcept<T2>()>::type;
+
+// Unary operators
+template <size_t Bits, typename Signed>

Review Comment:
   warning: unknown type name 'size_t'; did you mean 'std::size_t'? 
[clang-diagnostic-error]
   
   ```suggestion
   template <std::size_t Bits, typename Signed>
   ```
   <details>
   <summary>Additional context</summary>
   
   **/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:279:** 'std::size_t' 
declared here
   ```cpp
     typedef __SIZE_TYPE__      size_t;
                            ^
   ```
   
   </details>
   



##########
be/src/vec/core/wide_integer.h:
##########
@@ -0,0 +1,302 @@
+// 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.
+///////////////////////////////////////////////////////////////
+//  Distributed under the Boost Software License, Version 1.0.
+//  (See at http://www.boost.org/LICENSE_1_0.txt)
+///////////////////////////////////////////////////////////////
+
+/*  Divide and multiply
+ *
+ *
+ * Copyright (c) 2008
+ * Evan Teran
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, provided
+ * that the above copyright notice appears in all copies and that both the
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the same name not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. We make no representations about the
+ * suitability this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+// This file is copied from
+// 
https://github.com/ClickHouse/ClickHouse/blob/master/base/base/wide_integer.h
+// and modified by Doris
+#pragma once
+
+#include <cstdint>
+#include <initializer_list>
+#include <limits>
+#include <type_traits>
+
+// NOLINTBEGIN(*)
+
+namespace wide {
+template <size_t Bits, typename Signed>
+class integer;
+}
+
+namespace std {
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+struct common_type<wide::integer<Bits, Signed>, wide::integer<Bits2, Signed2>>;
+
+template <size_t Bits, typename Signed, typename Arithmetic>
+struct common_type<wide::integer<Bits, Signed>, Arithmetic>;
+
+template <typename Arithmetic, size_t Bits, typename Signed>
+struct common_type<Arithmetic, wide::integer<Bits, Signed>>;
+
+} // namespace std
+
+namespace wide {
+
+template <size_t Bits, typename Signed>
+class integer {
+public:
+    using base_type = uint64_t;
+    using signed_base_type = int64_t;
+
+    // ctors
+    constexpr integer() noexcept = default;
+
+    template <typename T>
+    constexpr integer(T rhs) noexcept;
+
+    template <typename T>
+    constexpr integer(std::initializer_list<T> il) noexcept;
+
+    // assignment
+    template <size_t Bits2, typename Signed2>
+    constexpr integer<Bits, Signed>& operator=(const integer<Bits2, Signed2>& 
rhs) noexcept;
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator=(Arithmetic rhs) noexcept;
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator*=(const Arithmetic& rhs);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator/=(const Arithmetic& rhs);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator+=(const Arithmetic& rhs) 
noexcept(
+            std::is_same_v<Signed, unsigned>);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator-=(const Arithmetic& rhs) 
noexcept(
+            std::is_same_v<Signed, unsigned>);
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator%=(const Integral& rhs);
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator&=(const Integral& rhs) noexcept;
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator|=(const Integral& rhs) noexcept;
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator^=(const Integral& rhs) noexcept;
+
+    constexpr integer<Bits, Signed>& operator<<=(int n) noexcept;
+    constexpr integer<Bits, Signed>& operator>>=(int n) noexcept;
+
+    constexpr integer<Bits, Signed>& operator++() 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed> operator++(int) 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed>& operator--() 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed> operator--(int) 
noexcept(std::is_same_v<Signed, unsigned>);
+
+    // observers
+
+    constexpr explicit operator bool() const noexcept;
+
+    template <typename T, typename = std::enable_if_t<std::is_arithmetic_v<T>, 
T>>
+    constexpr operator T() const noexcept;
+
+    constexpr operator long double() const noexcept;
+    constexpr operator double() const noexcept;
+    constexpr operator float() const noexcept;
+
+    struct _impl;
+
+    base_type items[_impl::item_count];
+
+private:
+    template <size_t Bits2, typename Signed2>
+    friend class integer;
+
+    friend class std::numeric_limits<integer<Bits, signed>>;
+    friend class std::numeric_limits<integer<Bits, unsigned>>;
+};
+
+using Int256 = integer<256, signed>;
+using UInt256 = integer<256, unsigned>;
+
+template <typename T>
+static constexpr bool ArithmeticConcept() noexcept;
+
+template <class T1, class T2>
+using _only_arithmetic =
+        typename std::enable_if<ArithmeticConcept<T1>() && 
ArithmeticConcept<T2>()>::type;
+
+template <typename T>
+static constexpr bool IntegralConcept() noexcept;
+
+template <class T, class T2>
+using _only_integer = typename std::enable_if<IntegralConcept<T>() && 
IntegralConcept<T2>()>::type;
+
+// Unary operators
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator~(const integer<Bits, Signed>& lhs) 
noexcept;
+
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator-(const integer<Bits, Signed>& lhs) 
noexcept(
+        std::is_same_v<Signed, unsigned>);
+
+template <size_t Bits, typename Signed>

Review Comment:
   warning: unknown type name 'size_t'; did you mean 'std::size_t'? 
[clang-diagnostic-error]
   
   ```suggestion
   template <std::size_t Bits, typename Signed>
   ```
   <details>
   <summary>Additional context</summary>
   
   **/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:279:** 'std::size_t' 
declared here
   ```cpp
     typedef __SIZE_TYPE__      size_t;
                            ^
   ```
   
   </details>
   



##########
be/src/vec/core/wide_integer.h:
##########
@@ -0,0 +1,302 @@
+// 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.
+///////////////////////////////////////////////////////////////
+//  Distributed under the Boost Software License, Version 1.0.
+//  (See at http://www.boost.org/LICENSE_1_0.txt)
+///////////////////////////////////////////////////////////////
+
+/*  Divide and multiply
+ *
+ *
+ * Copyright (c) 2008
+ * Evan Teran
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, provided
+ * that the above copyright notice appears in all copies and that both the
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the same name not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. We make no representations about the
+ * suitability this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+// This file is copied from
+// 
https://github.com/ClickHouse/ClickHouse/blob/master/base/base/wide_integer.h
+// and modified by Doris
+#pragma once
+
+#include <cstdint>
+#include <initializer_list>
+#include <limits>
+#include <type_traits>
+
+// NOLINTBEGIN(*)
+
+namespace wide {
+template <size_t Bits, typename Signed>
+class integer;
+}
+
+namespace std {
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+struct common_type<wide::integer<Bits, Signed>, wide::integer<Bits2, Signed2>>;
+
+template <size_t Bits, typename Signed, typename Arithmetic>
+struct common_type<wide::integer<Bits, Signed>, Arithmetic>;
+
+template <typename Arithmetic, size_t Bits, typename Signed>
+struct common_type<Arithmetic, wide::integer<Bits, Signed>>;
+
+} // namespace std
+
+namespace wide {
+
+template <size_t Bits, typename Signed>
+class integer {
+public:
+    using base_type = uint64_t;
+    using signed_base_type = int64_t;
+
+    // ctors
+    constexpr integer() noexcept = default;
+
+    template <typename T>
+    constexpr integer(T rhs) noexcept;
+
+    template <typename T>
+    constexpr integer(std::initializer_list<T> il) noexcept;
+
+    // assignment
+    template <size_t Bits2, typename Signed2>
+    constexpr integer<Bits, Signed>& operator=(const integer<Bits2, Signed2>& 
rhs) noexcept;
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator=(Arithmetic rhs) noexcept;
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator*=(const Arithmetic& rhs);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator/=(const Arithmetic& rhs);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator+=(const Arithmetic& rhs) 
noexcept(
+            std::is_same_v<Signed, unsigned>);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator-=(const Arithmetic& rhs) 
noexcept(
+            std::is_same_v<Signed, unsigned>);
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator%=(const Integral& rhs);
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator&=(const Integral& rhs) noexcept;
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator|=(const Integral& rhs) noexcept;
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator^=(const Integral& rhs) noexcept;
+
+    constexpr integer<Bits, Signed>& operator<<=(int n) noexcept;
+    constexpr integer<Bits, Signed>& operator>>=(int n) noexcept;
+
+    constexpr integer<Bits, Signed>& operator++() 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed> operator++(int) 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed>& operator--() 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed> operator--(int) 
noexcept(std::is_same_v<Signed, unsigned>);
+
+    // observers
+
+    constexpr explicit operator bool() const noexcept;
+
+    template <typename T, typename = std::enable_if_t<std::is_arithmetic_v<T>, 
T>>
+    constexpr operator T() const noexcept;
+
+    constexpr operator long double() const noexcept;
+    constexpr operator double() const noexcept;
+    constexpr operator float() const noexcept;
+
+    struct _impl;
+
+    base_type items[_impl::item_count];
+
+private:
+    template <size_t Bits2, typename Signed2>
+    friend class integer;
+
+    friend class std::numeric_limits<integer<Bits, signed>>;
+    friend class std::numeric_limits<integer<Bits, unsigned>>;
+};
+
+using Int256 = integer<256, signed>;
+using UInt256 = integer<256, unsigned>;
+
+template <typename T>
+static constexpr bool ArithmeticConcept() noexcept;
+
+template <class T1, class T2>
+using _only_arithmetic =
+        typename std::enable_if<ArithmeticConcept<T1>() && 
ArithmeticConcept<T2>()>::type;
+
+template <typename T>
+static constexpr bool IntegralConcept() noexcept;
+
+template <class T, class T2>
+using _only_integer = typename std::enable_if<IntegralConcept<T>() && 
IntegralConcept<T2>()>::type;
+
+// Unary operators
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator~(const integer<Bits, Signed>& lhs) 
noexcept;
+
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator-(const integer<Bits, Signed>& lhs) 
noexcept(
+        std::is_same_v<Signed, unsigned>);
+
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator+(const integer<Bits, Signed>& lhs) 
noexcept(
+        std::is_same_v<Signed, unsigned>);
+
+// Binary operators
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>

Review Comment:
   warning: unknown type name 'size_t'; did you mean 'std::size_t'? 
[clang-diagnostic-error]
   
   ```suggestion
   template <std::size_t Bits, typename Signed, size_t Bits2, typename Signed2>
   ```
   <details>
   <summary>Additional context</summary>
   
   **/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:279:** 'std::size_t' 
declared here
   ```cpp
     typedef __SIZE_TYPE__      size_t;
                            ^
   ```
   
   </details>
   



##########
be/src/vec/core/wide_integer.h:
##########
@@ -0,0 +1,302 @@
+// 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.
+///////////////////////////////////////////////////////////////
+//  Distributed under the Boost Software License, Version 1.0.
+//  (See at http://www.boost.org/LICENSE_1_0.txt)
+///////////////////////////////////////////////////////////////
+
+/*  Divide and multiply
+ *
+ *
+ * Copyright (c) 2008
+ * Evan Teran
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, provided
+ * that the above copyright notice appears in all copies and that both the
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the same name not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. We make no representations about the
+ * suitability this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+// This file is copied from
+// 
https://github.com/ClickHouse/ClickHouse/blob/master/base/base/wide_integer.h
+// and modified by Doris
+#pragma once
+
+#include <cstdint>
+#include <initializer_list>
+#include <limits>
+#include <type_traits>
+
+// NOLINTBEGIN(*)
+
+namespace wide {
+template <size_t Bits, typename Signed>
+class integer;
+}
+
+namespace std {
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+struct common_type<wide::integer<Bits, Signed>, wide::integer<Bits2, Signed2>>;
+
+template <size_t Bits, typename Signed, typename Arithmetic>
+struct common_type<wide::integer<Bits, Signed>, Arithmetic>;
+
+template <typename Arithmetic, size_t Bits, typename Signed>
+struct common_type<Arithmetic, wide::integer<Bits, Signed>>;
+
+} // namespace std
+
+namespace wide {
+
+template <size_t Bits, typename Signed>
+class integer {
+public:
+    using base_type = uint64_t;
+    using signed_base_type = int64_t;
+
+    // ctors
+    constexpr integer() noexcept = default;
+
+    template <typename T>
+    constexpr integer(T rhs) noexcept;
+
+    template <typename T>
+    constexpr integer(std::initializer_list<T> il) noexcept;
+
+    // assignment
+    template <size_t Bits2, typename Signed2>
+    constexpr integer<Bits, Signed>& operator=(const integer<Bits2, Signed2>& 
rhs) noexcept;
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator=(Arithmetic rhs) noexcept;
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator*=(const Arithmetic& rhs);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator/=(const Arithmetic& rhs);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator+=(const Arithmetic& rhs) 
noexcept(
+            std::is_same_v<Signed, unsigned>);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator-=(const Arithmetic& rhs) 
noexcept(
+            std::is_same_v<Signed, unsigned>);
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator%=(const Integral& rhs);
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator&=(const Integral& rhs) noexcept;
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator|=(const Integral& rhs) noexcept;
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator^=(const Integral& rhs) noexcept;
+
+    constexpr integer<Bits, Signed>& operator<<=(int n) noexcept;
+    constexpr integer<Bits, Signed>& operator>>=(int n) noexcept;
+
+    constexpr integer<Bits, Signed>& operator++() 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed> operator++(int) 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed>& operator--() 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed> operator--(int) 
noexcept(std::is_same_v<Signed, unsigned>);
+
+    // observers
+
+    constexpr explicit operator bool() const noexcept;
+
+    template <typename T, typename = std::enable_if_t<std::is_arithmetic_v<T>, 
T>>
+    constexpr operator T() const noexcept;
+
+    constexpr operator long double() const noexcept;
+    constexpr operator double() const noexcept;
+    constexpr operator float() const noexcept;
+
+    struct _impl;
+
+    base_type items[_impl::item_count];
+
+private:
+    template <size_t Bits2, typename Signed2>
+    friend class integer;
+
+    friend class std::numeric_limits<integer<Bits, signed>>;
+    friend class std::numeric_limits<integer<Bits, unsigned>>;
+};
+
+using Int256 = integer<256, signed>;
+using UInt256 = integer<256, unsigned>;
+
+template <typename T>
+static constexpr bool ArithmeticConcept() noexcept;
+
+template <class T1, class T2>
+using _only_arithmetic =
+        typename std::enable_if<ArithmeticConcept<T1>() && 
ArithmeticConcept<T2>()>::type;
+
+template <typename T>
+static constexpr bool IntegralConcept() noexcept;
+
+template <class T, class T2>
+using _only_integer = typename std::enable_if<IntegralConcept<T>() && 
IntegralConcept<T2>()>::type;
+
+// Unary operators
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator~(const integer<Bits, Signed>& lhs) 
noexcept;
+
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator-(const integer<Bits, Signed>& lhs) 
noexcept(
+        std::is_same_v<Signed, unsigned>);
+
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator+(const integer<Bits, Signed>& lhs) 
noexcept(
+        std::is_same_v<Signed, unsigned>);
+
+// Binary operators
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>

Review Comment:
   warning: unknown type name 'size_t'; did you mean 'std::size_t'? 
[clang-diagnostic-error]
   
   ```suggestion
   template <size_t Bits, typename Signed, std::size_t Bits2, typename Signed2>
   ```
   <details>
   <summary>Additional context</summary>
   
   **/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:279:** 'std::size_t' 
declared here
   ```cpp
     typedef __SIZE_TYPE__      size_t;
                            ^
   ```
   
   </details>
   



##########
be/src/vec/core/wide_integer.h:
##########
@@ -0,0 +1,302 @@
+// 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.
+///////////////////////////////////////////////////////////////
+//  Distributed under the Boost Software License, Version 1.0.
+//  (See at http://www.boost.org/LICENSE_1_0.txt)
+///////////////////////////////////////////////////////////////
+
+/*  Divide and multiply
+ *
+ *
+ * Copyright (c) 2008
+ * Evan Teran
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, provided
+ * that the above copyright notice appears in all copies and that both the
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the same name not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. We make no representations about the
+ * suitability this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+// This file is copied from
+// 
https://github.com/ClickHouse/ClickHouse/blob/master/base/base/wide_integer.h
+// and modified by Doris
+#pragma once
+
+#include <cstdint>
+#include <initializer_list>
+#include <limits>
+#include <type_traits>
+
+// NOLINTBEGIN(*)
+
+namespace wide {
+template <size_t Bits, typename Signed>
+class integer;
+}
+
+namespace std {
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+struct common_type<wide::integer<Bits, Signed>, wide::integer<Bits2, Signed2>>;
+
+template <size_t Bits, typename Signed, typename Arithmetic>
+struct common_type<wide::integer<Bits, Signed>, Arithmetic>;
+
+template <typename Arithmetic, size_t Bits, typename Signed>
+struct common_type<Arithmetic, wide::integer<Bits, Signed>>;
+
+} // namespace std
+
+namespace wide {
+
+template <size_t Bits, typename Signed>
+class integer {
+public:
+    using base_type = uint64_t;
+    using signed_base_type = int64_t;
+
+    // ctors
+    constexpr integer() noexcept = default;
+
+    template <typename T>
+    constexpr integer(T rhs) noexcept;
+
+    template <typename T>
+    constexpr integer(std::initializer_list<T> il) noexcept;
+
+    // assignment
+    template <size_t Bits2, typename Signed2>
+    constexpr integer<Bits, Signed>& operator=(const integer<Bits2, Signed2>& 
rhs) noexcept;
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator=(Arithmetic rhs) noexcept;
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator*=(const Arithmetic& rhs);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator/=(const Arithmetic& rhs);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator+=(const Arithmetic& rhs) 
noexcept(
+            std::is_same_v<Signed, unsigned>);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator-=(const Arithmetic& rhs) 
noexcept(
+            std::is_same_v<Signed, unsigned>);
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator%=(const Integral& rhs);
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator&=(const Integral& rhs) noexcept;
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator|=(const Integral& rhs) noexcept;
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator^=(const Integral& rhs) noexcept;
+
+    constexpr integer<Bits, Signed>& operator<<=(int n) noexcept;
+    constexpr integer<Bits, Signed>& operator>>=(int n) noexcept;
+
+    constexpr integer<Bits, Signed>& operator++() 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed> operator++(int) 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed>& operator--() 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed> operator--(int) 
noexcept(std::is_same_v<Signed, unsigned>);
+
+    // observers
+
+    constexpr explicit operator bool() const noexcept;
+
+    template <typename T, typename = std::enable_if_t<std::is_arithmetic_v<T>, 
T>>
+    constexpr operator T() const noexcept;
+
+    constexpr operator long double() const noexcept;
+    constexpr operator double() const noexcept;
+    constexpr operator float() const noexcept;
+
+    struct _impl;
+
+    base_type items[_impl::item_count];
+
+private:
+    template <size_t Bits2, typename Signed2>
+    friend class integer;
+
+    friend class std::numeric_limits<integer<Bits, signed>>;
+    friend class std::numeric_limits<integer<Bits, unsigned>>;
+};
+
+using Int256 = integer<256, signed>;
+using UInt256 = integer<256, unsigned>;
+
+template <typename T>
+static constexpr bool ArithmeticConcept() noexcept;
+
+template <class T1, class T2>
+using _only_arithmetic =
+        typename std::enable_if<ArithmeticConcept<T1>() && 
ArithmeticConcept<T2>()>::type;
+
+template <typename T>
+static constexpr bool IntegralConcept() noexcept;
+
+template <class T, class T2>
+using _only_integer = typename std::enable_if<IntegralConcept<T>() && 
IntegralConcept<T2>()>::type;
+
+// Unary operators
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator~(const integer<Bits, Signed>& lhs) 
noexcept;
+
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator-(const integer<Bits, Signed>& lhs) 
noexcept(
+        std::is_same_v<Signed, unsigned>);
+
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator+(const integer<Bits, Signed>& lhs) 
noexcept(
+        std::is_same_v<Signed, unsigned>);
+
+// Binary operators
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+std::common_type_t<integer<Bits, Signed>, integer<Bits2, Signed2>> constexpr 
operator*(
+        const integer<Bits, Signed>& lhs, const integer<Bits2, Signed2>& rhs);
+template <typename Arithmetic, typename Arithmetic2,
+          class = _only_arithmetic<Arithmetic, Arithmetic2>>
+std::common_type_t<Arithmetic, Arithmetic2> constexpr operator*(const 
Arithmetic& rhs,
+                                                                const 
Arithmetic2& lhs);
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+std::common_type_t<integer<Bits, Signed>, integer<Bits2, Signed2>> constexpr 
operator/(
+        const integer<Bits, Signed>& lhs, const integer<Bits2, Signed2>& rhs);
+template <typename Arithmetic, typename Arithmetic2,
+          class = _only_arithmetic<Arithmetic, Arithmetic2>>
+std::common_type_t<Arithmetic, Arithmetic2> constexpr operator/(const 
Arithmetic& rhs,
+                                                                const 
Arithmetic2& lhs);
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>

Review Comment:
   warning: unknown type name 'size_t'; did you mean 'std::size_t'? 
[clang-diagnostic-error]
   
   ```suggestion
   template <std::size_t Bits, typename Signed, size_t Bits2, typename Signed2>
   ```
   <details>
   <summary>Additional context</summary>
   
   **/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:279:** 'std::size_t' 
declared here
   ```cpp
     typedef __SIZE_TYPE__      size_t;
                            ^
   ```
   
   </details>
   



##########
be/src/vec/core/wide_integer.h:
##########
@@ -0,0 +1,302 @@
+// 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.
+///////////////////////////////////////////////////////////////
+//  Distributed under the Boost Software License, Version 1.0.
+//  (See at http://www.boost.org/LICENSE_1_0.txt)
+///////////////////////////////////////////////////////////////
+
+/*  Divide and multiply
+ *
+ *
+ * Copyright (c) 2008
+ * Evan Teran
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, provided
+ * that the above copyright notice appears in all copies and that both the
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the same name not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. We make no representations about the
+ * suitability this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+// This file is copied from
+// 
https://github.com/ClickHouse/ClickHouse/blob/master/base/base/wide_integer.h
+// and modified by Doris
+#pragma once
+
+#include <cstdint>
+#include <initializer_list>
+#include <limits>
+#include <type_traits>
+
+// NOLINTBEGIN(*)
+
+namespace wide {
+template <size_t Bits, typename Signed>
+class integer;
+}
+
+namespace std {
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+struct common_type<wide::integer<Bits, Signed>, wide::integer<Bits2, Signed2>>;
+
+template <size_t Bits, typename Signed, typename Arithmetic>
+struct common_type<wide::integer<Bits, Signed>, Arithmetic>;
+
+template <typename Arithmetic, size_t Bits, typename Signed>
+struct common_type<Arithmetic, wide::integer<Bits, Signed>>;
+
+} // namespace std
+
+namespace wide {
+
+template <size_t Bits, typename Signed>
+class integer {
+public:
+    using base_type = uint64_t;
+    using signed_base_type = int64_t;
+
+    // ctors
+    constexpr integer() noexcept = default;
+
+    template <typename T>
+    constexpr integer(T rhs) noexcept;
+
+    template <typename T>
+    constexpr integer(std::initializer_list<T> il) noexcept;
+
+    // assignment
+    template <size_t Bits2, typename Signed2>
+    constexpr integer<Bits, Signed>& operator=(const integer<Bits2, Signed2>& 
rhs) noexcept;
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator=(Arithmetic rhs) noexcept;
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator*=(const Arithmetic& rhs);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator/=(const Arithmetic& rhs);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator+=(const Arithmetic& rhs) 
noexcept(
+            std::is_same_v<Signed, unsigned>);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator-=(const Arithmetic& rhs) 
noexcept(
+            std::is_same_v<Signed, unsigned>);
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator%=(const Integral& rhs);
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator&=(const Integral& rhs) noexcept;
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator|=(const Integral& rhs) noexcept;
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator^=(const Integral& rhs) noexcept;
+
+    constexpr integer<Bits, Signed>& operator<<=(int n) noexcept;
+    constexpr integer<Bits, Signed>& operator>>=(int n) noexcept;
+
+    constexpr integer<Bits, Signed>& operator++() 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed> operator++(int) 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed>& operator--() 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed> operator--(int) 
noexcept(std::is_same_v<Signed, unsigned>);
+
+    // observers
+
+    constexpr explicit operator bool() const noexcept;
+
+    template <typename T, typename = std::enable_if_t<std::is_arithmetic_v<T>, 
T>>
+    constexpr operator T() const noexcept;
+
+    constexpr operator long double() const noexcept;
+    constexpr operator double() const noexcept;
+    constexpr operator float() const noexcept;
+
+    struct _impl;
+
+    base_type items[_impl::item_count];
+
+private:
+    template <size_t Bits2, typename Signed2>
+    friend class integer;
+
+    friend class std::numeric_limits<integer<Bits, signed>>;
+    friend class std::numeric_limits<integer<Bits, unsigned>>;
+};
+
+using Int256 = integer<256, signed>;
+using UInt256 = integer<256, unsigned>;
+
+template <typename T>
+static constexpr bool ArithmeticConcept() noexcept;
+
+template <class T1, class T2>
+using _only_arithmetic =
+        typename std::enable_if<ArithmeticConcept<T1>() && 
ArithmeticConcept<T2>()>::type;
+
+template <typename T>
+static constexpr bool IntegralConcept() noexcept;
+
+template <class T, class T2>
+using _only_integer = typename std::enable_if<IntegralConcept<T>() && 
IntegralConcept<T2>()>::type;
+
+// Unary operators
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator~(const integer<Bits, Signed>& lhs) 
noexcept;
+
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator-(const integer<Bits, Signed>& lhs) 
noexcept(
+        std::is_same_v<Signed, unsigned>);
+
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator+(const integer<Bits, Signed>& lhs) 
noexcept(
+        std::is_same_v<Signed, unsigned>);
+
+// Binary operators
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+std::common_type_t<integer<Bits, Signed>, integer<Bits2, Signed2>> constexpr 
operator*(
+        const integer<Bits, Signed>& lhs, const integer<Bits2, Signed2>& rhs);
+template <typename Arithmetic, typename Arithmetic2,
+          class = _only_arithmetic<Arithmetic, Arithmetic2>>
+std::common_type_t<Arithmetic, Arithmetic2> constexpr operator*(const 
Arithmetic& rhs,
+                                                                const 
Arithmetic2& lhs);
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+std::common_type_t<integer<Bits, Signed>, integer<Bits2, Signed2>> constexpr 
operator/(
+        const integer<Bits, Signed>& lhs, const integer<Bits2, Signed2>& rhs);
+template <typename Arithmetic, typename Arithmetic2,
+          class = _only_arithmetic<Arithmetic, Arithmetic2>>
+std::common_type_t<Arithmetic, Arithmetic2> constexpr operator/(const 
Arithmetic& rhs,
+                                                                const 
Arithmetic2& lhs);
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+std::common_type_t<integer<Bits, Signed>, integer<Bits2, Signed2>> constexpr 
operator+(
+        const integer<Bits, Signed>& lhs, const integer<Bits2, Signed2>& rhs);
+template <typename Arithmetic, typename Arithmetic2,
+          class = _only_arithmetic<Arithmetic, Arithmetic2>>
+std::common_type_t<Arithmetic, Arithmetic2> constexpr operator+(const 
Arithmetic& rhs,
+                                                                const 
Arithmetic2& lhs);
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>

Review Comment:
   warning: unknown type name 'size_t'; did you mean 'std::size_t'? 
[clang-diagnostic-error]
   
   ```suggestion
   template <std::size_t Bits, typename Signed, size_t Bits2, typename Signed2>
   ```
   <details>
   <summary>Additional context</summary>
   
   **/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:279:** 'std::size_t' 
declared here
   ```cpp
     typedef __SIZE_TYPE__      size_t;
                            ^
   ```
   
   </details>
   



##########
be/src/vec/core/wide_integer.h:
##########
@@ -0,0 +1,302 @@
+// 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.
+///////////////////////////////////////////////////////////////
+//  Distributed under the Boost Software License, Version 1.0.
+//  (See at http://www.boost.org/LICENSE_1_0.txt)
+///////////////////////////////////////////////////////////////
+
+/*  Divide and multiply
+ *
+ *
+ * Copyright (c) 2008
+ * Evan Teran
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, provided
+ * that the above copyright notice appears in all copies and that both the
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the same name not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. We make no representations about the
+ * suitability this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+// This file is copied from
+// 
https://github.com/ClickHouse/ClickHouse/blob/master/base/base/wide_integer.h
+// and modified by Doris
+#pragma once
+
+#include <cstdint>
+#include <initializer_list>
+#include <limits>
+#include <type_traits>
+
+// NOLINTBEGIN(*)
+
+namespace wide {
+template <size_t Bits, typename Signed>
+class integer;
+}
+
+namespace std {
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+struct common_type<wide::integer<Bits, Signed>, wide::integer<Bits2, Signed2>>;
+
+template <size_t Bits, typename Signed, typename Arithmetic>
+struct common_type<wide::integer<Bits, Signed>, Arithmetic>;
+
+template <typename Arithmetic, size_t Bits, typename Signed>
+struct common_type<Arithmetic, wide::integer<Bits, Signed>>;
+
+} // namespace std
+
+namespace wide {
+
+template <size_t Bits, typename Signed>
+class integer {
+public:
+    using base_type = uint64_t;
+    using signed_base_type = int64_t;
+
+    // ctors
+    constexpr integer() noexcept = default;
+
+    template <typename T>
+    constexpr integer(T rhs) noexcept;
+
+    template <typename T>
+    constexpr integer(std::initializer_list<T> il) noexcept;
+
+    // assignment
+    template <size_t Bits2, typename Signed2>
+    constexpr integer<Bits, Signed>& operator=(const integer<Bits2, Signed2>& 
rhs) noexcept;
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator=(Arithmetic rhs) noexcept;
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator*=(const Arithmetic& rhs);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator/=(const Arithmetic& rhs);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator+=(const Arithmetic& rhs) 
noexcept(
+            std::is_same_v<Signed, unsigned>);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator-=(const Arithmetic& rhs) 
noexcept(
+            std::is_same_v<Signed, unsigned>);
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator%=(const Integral& rhs);
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator&=(const Integral& rhs) noexcept;
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator|=(const Integral& rhs) noexcept;
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator^=(const Integral& rhs) noexcept;
+
+    constexpr integer<Bits, Signed>& operator<<=(int n) noexcept;
+    constexpr integer<Bits, Signed>& operator>>=(int n) noexcept;
+
+    constexpr integer<Bits, Signed>& operator++() 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed> operator++(int) 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed>& operator--() 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed> operator--(int) 
noexcept(std::is_same_v<Signed, unsigned>);
+
+    // observers
+
+    constexpr explicit operator bool() const noexcept;
+
+    template <typename T, typename = std::enable_if_t<std::is_arithmetic_v<T>, 
T>>
+    constexpr operator T() const noexcept;
+
+    constexpr operator long double() const noexcept;
+    constexpr operator double() const noexcept;
+    constexpr operator float() const noexcept;
+
+    struct _impl;
+
+    base_type items[_impl::item_count];
+
+private:
+    template <size_t Bits2, typename Signed2>
+    friend class integer;
+
+    friend class std::numeric_limits<integer<Bits, signed>>;
+    friend class std::numeric_limits<integer<Bits, unsigned>>;
+};
+
+using Int256 = integer<256, signed>;
+using UInt256 = integer<256, unsigned>;
+
+template <typename T>
+static constexpr bool ArithmeticConcept() noexcept;
+
+template <class T1, class T2>
+using _only_arithmetic =
+        typename std::enable_if<ArithmeticConcept<T1>() && 
ArithmeticConcept<T2>()>::type;
+
+template <typename T>
+static constexpr bool IntegralConcept() noexcept;
+
+template <class T, class T2>
+using _only_integer = typename std::enable_if<IntegralConcept<T>() && 
IntegralConcept<T2>()>::type;
+
+// Unary operators
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator~(const integer<Bits, Signed>& lhs) 
noexcept;
+
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator-(const integer<Bits, Signed>& lhs) 
noexcept(
+        std::is_same_v<Signed, unsigned>);
+
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator+(const integer<Bits, Signed>& lhs) 
noexcept(
+        std::is_same_v<Signed, unsigned>);
+
+// Binary operators
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+std::common_type_t<integer<Bits, Signed>, integer<Bits2, Signed2>> constexpr 
operator*(
+        const integer<Bits, Signed>& lhs, const integer<Bits2, Signed2>& rhs);
+template <typename Arithmetic, typename Arithmetic2,
+          class = _only_arithmetic<Arithmetic, Arithmetic2>>
+std::common_type_t<Arithmetic, Arithmetic2> constexpr operator*(const 
Arithmetic& rhs,
+                                                                const 
Arithmetic2& lhs);
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>

Review Comment:
   warning: unknown type name 'size_t'; did you mean 'std::size_t'? 
[clang-diagnostic-error]
   
   ```suggestion
   template <std::size_t Bits, typename Signed, size_t Bits2, typename Signed2>
   ```
   <details>
   <summary>Additional context</summary>
   
   **/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:279:** 'std::size_t' 
declared here
   ```cpp
     typedef __SIZE_TYPE__      size_t;
                            ^
   ```
   
   </details>
   



##########
be/src/vec/core/wide_integer.h:
##########
@@ -0,0 +1,302 @@
+// 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.
+///////////////////////////////////////////////////////////////
+//  Distributed under the Boost Software License, Version 1.0.
+//  (See at http://www.boost.org/LICENSE_1_0.txt)
+///////////////////////////////////////////////////////////////
+
+/*  Divide and multiply
+ *
+ *
+ * Copyright (c) 2008
+ * Evan Teran
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, provided
+ * that the above copyright notice appears in all copies and that both the
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the same name not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. We make no representations about the
+ * suitability this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+// This file is copied from
+// 
https://github.com/ClickHouse/ClickHouse/blob/master/base/base/wide_integer.h
+// and modified by Doris
+#pragma once
+
+#include <cstdint>
+#include <initializer_list>
+#include <limits>
+#include <type_traits>
+
+// NOLINTBEGIN(*)
+
+namespace wide {
+template <size_t Bits, typename Signed>
+class integer;
+}
+
+namespace std {
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+struct common_type<wide::integer<Bits, Signed>, wide::integer<Bits2, Signed2>>;
+
+template <size_t Bits, typename Signed, typename Arithmetic>
+struct common_type<wide::integer<Bits, Signed>, Arithmetic>;
+
+template <typename Arithmetic, size_t Bits, typename Signed>
+struct common_type<Arithmetic, wide::integer<Bits, Signed>>;
+
+} // namespace std
+
+namespace wide {
+
+template <size_t Bits, typename Signed>
+class integer {
+public:
+    using base_type = uint64_t;
+    using signed_base_type = int64_t;
+
+    // ctors
+    constexpr integer() noexcept = default;
+
+    template <typename T>
+    constexpr integer(T rhs) noexcept;
+
+    template <typename T>
+    constexpr integer(std::initializer_list<T> il) noexcept;
+
+    // assignment
+    template <size_t Bits2, typename Signed2>
+    constexpr integer<Bits, Signed>& operator=(const integer<Bits2, Signed2>& 
rhs) noexcept;
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator=(Arithmetic rhs) noexcept;
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator*=(const Arithmetic& rhs);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator/=(const Arithmetic& rhs);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator+=(const Arithmetic& rhs) 
noexcept(
+            std::is_same_v<Signed, unsigned>);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator-=(const Arithmetic& rhs) 
noexcept(
+            std::is_same_v<Signed, unsigned>);
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator%=(const Integral& rhs);
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator&=(const Integral& rhs) noexcept;
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator|=(const Integral& rhs) noexcept;
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator^=(const Integral& rhs) noexcept;
+
+    constexpr integer<Bits, Signed>& operator<<=(int n) noexcept;
+    constexpr integer<Bits, Signed>& operator>>=(int n) noexcept;
+
+    constexpr integer<Bits, Signed>& operator++() 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed> operator++(int) 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed>& operator--() 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed> operator--(int) 
noexcept(std::is_same_v<Signed, unsigned>);
+
+    // observers
+
+    constexpr explicit operator bool() const noexcept;
+
+    template <typename T, typename = std::enable_if_t<std::is_arithmetic_v<T>, 
T>>
+    constexpr operator T() const noexcept;
+
+    constexpr operator long double() const noexcept;
+    constexpr operator double() const noexcept;
+    constexpr operator float() const noexcept;
+
+    struct _impl;
+
+    base_type items[_impl::item_count];
+
+private:
+    template <size_t Bits2, typename Signed2>
+    friend class integer;
+
+    friend class std::numeric_limits<integer<Bits, signed>>;
+    friend class std::numeric_limits<integer<Bits, unsigned>>;
+};
+
+using Int256 = integer<256, signed>;
+using UInt256 = integer<256, unsigned>;
+
+template <typename T>
+static constexpr bool ArithmeticConcept() noexcept;
+
+template <class T1, class T2>
+using _only_arithmetic =
+        typename std::enable_if<ArithmeticConcept<T1>() && 
ArithmeticConcept<T2>()>::type;
+
+template <typename T>
+static constexpr bool IntegralConcept() noexcept;
+
+template <class T, class T2>
+using _only_integer = typename std::enable_if<IntegralConcept<T>() && 
IntegralConcept<T2>()>::type;
+
+// Unary operators
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator~(const integer<Bits, Signed>& lhs) 
noexcept;
+
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator-(const integer<Bits, Signed>& lhs) 
noexcept(
+        std::is_same_v<Signed, unsigned>);
+
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator+(const integer<Bits, Signed>& lhs) 
noexcept(
+        std::is_same_v<Signed, unsigned>);
+
+// Binary operators
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+std::common_type_t<integer<Bits, Signed>, integer<Bits2, Signed2>> constexpr 
operator*(
+        const integer<Bits, Signed>& lhs, const integer<Bits2, Signed2>& rhs);
+template <typename Arithmetic, typename Arithmetic2,
+          class = _only_arithmetic<Arithmetic, Arithmetic2>>
+std::common_type_t<Arithmetic, Arithmetic2> constexpr operator*(const 
Arithmetic& rhs,
+                                                                const 
Arithmetic2& lhs);
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+std::common_type_t<integer<Bits, Signed>, integer<Bits2, Signed2>> constexpr 
operator/(
+        const integer<Bits, Signed>& lhs, const integer<Bits2, Signed2>& rhs);
+template <typename Arithmetic, typename Arithmetic2,
+          class = _only_arithmetic<Arithmetic, Arithmetic2>>
+std::common_type_t<Arithmetic, Arithmetic2> constexpr operator/(const 
Arithmetic& rhs,
+                                                                const 
Arithmetic2& lhs);
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>

Review Comment:
   warning: unknown type name 'size_t'; did you mean 'std::size_t'? 
[clang-diagnostic-error]
   
   ```suggestion
   template <size_t Bits, typename Signed, std::size_t Bits2, typename Signed2>
   ```
   <details>
   <summary>Additional context</summary>
   
   **/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:279:** 'std::size_t' 
declared here
   ```cpp
     typedef __SIZE_TYPE__      size_t;
                            ^
   ```
   
   </details>
   



##########
be/src/vec/core/wide_integer.h:
##########
@@ -0,0 +1,302 @@
+// 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.
+///////////////////////////////////////////////////////////////
+//  Distributed under the Boost Software License, Version 1.0.
+//  (See at http://www.boost.org/LICENSE_1_0.txt)
+///////////////////////////////////////////////////////////////
+
+/*  Divide and multiply
+ *
+ *
+ * Copyright (c) 2008
+ * Evan Teran
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, provided
+ * that the above copyright notice appears in all copies and that both the
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the same name not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. We make no representations about the
+ * suitability this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+// This file is copied from
+// 
https://github.com/ClickHouse/ClickHouse/blob/master/base/base/wide_integer.h
+// and modified by Doris
+#pragma once
+
+#include <cstdint>
+#include <initializer_list>
+#include <limits>
+#include <type_traits>
+
+// NOLINTBEGIN(*)
+
+namespace wide {
+template <size_t Bits, typename Signed>
+class integer;
+}
+
+namespace std {
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+struct common_type<wide::integer<Bits, Signed>, wide::integer<Bits2, Signed2>>;
+
+template <size_t Bits, typename Signed, typename Arithmetic>
+struct common_type<wide::integer<Bits, Signed>, Arithmetic>;
+
+template <typename Arithmetic, size_t Bits, typename Signed>
+struct common_type<Arithmetic, wide::integer<Bits, Signed>>;
+
+} // namespace std
+
+namespace wide {
+
+template <size_t Bits, typename Signed>
+class integer {
+public:
+    using base_type = uint64_t;
+    using signed_base_type = int64_t;
+
+    // ctors
+    constexpr integer() noexcept = default;
+
+    template <typename T>
+    constexpr integer(T rhs) noexcept;
+
+    template <typename T>
+    constexpr integer(std::initializer_list<T> il) noexcept;
+
+    // assignment
+    template <size_t Bits2, typename Signed2>
+    constexpr integer<Bits, Signed>& operator=(const integer<Bits2, Signed2>& 
rhs) noexcept;
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator=(Arithmetic rhs) noexcept;
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator*=(const Arithmetic& rhs);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator/=(const Arithmetic& rhs);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator+=(const Arithmetic& rhs) 
noexcept(
+            std::is_same_v<Signed, unsigned>);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator-=(const Arithmetic& rhs) 
noexcept(
+            std::is_same_v<Signed, unsigned>);
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator%=(const Integral& rhs);
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator&=(const Integral& rhs) noexcept;
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator|=(const Integral& rhs) noexcept;
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator^=(const Integral& rhs) noexcept;
+
+    constexpr integer<Bits, Signed>& operator<<=(int n) noexcept;
+    constexpr integer<Bits, Signed>& operator>>=(int n) noexcept;
+
+    constexpr integer<Bits, Signed>& operator++() 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed> operator++(int) 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed>& operator--() 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed> operator--(int) 
noexcept(std::is_same_v<Signed, unsigned>);
+
+    // observers
+
+    constexpr explicit operator bool() const noexcept;
+
+    template <typename T, typename = std::enable_if_t<std::is_arithmetic_v<T>, 
T>>
+    constexpr operator T() const noexcept;
+
+    constexpr operator long double() const noexcept;
+    constexpr operator double() const noexcept;
+    constexpr operator float() const noexcept;
+
+    struct _impl;
+
+    base_type items[_impl::item_count];
+
+private:
+    template <size_t Bits2, typename Signed2>
+    friend class integer;
+
+    friend class std::numeric_limits<integer<Bits, signed>>;
+    friend class std::numeric_limits<integer<Bits, unsigned>>;
+};
+
+using Int256 = integer<256, signed>;
+using UInt256 = integer<256, unsigned>;
+
+template <typename T>
+static constexpr bool ArithmeticConcept() noexcept;
+
+template <class T1, class T2>
+using _only_arithmetic =
+        typename std::enable_if<ArithmeticConcept<T1>() && 
ArithmeticConcept<T2>()>::type;
+
+template <typename T>
+static constexpr bool IntegralConcept() noexcept;
+
+template <class T, class T2>
+using _only_integer = typename std::enable_if<IntegralConcept<T>() && 
IntegralConcept<T2>()>::type;
+
+// Unary operators
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator~(const integer<Bits, Signed>& lhs) 
noexcept;
+
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator-(const integer<Bits, Signed>& lhs) 
noexcept(
+        std::is_same_v<Signed, unsigned>);
+
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator+(const integer<Bits, Signed>& lhs) 
noexcept(
+        std::is_same_v<Signed, unsigned>);
+
+// Binary operators
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+std::common_type_t<integer<Bits, Signed>, integer<Bits2, Signed2>> constexpr 
operator*(
+        const integer<Bits, Signed>& lhs, const integer<Bits2, Signed2>& rhs);
+template <typename Arithmetic, typename Arithmetic2,
+          class = _only_arithmetic<Arithmetic, Arithmetic2>>
+std::common_type_t<Arithmetic, Arithmetic2> constexpr operator*(const 
Arithmetic& rhs,
+                                                                const 
Arithmetic2& lhs);
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+std::common_type_t<integer<Bits, Signed>, integer<Bits2, Signed2>> constexpr 
operator/(
+        const integer<Bits, Signed>& lhs, const integer<Bits2, Signed2>& rhs);
+template <typename Arithmetic, typename Arithmetic2,
+          class = _only_arithmetic<Arithmetic, Arithmetic2>>
+std::common_type_t<Arithmetic, Arithmetic2> constexpr operator/(const 
Arithmetic& rhs,
+                                                                const 
Arithmetic2& lhs);
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+std::common_type_t<integer<Bits, Signed>, integer<Bits2, Signed2>> constexpr 
operator+(
+        const integer<Bits, Signed>& lhs, const integer<Bits2, Signed2>& rhs);
+template <typename Arithmetic, typename Arithmetic2,
+          class = _only_arithmetic<Arithmetic, Arithmetic2>>
+std::common_type_t<Arithmetic, Arithmetic2> constexpr operator+(const 
Arithmetic& rhs,
+                                                                const 
Arithmetic2& lhs);
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+std::common_type_t<integer<Bits, Signed>, integer<Bits2, Signed2>> constexpr 
operator-(
+        const integer<Bits, Signed>& lhs, const integer<Bits2, Signed2>& rhs);
+template <typename Arithmetic, typename Arithmetic2,
+          class = _only_arithmetic<Arithmetic, Arithmetic2>>
+std::common_type_t<Arithmetic, Arithmetic2> constexpr operator-(const 
Arithmetic& rhs,
+                                                                const 
Arithmetic2& lhs);
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>

Review Comment:
   warning: unknown type name 'size_t'; did you mean 'std::size_t'? 
[clang-diagnostic-error]
   
   ```suggestion
   template <size_t Bits, typename Signed, std::size_t Bits2, typename Signed2>
   ```
   <details>
   <summary>Additional context</summary>
   
   **/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:279:** 'std::size_t' 
declared here
   ```cpp
     typedef __SIZE_TYPE__      size_t;
                            ^
   ```
   
   </details>
   



##########
be/src/vec/core/wide_integer.h:
##########
@@ -0,0 +1,302 @@
+// 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.
+///////////////////////////////////////////////////////////////
+//  Distributed under the Boost Software License, Version 1.0.
+//  (See at http://www.boost.org/LICENSE_1_0.txt)
+///////////////////////////////////////////////////////////////
+
+/*  Divide and multiply
+ *
+ *
+ * Copyright (c) 2008
+ * Evan Teran
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, provided
+ * that the above copyright notice appears in all copies and that both the
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the same name not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. We make no representations about the
+ * suitability this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+// This file is copied from
+// 
https://github.com/ClickHouse/ClickHouse/blob/master/base/base/wide_integer.h
+// and modified by Doris
+#pragma once
+
+#include <cstdint>
+#include <initializer_list>
+#include <limits>
+#include <type_traits>
+
+// NOLINTBEGIN(*)
+
+namespace wide {
+template <size_t Bits, typename Signed>
+class integer;
+}
+
+namespace std {
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+struct common_type<wide::integer<Bits, Signed>, wide::integer<Bits2, Signed2>>;
+
+template <size_t Bits, typename Signed, typename Arithmetic>
+struct common_type<wide::integer<Bits, Signed>, Arithmetic>;
+
+template <typename Arithmetic, size_t Bits, typename Signed>
+struct common_type<Arithmetic, wide::integer<Bits, Signed>>;
+
+} // namespace std
+
+namespace wide {
+
+template <size_t Bits, typename Signed>
+class integer {
+public:
+    using base_type = uint64_t;
+    using signed_base_type = int64_t;
+
+    // ctors
+    constexpr integer() noexcept = default;
+
+    template <typename T>
+    constexpr integer(T rhs) noexcept;
+
+    template <typename T>
+    constexpr integer(std::initializer_list<T> il) noexcept;
+
+    // assignment
+    template <size_t Bits2, typename Signed2>
+    constexpr integer<Bits, Signed>& operator=(const integer<Bits2, Signed2>& 
rhs) noexcept;
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator=(Arithmetic rhs) noexcept;
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator*=(const Arithmetic& rhs);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator/=(const Arithmetic& rhs);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator+=(const Arithmetic& rhs) 
noexcept(
+            std::is_same_v<Signed, unsigned>);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator-=(const Arithmetic& rhs) 
noexcept(
+            std::is_same_v<Signed, unsigned>);
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator%=(const Integral& rhs);
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator&=(const Integral& rhs) noexcept;
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator|=(const Integral& rhs) noexcept;
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator^=(const Integral& rhs) noexcept;
+
+    constexpr integer<Bits, Signed>& operator<<=(int n) noexcept;
+    constexpr integer<Bits, Signed>& operator>>=(int n) noexcept;
+
+    constexpr integer<Bits, Signed>& operator++() 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed> operator++(int) 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed>& operator--() 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed> operator--(int) 
noexcept(std::is_same_v<Signed, unsigned>);
+
+    // observers
+
+    constexpr explicit operator bool() const noexcept;
+
+    template <typename T, typename = std::enable_if_t<std::is_arithmetic_v<T>, 
T>>
+    constexpr operator T() const noexcept;
+
+    constexpr operator long double() const noexcept;
+    constexpr operator double() const noexcept;
+    constexpr operator float() const noexcept;
+
+    struct _impl;
+
+    base_type items[_impl::item_count];
+
+private:
+    template <size_t Bits2, typename Signed2>
+    friend class integer;
+
+    friend class std::numeric_limits<integer<Bits, signed>>;
+    friend class std::numeric_limits<integer<Bits, unsigned>>;
+};
+
+using Int256 = integer<256, signed>;
+using UInt256 = integer<256, unsigned>;
+
+template <typename T>
+static constexpr bool ArithmeticConcept() noexcept;
+
+template <class T1, class T2>
+using _only_arithmetic =
+        typename std::enable_if<ArithmeticConcept<T1>() && 
ArithmeticConcept<T2>()>::type;
+
+template <typename T>
+static constexpr bool IntegralConcept() noexcept;
+
+template <class T, class T2>
+using _only_integer = typename std::enable_if<IntegralConcept<T>() && 
IntegralConcept<T2>()>::type;
+
+// Unary operators
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator~(const integer<Bits, Signed>& lhs) 
noexcept;
+
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator-(const integer<Bits, Signed>& lhs) 
noexcept(
+        std::is_same_v<Signed, unsigned>);
+
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator+(const integer<Bits, Signed>& lhs) 
noexcept(
+        std::is_same_v<Signed, unsigned>);
+
+// Binary operators
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+std::common_type_t<integer<Bits, Signed>, integer<Bits2, Signed2>> constexpr 
operator*(
+        const integer<Bits, Signed>& lhs, const integer<Bits2, Signed2>& rhs);
+template <typename Arithmetic, typename Arithmetic2,
+          class = _only_arithmetic<Arithmetic, Arithmetic2>>
+std::common_type_t<Arithmetic, Arithmetic2> constexpr operator*(const 
Arithmetic& rhs,
+                                                                const 
Arithmetic2& lhs);
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>

Review Comment:
   warning: unknown type name 'size_t'; did you mean 'std::size_t'? 
[clang-diagnostic-error]
   
   ```suggestion
   template <size_t Bits, typename Signed, std::size_t Bits2, typename Signed2>
   ```
   <details>
   <summary>Additional context</summary>
   
   **/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:279:** 'std::size_t' 
declared here
   ```cpp
     typedef __SIZE_TYPE__      size_t;
                            ^
   ```
   
   </details>
   



##########
be/src/vec/core/wide_integer.h:
##########
@@ -0,0 +1,302 @@
+// 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.
+///////////////////////////////////////////////////////////////
+//  Distributed under the Boost Software License, Version 1.0.
+//  (See at http://www.boost.org/LICENSE_1_0.txt)
+///////////////////////////////////////////////////////////////
+
+/*  Divide and multiply
+ *
+ *
+ * Copyright (c) 2008
+ * Evan Teran
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, provided
+ * that the above copyright notice appears in all copies and that both the
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the same name not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. We make no representations about the
+ * suitability this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+// This file is copied from
+// 
https://github.com/ClickHouse/ClickHouse/blob/master/base/base/wide_integer.h
+// and modified by Doris
+#pragma once
+
+#include <cstdint>
+#include <initializer_list>
+#include <limits>
+#include <type_traits>
+
+// NOLINTBEGIN(*)
+
+namespace wide {
+template <size_t Bits, typename Signed>
+class integer;
+}
+
+namespace std {
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+struct common_type<wide::integer<Bits, Signed>, wide::integer<Bits2, Signed2>>;
+
+template <size_t Bits, typename Signed, typename Arithmetic>
+struct common_type<wide::integer<Bits, Signed>, Arithmetic>;
+
+template <typename Arithmetic, size_t Bits, typename Signed>
+struct common_type<Arithmetic, wide::integer<Bits, Signed>>;
+
+} // namespace std
+
+namespace wide {
+
+template <size_t Bits, typename Signed>
+class integer {
+public:
+    using base_type = uint64_t;
+    using signed_base_type = int64_t;
+
+    // ctors
+    constexpr integer() noexcept = default;
+
+    template <typename T>
+    constexpr integer(T rhs) noexcept;
+
+    template <typename T>
+    constexpr integer(std::initializer_list<T> il) noexcept;
+
+    // assignment
+    template <size_t Bits2, typename Signed2>
+    constexpr integer<Bits, Signed>& operator=(const integer<Bits2, Signed2>& 
rhs) noexcept;
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator=(Arithmetic rhs) noexcept;
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator*=(const Arithmetic& rhs);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator/=(const Arithmetic& rhs);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator+=(const Arithmetic& rhs) 
noexcept(
+            std::is_same_v<Signed, unsigned>);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator-=(const Arithmetic& rhs) 
noexcept(
+            std::is_same_v<Signed, unsigned>);
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator%=(const Integral& rhs);
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator&=(const Integral& rhs) noexcept;
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator|=(const Integral& rhs) noexcept;
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator^=(const Integral& rhs) noexcept;
+
+    constexpr integer<Bits, Signed>& operator<<=(int n) noexcept;
+    constexpr integer<Bits, Signed>& operator>>=(int n) noexcept;
+
+    constexpr integer<Bits, Signed>& operator++() 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed> operator++(int) 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed>& operator--() 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed> operator--(int) 
noexcept(std::is_same_v<Signed, unsigned>);
+
+    // observers
+
+    constexpr explicit operator bool() const noexcept;
+
+    template <typename T, typename = std::enable_if_t<std::is_arithmetic_v<T>, 
T>>
+    constexpr operator T() const noexcept;
+
+    constexpr operator long double() const noexcept;
+    constexpr operator double() const noexcept;
+    constexpr operator float() const noexcept;
+
+    struct _impl;
+
+    base_type items[_impl::item_count];
+
+private:
+    template <size_t Bits2, typename Signed2>
+    friend class integer;
+
+    friend class std::numeric_limits<integer<Bits, signed>>;
+    friend class std::numeric_limits<integer<Bits, unsigned>>;
+};
+
+using Int256 = integer<256, signed>;
+using UInt256 = integer<256, unsigned>;
+
+template <typename T>
+static constexpr bool ArithmeticConcept() noexcept;
+
+template <class T1, class T2>
+using _only_arithmetic =
+        typename std::enable_if<ArithmeticConcept<T1>() && 
ArithmeticConcept<T2>()>::type;
+
+template <typename T>
+static constexpr bool IntegralConcept() noexcept;
+
+template <class T, class T2>
+using _only_integer = typename std::enable_if<IntegralConcept<T>() && 
IntegralConcept<T2>()>::type;
+
+// Unary operators
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator~(const integer<Bits, Signed>& lhs) 
noexcept;
+
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator-(const integer<Bits, Signed>& lhs) 
noexcept(
+        std::is_same_v<Signed, unsigned>);
+
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator+(const integer<Bits, Signed>& lhs) 
noexcept(
+        std::is_same_v<Signed, unsigned>);
+
+// Binary operators
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+std::common_type_t<integer<Bits, Signed>, integer<Bits2, Signed2>> constexpr 
operator*(
+        const integer<Bits, Signed>& lhs, const integer<Bits2, Signed2>& rhs);
+template <typename Arithmetic, typename Arithmetic2,
+          class = _only_arithmetic<Arithmetic, Arithmetic2>>
+std::common_type_t<Arithmetic, Arithmetic2> constexpr operator*(const 
Arithmetic& rhs,
+                                                                const 
Arithmetic2& lhs);
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+std::common_type_t<integer<Bits, Signed>, integer<Bits2, Signed2>> constexpr 
operator/(
+        const integer<Bits, Signed>& lhs, const integer<Bits2, Signed2>& rhs);
+template <typename Arithmetic, typename Arithmetic2,
+          class = _only_arithmetic<Arithmetic, Arithmetic2>>
+std::common_type_t<Arithmetic, Arithmetic2> constexpr operator/(const 
Arithmetic& rhs,
+                                                                const 
Arithmetic2& lhs);
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+std::common_type_t<integer<Bits, Signed>, integer<Bits2, Signed2>> constexpr 
operator+(
+        const integer<Bits, Signed>& lhs, const integer<Bits2, Signed2>& rhs);
+template <typename Arithmetic, typename Arithmetic2,
+          class = _only_arithmetic<Arithmetic, Arithmetic2>>
+std::common_type_t<Arithmetic, Arithmetic2> constexpr operator+(const 
Arithmetic& rhs,
+                                                                const 
Arithmetic2& lhs);
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>

Review Comment:
   warning: unknown type name 'size_t'; did you mean 'std::size_t'? 
[clang-diagnostic-error]
   
   ```suggestion
   template <size_t Bits, typename Signed, std::size_t Bits2, typename Signed2>
   ```
   <details>
   <summary>Additional context</summary>
   
   **/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:279:** 'std::size_t' 
declared here
   ```cpp
     typedef __SIZE_TYPE__      size_t;
                            ^
   ```
   
   </details>
   



##########
be/src/vec/core/wide_integer_to_string.h:
##########
@@ -0,0 +1,77 @@
+// 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.
+// This file is copied from
+// 
https://github.com/ClickHouse/ClickHouse/blob/master/base/base/wide_integer_to_string.h
+// and modified by Doris
+#pragma once
+
+#include <fmt/format.h>
+
+#include <ostream>
+#include <string>
+
+#include "wide_integer.h"
+
+namespace wide {
+
+template <size_t Bits, typename Signed>
+inline std::string to_string(const integer<Bits, Signed>& n) {
+    std::string res;
+    if (integer<Bits, Signed>::_impl::operator_eq(n, 0U)) return "0";

Review Comment:
   warning: statement should be inside braces 
[readability-braces-around-statements]
   
   ```suggestion
       if (integer<Bits, Signed>::_impl::operator_eq(n, 0U)) { return "0";
   }
   ```
   



##########
be/src/vec/core/wide_integer.h:
##########
@@ -0,0 +1,302 @@
+// 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.
+///////////////////////////////////////////////////////////////
+//  Distributed under the Boost Software License, Version 1.0.
+//  (See at http://www.boost.org/LICENSE_1_0.txt)
+///////////////////////////////////////////////////////////////
+
+/*  Divide and multiply
+ *
+ *
+ * Copyright (c) 2008
+ * Evan Teran
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, provided
+ * that the above copyright notice appears in all copies and that both the
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the same name not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. We make no representations about the
+ * suitability this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+// This file is copied from
+// 
https://github.com/ClickHouse/ClickHouse/blob/master/base/base/wide_integer.h
+// and modified by Doris
+#pragma once
+
+#include <cstdint>
+#include <initializer_list>
+#include <limits>
+#include <type_traits>
+
+// NOLINTBEGIN(*)
+
+namespace wide {
+template <size_t Bits, typename Signed>
+class integer;
+}
+
+namespace std {
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+struct common_type<wide::integer<Bits, Signed>, wide::integer<Bits2, Signed2>>;
+
+template <size_t Bits, typename Signed, typename Arithmetic>
+struct common_type<wide::integer<Bits, Signed>, Arithmetic>;
+
+template <typename Arithmetic, size_t Bits, typename Signed>
+struct common_type<Arithmetic, wide::integer<Bits, Signed>>;
+
+} // namespace std
+
+namespace wide {
+
+template <size_t Bits, typename Signed>
+class integer {
+public:
+    using base_type = uint64_t;
+    using signed_base_type = int64_t;
+
+    // ctors
+    constexpr integer() noexcept = default;
+
+    template <typename T>
+    constexpr integer(T rhs) noexcept;
+
+    template <typename T>
+    constexpr integer(std::initializer_list<T> il) noexcept;
+
+    // assignment
+    template <size_t Bits2, typename Signed2>
+    constexpr integer<Bits, Signed>& operator=(const integer<Bits2, Signed2>& 
rhs) noexcept;
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator=(Arithmetic rhs) noexcept;
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator*=(const Arithmetic& rhs);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator/=(const Arithmetic& rhs);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator+=(const Arithmetic& rhs) 
noexcept(
+            std::is_same_v<Signed, unsigned>);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator-=(const Arithmetic& rhs) 
noexcept(
+            std::is_same_v<Signed, unsigned>);
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator%=(const Integral& rhs);
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator&=(const Integral& rhs) noexcept;
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator|=(const Integral& rhs) noexcept;
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator^=(const Integral& rhs) noexcept;
+
+    constexpr integer<Bits, Signed>& operator<<=(int n) noexcept;
+    constexpr integer<Bits, Signed>& operator>>=(int n) noexcept;
+
+    constexpr integer<Bits, Signed>& operator++() 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed> operator++(int) 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed>& operator--() 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed> operator--(int) 
noexcept(std::is_same_v<Signed, unsigned>);
+
+    // observers
+
+    constexpr explicit operator bool() const noexcept;
+
+    template <typename T, typename = std::enable_if_t<std::is_arithmetic_v<T>, 
T>>
+    constexpr operator T() const noexcept;
+
+    constexpr operator long double() const noexcept;
+    constexpr operator double() const noexcept;
+    constexpr operator float() const noexcept;
+
+    struct _impl;
+
+    base_type items[_impl::item_count];
+
+private:
+    template <size_t Bits2, typename Signed2>
+    friend class integer;
+
+    friend class std::numeric_limits<integer<Bits, signed>>;
+    friend class std::numeric_limits<integer<Bits, unsigned>>;
+};
+
+using Int256 = integer<256, signed>;
+using UInt256 = integer<256, unsigned>;
+
+template <typename T>
+static constexpr bool ArithmeticConcept() noexcept;
+
+template <class T1, class T2>
+using _only_arithmetic =
+        typename std::enable_if<ArithmeticConcept<T1>() && 
ArithmeticConcept<T2>()>::type;
+
+template <typename T>
+static constexpr bool IntegralConcept() noexcept;
+
+template <class T, class T2>
+using _only_integer = typename std::enable_if<IntegralConcept<T>() && 
IntegralConcept<T2>()>::type;
+
+// Unary operators
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator~(const integer<Bits, Signed>& lhs) 
noexcept;
+
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator-(const integer<Bits, Signed>& lhs) 
noexcept(
+        std::is_same_v<Signed, unsigned>);
+
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator+(const integer<Bits, Signed>& lhs) 
noexcept(
+        std::is_same_v<Signed, unsigned>);
+
+// Binary operators
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+std::common_type_t<integer<Bits, Signed>, integer<Bits2, Signed2>> constexpr 
operator*(
+        const integer<Bits, Signed>& lhs, const integer<Bits2, Signed2>& rhs);
+template <typename Arithmetic, typename Arithmetic2,
+          class = _only_arithmetic<Arithmetic, Arithmetic2>>
+std::common_type_t<Arithmetic, Arithmetic2> constexpr operator*(const 
Arithmetic& rhs,
+                                                                const 
Arithmetic2& lhs);
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+std::common_type_t<integer<Bits, Signed>, integer<Bits2, Signed2>> constexpr 
operator/(
+        const integer<Bits, Signed>& lhs, const integer<Bits2, Signed2>& rhs);
+template <typename Arithmetic, typename Arithmetic2,
+          class = _only_arithmetic<Arithmetic, Arithmetic2>>
+std::common_type_t<Arithmetic, Arithmetic2> constexpr operator/(const 
Arithmetic& rhs,
+                                                                const 
Arithmetic2& lhs);
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+std::common_type_t<integer<Bits, Signed>, integer<Bits2, Signed2>> constexpr 
operator+(
+        const integer<Bits, Signed>& lhs, const integer<Bits2, Signed2>& rhs);
+template <typename Arithmetic, typename Arithmetic2,
+          class = _only_arithmetic<Arithmetic, Arithmetic2>>
+std::common_type_t<Arithmetic, Arithmetic2> constexpr operator+(const 
Arithmetic& rhs,
+                                                                const 
Arithmetic2& lhs);
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+std::common_type_t<integer<Bits, Signed>, integer<Bits2, Signed2>> constexpr 
operator-(
+        const integer<Bits, Signed>& lhs, const integer<Bits2, Signed2>& rhs);
+template <typename Arithmetic, typename Arithmetic2,
+          class = _only_arithmetic<Arithmetic, Arithmetic2>>
+std::common_type_t<Arithmetic, Arithmetic2> constexpr operator-(const 
Arithmetic& rhs,
+                                                                const 
Arithmetic2& lhs);
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+std::common_type_t<integer<Bits, Signed>, integer<Bits2, Signed2>> constexpr 
operator%(
+        const integer<Bits, Signed>& lhs, const integer<Bits2, Signed2>& rhs);
+template <typename Integral, typename Integral2, class = 
_only_integer<Integral, Integral2>>
+std::common_type_t<Integral, Integral2> constexpr operator%(const Integral& 
rhs,
+                                                            const Integral2& 
lhs);
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>

Review Comment:
   warning: unknown type name 'size_t'; did you mean 'std::size_t'? 
[clang-diagnostic-error]
   
   ```suggestion
   template <size_t Bits, typename Signed, std::size_t Bits2, typename Signed2>
   ```
   <details>
   <summary>Additional context</summary>
   
   **/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:279:** 'std::size_t' 
declared here
   ```cpp
     typedef __SIZE_TYPE__      size_t;
                            ^
   ```
   
   </details>
   



##########
be/src/vec/core/wide_integer_to_string.h:
##########
@@ -0,0 +1,77 @@
+// 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.
+// This file is copied from
+// 
https://github.com/ClickHouse/ClickHouse/blob/master/base/base/wide_integer_to_string.h
+// and modified by Doris
+#pragma once
+
+#include <fmt/format.h>

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



##########
be/src/vec/core/wide_integer_to_string.h:
##########
@@ -0,0 +1,77 @@
+// 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.
+// This file is copied from
+// 
https://github.com/ClickHouse/ClickHouse/blob/master/base/base/wide_integer_to_string.h
+// and modified by Doris
+#pragma once
+
+#include <fmt/format.h>
+
+#include <ostream>
+#include <string>
+
+#include "wide_integer.h"
+
+namespace wide {
+
+template <size_t Bits, typename Signed>
+inline std::string to_string(const integer<Bits, Signed>& n) {
+    std::string res;
+    if (integer<Bits, Signed>::_impl::operator_eq(n, 0U)) return "0";
+
+    integer<Bits, unsigned> t;
+    bool is_neg = integer<Bits, Signed>::_impl::is_negative(n);
+    if (is_neg)

Review Comment:
   warning: statement should be inside braces 
[readability-braces-around-statements]
   
   ```suggestion
       if (is_neg) {
   ```
   
   be/src/vec/core/wide_integer_to_string.h:39:
   ```diff
   -     else
   +     } else
   ```
   



##########
be/src/vec/data_types/number_traits.h:
##########
@@ -76,6 +77,10 @@ struct Construct<false, false, 16> {
     using Type = Int128;
 };
 template <>
+struct Construct<false, false, 32> {

Review Comment:
   warning: 32 is a magic number; consider replacing it with a named constant 
[readability-magic-numbers]
   ```cpp
   struct Construct<false, false, 32> {
                                  ^
   ```
   



##########
be/src/vec/core/wide_integer_impl.h:
##########
@@ -0,0 +1,1389 @@
+// 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.
+/// Original is here https://github.com/cerevra/int
+/// Distributed under the Boost Software License, Version 1.0.
+/// (See at http://www.boost.org/LICENSE_1_0.txt)
+
+// This file is copied from
+// 
https://github.com/ClickHouse/ClickHouse/blob/master/base/base/wide_integer_impl.h
+// and modified by Doris
+#pragma once
+
+#include <boost/math/special_functions/fpclassify.hpp>

Review Comment:
   warning: 'boost/math/special_functions/fpclassify.hpp' file not found 
[clang-diagnostic-error]
   ```cpp
   #include <boost/math/special_functions/fpclassify.hpp>
            ^
   ```
   



##########
be/src/vec/core/wide_integer_to_string.h:
##########
@@ -0,0 +1,77 @@
+// 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.
+// This file is copied from
+// 
https://github.com/ClickHouse/ClickHouse/blob/master/base/base/wide_integer_to_string.h
+// and modified by Doris
+#pragma once
+
+#include <fmt/format.h>
+
+#include <ostream>
+#include <string>
+
+#include "wide_integer.h"
+
+namespace wide {
+
+template <size_t Bits, typename Signed>
+inline std::string to_string(const integer<Bits, Signed>& n) {
+    std::string res;
+    if (integer<Bits, Signed>::_impl::operator_eq(n, 0U)) return "0";
+
+    integer<Bits, unsigned> t;
+    bool is_neg = integer<Bits, Signed>::_impl::is_negative(n);
+    if (is_neg)
+        t = integer<Bits, Signed>::_impl::operator_unary_minus(n);
+    else
+        t = n;

Review Comment:
   warning: statement should be inside braces 
[readability-braces-around-statements]
   
   ```suggestion
       else {
           t = n;
   }
   ```
   



##########
be/src/vec/data_types/number_traits.h:
##########
@@ -112,6 +117,10 @@ struct Construct<true, false, 16> {
     using Type = Int128;
 };
 template <>
+struct Construct<true, false, 32> {

Review Comment:
   warning: 32 is a magic number; consider replacing it with a named constant 
[readability-magic-numbers]
   ```cpp
   struct Construct<true, false, 32> {
                                 ^
   ```
   



##########
be/src/vec/core/wide_integer.h:
##########
@@ -0,0 +1,302 @@
+// 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.
+///////////////////////////////////////////////////////////////
+//  Distributed under the Boost Software License, Version 1.0.
+//  (See at http://www.boost.org/LICENSE_1_0.txt)
+///////////////////////////////////////////////////////////////
+
+/*  Divide and multiply
+ *
+ *
+ * Copyright (c) 2008
+ * Evan Teran
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, provided
+ * that the above copyright notice appears in all copies and that both the
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the same name not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. We make no representations about the
+ * suitability this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+// This file is copied from
+// 
https://github.com/ClickHouse/ClickHouse/blob/master/base/base/wide_integer.h
+// and modified by Doris
+#pragma once
+
+#include <cstdint>
+#include <initializer_list>
+#include <limits>
+#include <type_traits>
+
+// NOLINTBEGIN(*)
+
+namespace wide {
+template <size_t Bits, typename Signed>
+class integer;
+}
+
+namespace std {
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+struct common_type<wide::integer<Bits, Signed>, wide::integer<Bits2, Signed2>>;
+
+template <size_t Bits, typename Signed, typename Arithmetic>
+struct common_type<wide::integer<Bits, Signed>, Arithmetic>;
+
+template <typename Arithmetic, size_t Bits, typename Signed>
+struct common_type<Arithmetic, wide::integer<Bits, Signed>>;
+
+} // namespace std
+
+namespace wide {
+
+template <size_t Bits, typename Signed>
+class integer {
+public:
+    using base_type = uint64_t;
+    using signed_base_type = int64_t;
+
+    // ctors
+    constexpr integer() noexcept = default;
+
+    template <typename T>
+    constexpr integer(T rhs) noexcept;
+
+    template <typename T>
+    constexpr integer(std::initializer_list<T> il) noexcept;
+
+    // assignment
+    template <size_t Bits2, typename Signed2>
+    constexpr integer<Bits, Signed>& operator=(const integer<Bits2, Signed2>& 
rhs) noexcept;
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator=(Arithmetic rhs) noexcept;
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator*=(const Arithmetic& rhs);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator/=(const Arithmetic& rhs);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator+=(const Arithmetic& rhs) 
noexcept(
+            std::is_same_v<Signed, unsigned>);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator-=(const Arithmetic& rhs) 
noexcept(
+            std::is_same_v<Signed, unsigned>);
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator%=(const Integral& rhs);
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator&=(const Integral& rhs) noexcept;
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator|=(const Integral& rhs) noexcept;
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator^=(const Integral& rhs) noexcept;
+
+    constexpr integer<Bits, Signed>& operator<<=(int n) noexcept;
+    constexpr integer<Bits, Signed>& operator>>=(int n) noexcept;
+
+    constexpr integer<Bits, Signed>& operator++() 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed> operator++(int) 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed>& operator--() 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed> operator--(int) 
noexcept(std::is_same_v<Signed, unsigned>);
+
+    // observers
+
+    constexpr explicit operator bool() const noexcept;
+
+    template <typename T, typename = std::enable_if_t<std::is_arithmetic_v<T>, 
T>>
+    constexpr operator T() const noexcept;
+
+    constexpr operator long double() const noexcept;
+    constexpr operator double() const noexcept;
+    constexpr operator float() const noexcept;
+
+    struct _impl;
+
+    base_type items[_impl::item_count];
+
+private:
+    template <size_t Bits2, typename Signed2>
+    friend class integer;
+
+    friend class std::numeric_limits<integer<Bits, signed>>;
+    friend class std::numeric_limits<integer<Bits, unsigned>>;
+};
+
+using Int256 = integer<256, signed>;
+using UInt256 = integer<256, unsigned>;
+
+template <typename T>
+static constexpr bool ArithmeticConcept() noexcept;
+
+template <class T1, class T2>
+using _only_arithmetic =
+        typename std::enable_if<ArithmeticConcept<T1>() && 
ArithmeticConcept<T2>()>::type;
+
+template <typename T>
+static constexpr bool IntegralConcept() noexcept;
+
+template <class T, class T2>
+using _only_integer = typename std::enable_if<IntegralConcept<T>() && 
IntegralConcept<T2>()>::type;
+
+// Unary operators
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator~(const integer<Bits, Signed>& lhs) 
noexcept;
+
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator-(const integer<Bits, Signed>& lhs) 
noexcept(
+        std::is_same_v<Signed, unsigned>);
+
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator+(const integer<Bits, Signed>& lhs) 
noexcept(
+        std::is_same_v<Signed, unsigned>);
+
+// Binary operators
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+std::common_type_t<integer<Bits, Signed>, integer<Bits2, Signed2>> constexpr 
operator*(
+        const integer<Bits, Signed>& lhs, const integer<Bits2, Signed2>& rhs);
+template <typename Arithmetic, typename Arithmetic2,
+          class = _only_arithmetic<Arithmetic, Arithmetic2>>
+std::common_type_t<Arithmetic, Arithmetic2> constexpr operator*(const 
Arithmetic& rhs,
+                                                                const 
Arithmetic2& lhs);
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+std::common_type_t<integer<Bits, Signed>, integer<Bits2, Signed2>> constexpr 
operator/(
+        const integer<Bits, Signed>& lhs, const integer<Bits2, Signed2>& rhs);
+template <typename Arithmetic, typename Arithmetic2,
+          class = _only_arithmetic<Arithmetic, Arithmetic2>>
+std::common_type_t<Arithmetic, Arithmetic2> constexpr operator/(const 
Arithmetic& rhs,
+                                                                const 
Arithmetic2& lhs);
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+std::common_type_t<integer<Bits, Signed>, integer<Bits2, Signed2>> constexpr 
operator+(
+        const integer<Bits, Signed>& lhs, const integer<Bits2, Signed2>& rhs);
+template <typename Arithmetic, typename Arithmetic2,
+          class = _only_arithmetic<Arithmetic, Arithmetic2>>
+std::common_type_t<Arithmetic, Arithmetic2> constexpr operator+(const 
Arithmetic& rhs,
+                                                                const 
Arithmetic2& lhs);
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+std::common_type_t<integer<Bits, Signed>, integer<Bits2, Signed2>> constexpr 
operator-(
+        const integer<Bits, Signed>& lhs, const integer<Bits2, Signed2>& rhs);
+template <typename Arithmetic, typename Arithmetic2,
+          class = _only_arithmetic<Arithmetic, Arithmetic2>>
+std::common_type_t<Arithmetic, Arithmetic2> constexpr operator-(const 
Arithmetic& rhs,
+                                                                const 
Arithmetic2& lhs);
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>

Review Comment:
   warning: unknown type name 'size_t'; did you mean 'std::size_t'? 
[clang-diagnostic-error]
   
   ```suggestion
   template <std::size_t Bits, typename Signed, size_t Bits2, typename Signed2>
   ```
   <details>
   <summary>Additional context</summary>
   
   **/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:279:** 'std::size_t' 
declared here
   ```cpp
     typedef __SIZE_TYPE__      size_t;
                            ^
   ```
   
   </details>
   



##########
be/src/vec/core/wide_integer_to_string.h:
##########
@@ -0,0 +1,77 @@
+// 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.
+// This file is copied from
+// 
https://github.com/ClickHouse/ClickHouse/blob/master/base/base/wide_integer_to_string.h
+// and modified by Doris
+#pragma once
+
+#include <fmt/format.h>
+
+#include <ostream>
+#include <string>
+
+#include "wide_integer.h"
+
+namespace wide {
+
+template <size_t Bits, typename Signed>
+inline std::string to_string(const integer<Bits, Signed>& n) {
+    std::string res;
+    if (integer<Bits, Signed>::_impl::operator_eq(n, 0U)) return "0";
+
+    integer<Bits, unsigned> t;
+    bool is_neg = integer<Bits, Signed>::_impl::is_negative(n);
+    if (is_neg)
+        t = integer<Bits, Signed>::_impl::operator_unary_minus(n);
+    else
+        t = n;
+
+    while (!integer<Bits, unsigned>::_impl::operator_eq(t, 0U)) {
+        res.insert(res.begin(),
+                   '0' + char(integer<Bits, 
unsigned>::_impl::operator_percent(t, 10U)));
+        t = integer<Bits, unsigned>::_impl::operator_slash(t, 10U);
+    }
+
+    if (is_neg) res.insert(res.begin(), '-');

Review Comment:
   warning: statement should be inside braces 
[readability-braces-around-statements]
   
   ```suggestion
       if (is_neg) { res.insert(res.begin(), '-');
   }
   ```
   



##########
be/src/vec/core/wide_integer.h:
##########
@@ -0,0 +1,302 @@
+// 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.
+///////////////////////////////////////////////////////////////
+//  Distributed under the Boost Software License, Version 1.0.
+//  (See at http://www.boost.org/LICENSE_1_0.txt)
+///////////////////////////////////////////////////////////////
+
+/*  Divide and multiply
+ *
+ *
+ * Copyright (c) 2008
+ * Evan Teran
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, provided
+ * that the above copyright notice appears in all copies and that both the
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the same name not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. We make no representations about the
+ * suitability this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ */
+// This file is copied from
+// 
https://github.com/ClickHouse/ClickHouse/blob/master/base/base/wide_integer.h
+// and modified by Doris
+#pragma once
+
+#include <cstdint>
+#include <initializer_list>
+#include <limits>
+#include <type_traits>
+
+// NOLINTBEGIN(*)
+
+namespace wide {
+template <size_t Bits, typename Signed>
+class integer;
+}
+
+namespace std {
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+struct common_type<wide::integer<Bits, Signed>, wide::integer<Bits2, Signed2>>;
+
+template <size_t Bits, typename Signed, typename Arithmetic>
+struct common_type<wide::integer<Bits, Signed>, Arithmetic>;
+
+template <typename Arithmetic, size_t Bits, typename Signed>
+struct common_type<Arithmetic, wide::integer<Bits, Signed>>;
+
+} // namespace std
+
+namespace wide {
+
+template <size_t Bits, typename Signed>
+class integer {
+public:
+    using base_type = uint64_t;
+    using signed_base_type = int64_t;
+
+    // ctors
+    constexpr integer() noexcept = default;
+
+    template <typename T>
+    constexpr integer(T rhs) noexcept;
+
+    template <typename T>
+    constexpr integer(std::initializer_list<T> il) noexcept;
+
+    // assignment
+    template <size_t Bits2, typename Signed2>
+    constexpr integer<Bits, Signed>& operator=(const integer<Bits2, Signed2>& 
rhs) noexcept;
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator=(Arithmetic rhs) noexcept;
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator*=(const Arithmetic& rhs);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator/=(const Arithmetic& rhs);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator+=(const Arithmetic& rhs) 
noexcept(
+            std::is_same_v<Signed, unsigned>);
+
+    template <typename Arithmetic>
+    constexpr integer<Bits, Signed>& operator-=(const Arithmetic& rhs) 
noexcept(
+            std::is_same_v<Signed, unsigned>);
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator%=(const Integral& rhs);
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator&=(const Integral& rhs) noexcept;
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator|=(const Integral& rhs) noexcept;
+
+    template <typename Integral>
+    constexpr integer<Bits, Signed>& operator^=(const Integral& rhs) noexcept;
+
+    constexpr integer<Bits, Signed>& operator<<=(int n) noexcept;
+    constexpr integer<Bits, Signed>& operator>>=(int n) noexcept;
+
+    constexpr integer<Bits, Signed>& operator++() 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed> operator++(int) 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed>& operator--() 
noexcept(std::is_same_v<Signed, unsigned>);
+    constexpr integer<Bits, Signed> operator--(int) 
noexcept(std::is_same_v<Signed, unsigned>);
+
+    // observers
+
+    constexpr explicit operator bool() const noexcept;
+
+    template <typename T, typename = std::enable_if_t<std::is_arithmetic_v<T>, 
T>>
+    constexpr operator T() const noexcept;
+
+    constexpr operator long double() const noexcept;
+    constexpr operator double() const noexcept;
+    constexpr operator float() const noexcept;
+
+    struct _impl;
+
+    base_type items[_impl::item_count];
+
+private:
+    template <size_t Bits2, typename Signed2>
+    friend class integer;
+
+    friend class std::numeric_limits<integer<Bits, signed>>;
+    friend class std::numeric_limits<integer<Bits, unsigned>>;
+};
+
+using Int256 = integer<256, signed>;
+using UInt256 = integer<256, unsigned>;
+
+template <typename T>
+static constexpr bool ArithmeticConcept() noexcept;
+
+template <class T1, class T2>
+using _only_arithmetic =
+        typename std::enable_if<ArithmeticConcept<T1>() && 
ArithmeticConcept<T2>()>::type;
+
+template <typename T>
+static constexpr bool IntegralConcept() noexcept;
+
+template <class T, class T2>
+using _only_integer = typename std::enable_if<IntegralConcept<T>() && 
IntegralConcept<T2>()>::type;
+
+// Unary operators
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator~(const integer<Bits, Signed>& lhs) 
noexcept;
+
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator-(const integer<Bits, Signed>& lhs) 
noexcept(
+        std::is_same_v<Signed, unsigned>);
+
+template <size_t Bits, typename Signed>
+constexpr integer<Bits, Signed> operator+(const integer<Bits, Signed>& lhs) 
noexcept(
+        std::is_same_v<Signed, unsigned>);
+
+// Binary operators
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+std::common_type_t<integer<Bits, Signed>, integer<Bits2, Signed2>> constexpr 
operator*(
+        const integer<Bits, Signed>& lhs, const integer<Bits2, Signed2>& rhs);
+template <typename Arithmetic, typename Arithmetic2,
+          class = _only_arithmetic<Arithmetic, Arithmetic2>>
+std::common_type_t<Arithmetic, Arithmetic2> constexpr operator*(const 
Arithmetic& rhs,
+                                                                const 
Arithmetic2& lhs);
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+std::common_type_t<integer<Bits, Signed>, integer<Bits2, Signed2>> constexpr 
operator/(
+        const integer<Bits, Signed>& lhs, const integer<Bits2, Signed2>& rhs);
+template <typename Arithmetic, typename Arithmetic2,
+          class = _only_arithmetic<Arithmetic, Arithmetic2>>
+std::common_type_t<Arithmetic, Arithmetic2> constexpr operator/(const 
Arithmetic& rhs,
+                                                                const 
Arithmetic2& lhs);
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+std::common_type_t<integer<Bits, Signed>, integer<Bits2, Signed2>> constexpr 
operator+(
+        const integer<Bits, Signed>& lhs, const integer<Bits2, Signed2>& rhs);
+template <typename Arithmetic, typename Arithmetic2,
+          class = _only_arithmetic<Arithmetic, Arithmetic2>>
+std::common_type_t<Arithmetic, Arithmetic2> constexpr operator+(const 
Arithmetic& rhs,
+                                                                const 
Arithmetic2& lhs);
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+std::common_type_t<integer<Bits, Signed>, integer<Bits2, Signed2>> constexpr 
operator-(
+        const integer<Bits, Signed>& lhs, const integer<Bits2, Signed2>& rhs);
+template <typename Arithmetic, typename Arithmetic2,
+          class = _only_arithmetic<Arithmetic, Arithmetic2>>
+std::common_type_t<Arithmetic, Arithmetic2> constexpr operator-(const 
Arithmetic& rhs,
+                                                                const 
Arithmetic2& lhs);
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>
+std::common_type_t<integer<Bits, Signed>, integer<Bits2, Signed2>> constexpr 
operator%(
+        const integer<Bits, Signed>& lhs, const integer<Bits2, Signed2>& rhs);
+template <typename Integral, typename Integral2, class = 
_only_integer<Integral, Integral2>>
+std::common_type_t<Integral, Integral2> constexpr operator%(const Integral& 
rhs,
+                                                            const Integral2& 
lhs);
+
+template <size_t Bits, typename Signed, size_t Bits2, typename Signed2>

Review Comment:
   warning: unknown type name 'size_t'; did you mean 'std::size_t'? 
[clang-diagnostic-error]
   
   ```suggestion
   template <std::size_t Bits, typename Signed, size_t Bits2, typename Signed2>
   ```
   <details>
   <summary>Additional context</summary>
   
   **/usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:279:** 'std::size_t' 
declared here
   ```cpp
     typedef __SIZE_TYPE__      size_t;
                            ^
   ```
   
   </details>
   



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org


Reply via email to