You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by kx...@apache.org on 2023/12/16 03:59:28 UTC

(doris) branch branch-2.0 updated: [improvement](decimalv2) support check overflow for decimalv2 arithmetics (#28456) (#28489)

This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new 9546b14095b [improvement](decimalv2) support check overflow for decimalv2 arithmetics (#28456) (#28489)
9546b14095b is described below

commit 9546b14095bc5dcc98e460ea98e36418f96cb5b8
Author: TengJianPing <18...@users.noreply.github.com>
AuthorDate: Sat Dec 16 11:59:21 2023 +0800

    [improvement](decimalv2) support check overflow for decimalv2 arithmetics (#28456) (#28489)
---
 be/src/vec/functions/function_binary_arithmetic.h  |  207 +-
 be/src/vec/functions/multiply.cpp                  |   27 +-
 .../datatype_p0/decimalv2/test_decimalv2_calc.out  |  133 ++
 .../test_decimalv2_calc_with_conversion.out        |  133 ++
 .../decimalv2/test_decimalv2_common.out            | 2047 ++++++++++++++++++++
 .../datatype_p0/decimalv2/test_decimalv2_load.out  |   17 +
 .../decimalv2/test_decimalv2_overflow.out          |   90 +
 .../decimalv2/test_decimalv2_overflow2.out         |   61 +
 .../decimalv3/test_decimalv3_overflow.out          |    3 +
 .../datatype_p0/decimalv2/test_data/test.csv       |    6 +
 .../decimalv2/test_decimalv2_calc.groovy           |  201 ++
 .../test_decimalv2_calc_with_conversion.groovy     |  197 ++
 .../decimalv2/test_decimalv2_common.groovy         |  412 ++++
 .../decimalv2/test_decimalv2_load.groovy           |   90 +
 .../decimalv2/test_decimalv2_overflow.groovy       |  395 ++++
 .../decimalv2/test_decimalv2_overflow2.groovy      |  288 +++
 .../decimalv3/test_decimalv3_overflow.groovy       |    4 +-
 17 files changed, 4178 insertions(+), 133 deletions(-)

diff --git a/be/src/vec/functions/function_binary_arithmetic.h b/be/src/vec/functions/function_binary_arithmetic.h
index 59a9701c906..7b47be66833 100644
--- a/be/src/vec/functions/function_binary_arithmetic.h
+++ b/be/src/vec/functions/function_binary_arithmetic.h
@@ -240,10 +240,10 @@ private:
                               typename ArrayC::value_type* c, size_t size,
                               const ResultType& max_result_number,
                               const ResultType& scale_diff_multiplier) {
-        // TODO: handle overflow of decimalv2
+        static_assert(OpTraits::is_plus_minus || OpTraits::is_multiply);
         if constexpr (OpTraits::is_multiply && IsDecimalV2<A> && IsDecimalV2<B> &&
                       IsDecimalV2<ResultType>) {
-            Op::vector_vector(a, b, c, size);
+            Op::template vector_vector<check_overflow>(a, b, c, size);
         } else {
             bool need_adjust_scale = scale_diff_multiplier.value > 1;
             std::visit(
@@ -260,24 +260,20 @@ private:
     /// null_map for divide and mod
     static void vector_vector(const typename Traits::ArrayA::value_type* __restrict a,
                               const typename Traits::ArrayB::value_type* __restrict b,
-                              typename ArrayC::value_type* c, NullMap& null_map, size_t size) {
+                              typename ArrayC::value_type* c, NullMap& null_map, size_t size,
+                              const ResultType& max_result_number) {
+        static_assert(OpTraits::is_division || OpTraits::is_mod);
         if constexpr (IsDecimalV2<B> || IsDecimalV2<A>) {
-            /// default: use it if no return before
             for (size_t i = 0; i < size; ++i) {
-                c[i] = apply(a[i], b[i], null_map[i]);
+                c[i] = apply(a[i], b[i], null_map[i], max_result_number);
             }
         } else if constexpr (OpTraits::is_division && (IsDecimalNumber<B> || IsDecimalNumber<A>)) {
             for (size_t i = 0; i < size; ++i) {
-                c[i] = apply_scaled_div(a[i], b[i], null_map[i]);
-            }
-        } else if constexpr ((OpTraits::is_multiply || OpTraits::is_plus_minus) &&
-                             (IsDecimalNumber<B> || IsDecimalNumber<A>)) {
-            for (size_t i = 0; i < size; ++i) {
-                null_map[i] = apply_op_safely(a[i], b[i], c[i].value);
+                c[i] = apply(a[i], b[i], null_map[i], max_result_number);
             }
         } else {
             for (size_t i = 0; i < size; ++i) {
-                c[i] = apply(a[i], b[i], null_map[i]);
+                c[i] = apply(a[i], b[i], null_map[i], max_result_number);
             }
         }
     }
@@ -286,14 +282,8 @@ private:
                                 typename ArrayC::value_type* c, size_t size,
                                 const ResultType& max_result_number,
                                 const ResultType& scale_diff_multiplier) {
-        if constexpr (OpTraits::is_division && IsDecimalNumber<B>) {
-            for (size_t i = 0; i < size; ++i) {
-                c[i] = apply_scaled_div(a[i], b);
-            }
-            return;
-        }
+        static_assert(!OpTraits::is_division);
 
-        /// default: use it if no return before
         bool need_adjust_scale = scale_diff_multiplier.value > 1;
         std::visit(
                 [&](auto need_adjust_scale) {
@@ -306,19 +296,16 @@ private:
     }
 
     static void vector_constant(const typename Traits::ArrayA::value_type* __restrict a, B b,
-                                typename ArrayC::value_type* c, NullMap& null_map, size_t size) {
+                                typename ArrayC::value_type* c, NullMap& null_map, size_t size,
+                                const ResultType& max_result_number) {
+        static_assert(OpTraits::is_division || OpTraits::is_mod);
         if constexpr (OpTraits::is_division && IsDecimalNumber<B>) {
             for (size_t i = 0; i < size; ++i) {
-                c[i] = apply_scaled_div(a[i], b, null_map[i]);
-            }
-        } else if constexpr ((OpTraits::is_multiply || OpTraits::is_plus_minus) &&
-                             (IsDecimalNumber<B> || IsDecimalNumber<A>)) {
-            for (size_t i = 0; i < size; ++i) {
-                null_map[i] = apply_op_safely(a[i], b, c[i].value);
+                c[i] = apply(a[i], b, null_map[i], max_result_number);
             }
         } else {
             for (size_t i = 0; i < size; ++i) {
-                c[i] = apply(a[i], b, null_map[i]);
+                c[i] = apply(a[i], b, null_map[i], max_result_number);
             }
         }
     }
@@ -327,38 +314,28 @@ private:
                                 typename ArrayC::value_type* c, size_t size,
                                 const ResultType& max_result_number,
                                 const ResultType& scale_diff_multiplier) {
-        if constexpr (IsDecimalV2<A> || IsDecimalV2<B>) {
-            DecimalV2Value da(a);
-            for (size_t i = 0; i < size; ++i) {
-                c[i] = Op::template apply(da, DecimalV2Value(b[i])).value();
-            }
-        } else {
-            bool need_adjust_scale = scale_diff_multiplier.value > 1;
-            std::visit(
-                    [&](auto need_adjust_scale) {
-                        for (size_t i = 0; i < size; ++i) {
-                            c[i] = apply<need_adjust_scale>(a, b[i], max_result_number,
-                                                            scale_diff_multiplier);
-                        }
-                    },
-                    make_bool_variant(need_adjust_scale));
-        }
+        bool need_adjust_scale = scale_diff_multiplier.value > 1;
+        std::visit(
+                [&](auto need_adjust_scale) {
+                    for (size_t i = 0; i < size; ++i) {
+                        c[i] = apply<need_adjust_scale>(a, b[i], max_result_number,
+                                                        scale_diff_multiplier);
+                    }
+                },
+                make_bool_variant(need_adjust_scale));
     }
 
     static void constant_vector(A a, const typename Traits::ArrayB::value_type* __restrict b,
-                                typename ArrayC::value_type* c, NullMap& null_map, size_t size) {
+                                typename ArrayC::value_type* c, NullMap& null_map, size_t size,
+                                const ResultType& max_result_number) {
+        static_assert(OpTraits::is_division || OpTraits::is_mod);
         if constexpr (OpTraits::is_division && IsDecimalNumber<B>) {
             for (size_t i = 0; i < size; ++i) {
-                c[i] = apply_scaled_div(a, b[i], null_map[i]);
-            }
-        } else if constexpr ((OpTraits::is_multiply || OpTraits::is_plus_minus) &&
-                             (IsDecimalNumber<B> || IsDecimalNumber<A>)) {
-            for (size_t i = 0; i < size; ++i) {
-                null_map[i] = apply_op_safely(a, b[i], c[i].value);
+                c[i] = apply(a, b[i], null_map[i], max_result_number);
             }
         } else {
             for (size_t i = 0; i < size; ++i) {
-                c[i] = apply(a, b[i], null_map[i]);
+                c[i] = apply(a, b[i], null_map[i], max_result_number);
             }
         }
     }
@@ -368,16 +345,13 @@ private:
         return apply<true>(a, b, max_result_number, scale_diff_multiplier);
     }
 
-    static ResultType constant_constant(A a, B b, UInt8& is_null) {
+    static ResultType constant_constant(A a, B b, UInt8& is_null,
+                                        const ResultType& max_result_number) {
+        static_assert(OpTraits::is_division || OpTraits::is_mod);
         if constexpr (OpTraits::is_division && IsDecimalNumber<B>) {
-            return apply_scaled_div(a, b, is_null);
-        } else if constexpr ((OpTraits::is_multiply || OpTraits::is_plus_minus) &&
-                             (IsDecimalNumber<B> || IsDecimalNumber<A>)) {
-            NativeResultType res;
-            is_null = apply_op_safely(a, b, res);
-            return res;
+            return apply(a, b, is_null, max_result_number);
         } else {
-            return apply(a, b, is_null);
+            return apply(a, b, is_null, max_result_number);
         }
     }
 
@@ -389,13 +363,13 @@ public:
                 1, assert_cast<const DataTypeDecimal<ResultType>&>(*res_data_type).get_scale());
 
         if constexpr (check_overflow && !is_to_null_type &&
-                      ((!OpTraits::is_multiply && !OpTraits::is_plus_minus) || IsDecimalV2<A> ||
-                       IsDecimalV2<B>)) {
+                      ((!OpTraits::is_multiply && !OpTraits::is_plus_minus))) {
             LOG(FATAL) << "Invalid function type!";
             return column_result;
         } else if constexpr (is_to_null_type) {
             auto null_map = ColumnUInt8::create(1, 0);
-            column_result->get_element(0) = constant_constant(a, b, null_map->get_element(0));
+            column_result->get_element(0) =
+                    constant_constant(a, b, null_map->get_element(0), max_result_number);
             return ColumnNullable::create(std::move(column_result), std::move(null_map));
         } else {
             column_result->get_element(0) =
@@ -415,14 +389,13 @@ public:
         DCHECK(column_left_ptr != nullptr);
 
         if constexpr (check_overflow && !is_to_null_type &&
-                      ((!OpTraits::is_multiply && !OpTraits::is_plus_minus) || IsDecimalV2<A> ||
-                       IsDecimalV2<B>)) {
+                      ((!OpTraits::is_multiply && !OpTraits::is_plus_minus))) {
             LOG(FATAL) << "Invalid function type!";
             return column_result;
         } else if constexpr (is_to_null_type) {
             auto null_map = ColumnUInt8::create(column_left->size(), 0);
             vector_constant(column_left_ptr->get_data().data(), b, column_result->get_data().data(),
-                            null_map->get_data(), column_left->size());
+                            null_map->get_data(), column_left->size(), max_result_number);
             return ColumnNullable::create(std::move(column_result), std::move(null_map));
         } else {
             vector_constant(column_left_ptr->get_data().data(), b, column_result->get_data().data(),
@@ -442,15 +415,14 @@ public:
         DCHECK(column_right_ptr != nullptr);
 
         if constexpr (check_overflow && !is_to_null_type &&
-                      ((!OpTraits::is_multiply && !OpTraits::is_plus_minus) || IsDecimalV2<A> ||
-                       IsDecimalV2<B>)) {
+                      ((!OpTraits::is_multiply && !OpTraits::is_plus_minus))) {
             LOG(FATAL) << "Invalid function type!";
             return column_result;
         } else if constexpr (is_to_null_type) {
             auto null_map = ColumnUInt8::create(column_right->size(), 0);
             constant_vector(a, column_right_ptr->get_data().data(),
                             column_result->get_data().data(), null_map->get_data(),
-                            column_right->size());
+                            column_right->size(), max_result_number);
             return ColumnNullable::create(std::move(column_result), std::move(null_map));
         } else {
             constant_vector(a, column_right_ptr->get_data().data(),
@@ -473,15 +445,15 @@ public:
         DCHECK(column_left_ptr != nullptr && column_right_ptr != nullptr);
 
         if constexpr (check_overflow && !is_to_null_type &&
-                      ((!OpTraits::is_multiply && !OpTraits::is_plus_minus) || IsDecimalV2<A> ||
-                       IsDecimalV2<B>)) {
+                      ((!OpTraits::is_multiply && !OpTraits::is_plus_minus))) {
             LOG(FATAL) << "Invalid function type!";
             return column_result;
         } else if constexpr (is_to_null_type) {
+            // function divide, modulo and pmod
             auto null_map = ColumnUInt8::create(column_result->size(), 0);
             vector_vector(column_left_ptr->get_data().data(), column_right_ptr->get_data().data(),
                           column_result->get_data().data(), null_map->get_data(),
-                          column_left->size());
+                          column_left->size(), max_result_number);
             return ColumnNullable::create(std::move(column_result), std::move(null_map));
         } else {
             vector_vector(column_left_ptr->get_data().data(), column_right_ptr->get_data().data(),
@@ -497,10 +469,18 @@ private:
     static ALWAYS_INLINE NativeResultType apply(NativeResultType a, NativeResultType b,
                                                 const ResultType& max_result_number,
                                                 const ResultType& scale_diff_multiplier) {
+        static_assert(OpTraits::is_plus_minus || OpTraits::is_multiply);
         if constexpr (IsDecimalV2<B> || IsDecimalV2<A>) {
             // Now, Doris only support decimal +-*/ decimal.
-            // overflow in consider in operator
-            return Op::template apply(DecimalV2Value(a), DecimalV2Value(b)).value();
+            if constexpr (check_overflow) {
+                auto res = Op::template apply(DecimalV2Value(a), DecimalV2Value(b)).value();
+                if (res > max_result_number.value || res < -max_result_number.value) {
+                    throw Exception(ErrorCode::ARITHMETIC_OVERFLOW_ERRROR, "Arithmetic overflow");
+                }
+                return res;
+            } else {
+                return Op::template apply(DecimalV2Value(a), DecimalV2Value(b)).value();
+            }
         } else {
             NativeResultType res;
             if constexpr (OpTraits::can_overflow && check_overflow) {
@@ -563,11 +543,34 @@ private:
 
     /// null_map for divide and mod
     static ALWAYS_INLINE NativeResultType apply(NativeResultType a, NativeResultType b,
-                                                UInt8& is_null) {
+                                                UInt8& is_null,
+                                                const ResultType& max_result_number) {
+        static_assert(OpTraits::is_division || OpTraits::is_mod);
         if constexpr (IsDecimalV2<B> || IsDecimalV2<A>) {
             DecimalV2Value l(a);
             DecimalV2Value r(b);
             auto ans = Op::template apply(l, r, is_null);
+            using ANS_TYPE = std::decay_t<decltype(ans)>;
+            if constexpr (check_overflow && OpTraits::is_division) {
+                if constexpr (std::is_same_v<ANS_TYPE, DecimalV2Value>) {
+                    if (ans.value() > max_result_number.value ||
+                        ans.value() < -max_result_number.value) {
+                        throw Exception(ErrorCode::ARITHMETIC_OVERFLOW_ERRROR,
+                                        "Arithmetic overflow");
+                    }
+                } else if constexpr (IsDecimalNumber<ANS_TYPE>) {
+                    if (ans.value > max_result_number.value ||
+                        ans.value < -max_result_number.value) {
+                        throw Exception(ErrorCode::ARITHMETIC_OVERFLOW_ERRROR,
+                                        "Arithmetic overflow");
+                    }
+                } else {
+                    if (ans > max_result_number.value || ans < -max_result_number.value) {
+                        throw Exception(ErrorCode::ARITHMETIC_OVERFLOW_ERRROR,
+                                        "Arithmetic overflow");
+                    }
+                }
+            }
             NativeResultType result;
             memcpy(&result, &ans, std::min(sizeof(result), sizeof(ans)));
             return result;
@@ -575,51 +578,6 @@ private:
             return Op::template apply<NativeResultType>(a, b, is_null);
         }
     }
-
-    static NativeResultType apply_scaled(NativeResultType a, NativeResultType b) {
-        if constexpr (OpTraits::is_plus_minus) {
-            NativeResultType res;
-
-            if constexpr (check_overflow) {
-                bool overflow = false;
-
-                if constexpr (OpTraits::can_overflow) {
-                    overflow |= Op::template apply<NativeResultType>(a, b, res);
-                } else {
-                    res = Op::template apply<NativeResultType>(a, b);
-                }
-
-                // TODO handle overflow gracefully
-                if (overflow) {
-                    LOG(WARNING) << "Decimal math overflow";
-                    res = max_decimal_value<ResultType>();
-                }
-            } else {
-                res = apply(a, b);
-            }
-
-            return res;
-        }
-    }
-
-    static NativeResultType apply_scaled_div(NativeResultType a, NativeResultType b,
-                                             UInt8& is_null) {
-        if constexpr (OpTraits::is_division) {
-            return apply(a, b, is_null);
-        }
-    }
-
-    static NativeResultType apply_scaled_mod(NativeResultType a, NativeResultType b,
-                                             UInt8& is_null) {
-        return apply(a, b, is_null);
-    }
-
-    static ALWAYS_INLINE UInt8 apply_op_safely(NativeResultType a, NativeResultType b,
-                                               NativeResultType& c) {
-        if constexpr (OpTraits::is_multiply || OpTraits::is_plus_minus) {
-            return Op::template apply(a, b, c);
-        }
-    }
 };
 
 /// Used to indicate undefined operation
@@ -972,11 +930,14 @@ public:
                                                         (IsDataTypeDecimal<LeftDataType> ||
                                                          IsDataTypeDecimal<RightDataType>))) {
                         if (check_overflow_for_decimal) {
-                            if constexpr ((IsDecimalV2<typename LeftDataType::FieldType> ||
-                                           IsDecimalV2<typename RightDataType::
-                                                               FieldType>)&&!is_to_null_type) {
+                            // !is_to_null_type: plus, minus, multiply,
+                            //                   pow, bitxor, bitor, bitand
+                            // if check_overflow and params are decimal types:
+                            //   for functions pow, bitxor, bitor, bitand, return error
+                            if constexpr (IsDataTypeDecimal<ResultDataType> && !is_to_null_type &&
+                                          !OpTraits::is_multiply && !OpTraits::is_plus_minus) {
                                 status = Status::Error<ErrorCode::NOT_IMPLEMENTED_ERROR>(
-                                        "cannot check overflow with decimalv2");
+                                        "cannot check overflow with decimal for function {}", name);
                                 return false;
                             }
                             auto column_result = ConstOrVectorAdapter<
diff --git a/be/src/vec/functions/multiply.cpp b/be/src/vec/functions/multiply.cpp
index 359e3131c3a..79653910991 100644
--- a/be/src/vec/functions/multiply.cpp
+++ b/be/src/vec/functions/multiply.cpp
@@ -48,10 +48,17 @@ struct MultiplyImpl {
         return a * b;
     }
 
+    /*
+    select 999999999999999999999999999 * 999999999999999999999999999;
+    999999999999999999999999998000000000.000000000000000001 54 digits
+    */
+    template <bool check_overflow>
     static void vector_vector(const ColumnDecimal128::Container::value_type* __restrict a,
                               const ColumnDecimal128::Container::value_type* __restrict b,
                               ColumnDecimal128::Container::value_type* c, size_t size) {
         int8 sgn[size];
+        auto max = DecimalV2Value::get_max_decimal();
+        auto min = DecimalV2Value::get_min_decimal();
 
         for (int i = 0; i < size; i++) {
             sgn[i] = ((DecimalV2Value(a[i]).value() > 0) && (DecimalV2Value(b[i]).value() > 0)) ||
@@ -64,14 +71,20 @@ struct MultiplyImpl {
         }
 
         for (int i = 0; i < size; i++) {
-            int128_t i128_mul_result;
-            if (common::mul_overflow(DecimalV2Value(a[i]).value(), DecimalV2Value(b[i]).value(),
-                                     i128_mul_result)) {
-                VLOG_DEBUG << "Decimal multiply overflow";
-                c[i] = (sgn[i] == -1) ? -DecimalV2Value::MAX_DECIMAL_VALUE
-                                      : DecimalV2Value::MAX_DECIMAL_VALUE;
-            } else {
+            if constexpr (check_overflow) {
+                int128_t i128_mul_result;
+                if (common::mul_overflow(DecimalV2Value(a[i]).value(), DecimalV2Value(b[i]).value(),
+                                         i128_mul_result)) {
+                    throw Exception(ErrorCode::ARITHMETIC_OVERFLOW_ERRROR, "Arithmetic overflow");
+                }
                 c[i] = (i128_mul_result - sgn[i]) / DecimalV2Value::ONE_BILLION + sgn[i];
+                if (c[i].value > max.value() || c[i].value < min.value()) {
+                    throw Exception(ErrorCode::ARITHMETIC_OVERFLOW_ERRROR, "Arithmetic overflow");
+                }
+            } else {
+                c[i] = (DecimalV2Value(a[i]).value() * DecimalV2Value(b[i]).value() - sgn[i]) /
+                               DecimalV2Value::ONE_BILLION +
+                       sgn[i];
             }
         }
     }
diff --git a/regression-test/data/datatype_p0/decimalv2/test_decimalv2_calc.out b/regression-test/data/datatype_p0/decimalv2/test_decimalv2_calc.out
new file mode 100644
index 00000000000..fd0bf5d2358
--- /dev/null
+++ b/regression-test/data/datatype_p0/decimalv2/test_decimalv2_calc.out
@@ -0,0 +1,133 @@
+-- This file is automatically generated. You should know what you did if you want to edit this
+-- !select_all --
+\N	\N	\N	\N
+1.10000	1.20000	1.56000	1.23400
+1.10000	1.40000	1.50000	1.60000
+1.20000	1.20000	1.34400	1.32432
+1.20000	1.20000	1.66000	1.53465
+1.30000	1.20000	1.45600	1.34544
+2.10000	1.20000	1.30000	1.23400
+2.10000	1.20000	1.30000	1.23420
+2.20000	1.40000	1.21000	1.12300
+
+-- !select_calc1 --
+\N	\N	\N	\N	\N	\N
+1.10000	1.10000	2.200000000	0E-9	1.210000000	1.000000000
+1.10000	1.10000	2.200000000	0E-9	1.210000000	1.000000000
+1.20000	1.20000	2.400000000	0E-9	1.440000000	1.000000000
+1.20000	1.20000	2.400000000	0E-9	1.440000000	1.000000000
+1.30000	1.30000	2.600000000	0E-9	1.690000000	1.000000000
+2.10000	2.10000	4.200000000	0E-9	4.410000000	1.000000000
+2.10000	2.10000	4.200000000	0E-9	4.410000000	1.000000000
+2.20000	2.20000	4.400000000	0E-9	4.840000000	1.000000000
+
+-- !select_calc2 --
+\N	\N	\N	\N	\N	\N	\N	\N	\N	\N
+1.10000	1.20000	2.300000000	-0.100000000	1.320000000	0.916666667	2.300000000	0.100000000	1.320000000	1.090909091
+1.10000	1.40000	2.500000000	-0.300000000	1.540000000	0.785714286	2.500000000	0.300000000	1.540000000	1.272727273
+1.20000	1.20000	2.400000000	0E-9	1.440000000	1.000000000	2.400000000	0E-9	1.440000000	1.000000000
+1.20000	1.20000	2.400000000	0E-9	1.440000000	1.000000000	2.400000000	0E-9	1.440000000	1.000000000
+1.30000	1.20000	2.500000000	0.100000000	1.560000000	1.083333333	2.500000000	-0.100000000	1.560000000	0.923076923
+2.10000	1.20000	3.300000000	0.900000000	2.520000000	1.750000000	3.300000000	-0.900000000	2.520000000	0.571428571
+2.10000	1.20000	3.300000000	0.900000000	2.520000000	1.750000000	3.300000000	-0.900000000	2.520000000	0.571428571
+2.20000	1.40000	3.600000000	0.800000000	3.080000000	1.571428571	3.600000000	-0.800000000	3.080000000	0.636363636
+
+-- !select_calc3 --
+\N	\N	\N	\N	\N	\N	\N	\N	\N	\N
+1.10000	1.50000	2.600000000	-0.400000000	1.650000000	0.733333333	2.600000000	0.400000000	1.650000000	1.363636364
+1.10000	1.56000	2.660000000	-0.460000000	1.716000000	0.705128205	2.660000000	0.460000000	1.716000000	1.418181818
+1.20000	1.34400	2.544000000	-0.144000000	1.612800000	0.892857143	2.544000000	0.144000000	1.612800000	1.120000000
+1.20000	1.66000	2.860000000	-0.460000000	1.992000000	0.722891566	2.860000000	0.460000000	1.992000000	1.383333333
+1.30000	1.45600	2.756000000	-0.156000000	1.892800000	0.892857143	2.756000000	0.156000000	1.892800000	1.120000000
+2.10000	1.30000	3.400000000	0.800000000	2.730000000	1.615384615	3.400000000	-0.800000000	2.730000000	0.619047619
+2.10000	1.30000	3.400000000	0.800000000	2.730000000	1.615384615	3.400000000	-0.800000000	2.730000000	0.619047619
+2.20000	1.21000	3.410000000	0.990000000	2.662000000	1.818181818	3.410000000	-0.990000000	2.662000000	0.550000000
+
+-- !select_calc4 --
+\N	\N	\N	\N	\N	\N	\N	\N	\N	\N
+1.10000	1.23400	2.334000000	-0.134000000	1.357400000	0.891410049	2.334000000	0.134000000	1.357400000	1.121818182
+1.10000	1.60000	2.700000000	-0.500000000	1.760000000	0.687500000	2.700000000	0.500000000	1.760000000	1.454545455
+1.20000	1.32432	2.524320000	-0.124320000	1.589184000	0.906125408	2.524320000	0.124320000	1.589184000	1.103600000
+1.20000	1.53465	2.734650000	-0.334650000	1.841580000	0.781937250	2.734650000	0.334650000	1.841580000	1.278875000
+1.30000	1.34544	2.645440000	-0.045440000	1.749072000	0.966226662	2.645440000	0.045440000	1.749072000	1.034953846
+2.10000	1.23400	3.334000000	0.866000000	2.591400000	1.701782820	3.334000000	-0.866000000	2.591400000	0.587619048
+2.10000	1.23420	3.334200000	0.865800000	2.591820000	1.701507049	3.334200000	-0.865800000	2.591820000	0.587714286
+2.20000	1.12300	3.323000000	1.077000000	2.470600000	1.959038290	3.323000000	-1.077000000	2.470600000	0.510454545
+
+-- !select_calc5 --
+\N	\N	\N	\N	\N
+1.20000	2.400000000	0E-9	1.440000000	1.000000000
+1.20000	2.400000000	0E-9	1.440000000	1.000000000
+1.20000	2.400000000	0E-9	1.440000000	1.000000000
+1.20000	2.400000000	0E-9	1.440000000	1.000000000
+1.20000	2.400000000	0E-9	1.440000000	1.000000000
+1.20000	2.400000000	0E-9	1.440000000	1.000000000
+1.40000	2.800000000	0E-9	1.960000000	1.000000000
+1.40000	2.800000000	0E-9	1.960000000	1.000000000
+
+-- !select_calc6 --
+\N	\N	\N	\N	\N	\N	\N	\N	\N	\N
+1.20000	1.30000	2.500000000	-0.100000000	1.560000000	0.972289742	2.500000000	0.100000000	1.560000000	1.083333333
+1.20000	1.30000	2.500000000	-0.100000000	1.560000000	0.972447326	2.500000000	0.100000000	1.560000000	1.083333333
+1.20000	1.34400	2.544000000	-0.144000000	1.612800000	0.906125408	2.544000000	0.144000000	1.612800000	1.120000000
+1.20000	1.45600	2.656000000	-0.256000000	1.747200000	0.891901534	2.656000000	0.256000000	1.747200000	1.213333333
+1.20000	1.56000	2.760000000	-0.360000000	1.872000000	0.972447326	2.760000000	0.360000000	1.872000000	1.300000000
+1.20000	1.66000	2.860000000	-0.460000000	1.992000000	0.781937250	2.860000000	0.460000000	1.992000000	1.383333333
+1.40000	1.21000	2.610000000	0.190000000	1.694000000	1.246660730	2.610000000	-0.190000000	1.694000000	0.864285714
+1.40000	1.50000	2.900000000	-0.100000000	2.100000000	0.875000000	2.900000000	0.100000000	2.100000000	1.071428571
+
+-- !select_calc7 --
+\N	\N	\N	\N	\N	\N	\N	\N	\N	\N
+1.20000	1.23400	2.434000000	-0.034000000	1.480800000	0.972447326	2.434000000	0.034000000	1.480800000	1.028333333
+1.20000	1.23400	2.434000000	-0.034000000	1.480800000	0.972447326	2.434000000	0.034000000	1.480800000	1.028333333
+1.20000	1.23420	2.434200000	-0.034200000	1.481040000	0.972289742	2.434200000	0.034200000	1.481040000	1.028500000
+1.20000	1.32432	2.524320000	-0.124320000	1.589184000	0.906125408	2.524320000	0.124320000	1.589184000	1.103600000
+1.20000	1.34544	2.545440000	-0.145440000	1.614528000	0.891901534	2.545440000	0.145440000	1.614528000	1.121200000
+1.20000	1.53465	2.734650000	-0.334650000	1.841580000	0.781937250	2.734650000	0.334650000	1.841580000	1.278875000
+1.40000	1.12300	2.523000000	0.277000000	1.572200000	1.246660730	2.523000000	-0.277000000	1.572200000	0.802142857
+1.40000	1.60000	3.000000000	-0.200000000	2.240000000	0.875000000	3.000000000	0.200000000	2.240000000	1.142857143
+
+-- !select_calc8 --
+\N	\N	\N	\N	\N
+1.21000	2.420000000	0E-9	1.464100000	1.000000000
+1.30000	2.600000000	0E-9	1.690000000	1.000000000
+1.30000	2.600000000	0E-9	1.690000000	1.000000000
+1.34400	2.688000000	0E-9	1.806336000	1.000000000
+1.45600	2.912000000	0E-9	2.119936000	1.000000000
+1.50000	3.000000000	0E-9	2.250000000	1.000000000
+1.56000	3.120000000	0E-9	2.433600000	1.000000000
+1.66000	3.320000000	0E-9	2.755600000	1.000000000
+
+-- !select_calc9 --
+\N	\N	\N	\N	\N	\N	\N	\N	\N	\N
+1.21000	1.12300	2.333000000	0.087000000	1.358830000	1.077471060	2.333000000	-0.087000000	1.358830000	0.928099174
+1.30000	1.23400	2.534000000	0.066000000	1.604200000	1.053484603	2.534000000	-0.066000000	1.604200000	0.949230769
+1.30000	1.23420	2.534200000	0.065800000	1.604460000	1.053313888	2.534200000	-0.065800000	1.604460000	0.949384615
+1.34400	1.32432	2.668320000	0.019680000	1.779886080	1.014860457	2.668320000	-0.019680000	1.779886080	0.985357143
+1.45600	1.34544	2.801440000	0.110560000	1.958960640	1.082173861	2.801440000	-0.110560000	1.958960640	0.924065934
+1.50000	1.60000	3.100000000	-0.100000000	2.400000000	0.937500000	3.100000000	0.100000000	2.400000000	1.066666667
+1.56000	1.23400	2.794000000	0.326000000	1.925040000	1.264181524	2.794000000	-0.326000000	1.925040000	0.791025641
+1.66000	1.53465	3.194650000	0.125350000	2.547519000	1.081679862	3.194650000	-0.125350000	2.547519000	0.924487952
+
+-- !select_calc10 --
+\N	\N	\N	\N	\N
+1.12300	2.246000000	0E-9	1.261129000	1.000000000
+1.23400	2.468000000	0E-9	1.522756000	1.000000000
+1.23400	2.468000000	0E-9	1.522756000	1.000000000
+1.23420	2.468400000	0E-9	1.523249640	1.000000000
+1.32432	2.648640000	0E-9	1.753823463	1.000000000
+1.34544	2.690880000	0E-9	1.810208794	1.000000000
+1.53465	3.069300000	0E-9	2.355150623	1.000000000
+1.60000	3.200000000	0E-9	2.560000000	1.000000000
+
+-- !calc_overflow --
+\N	\N	\N	\N
+1.21000	1.12300	1209.999987900	1.122999888
+1.30000	1.23400	1299.999987000	1.233999877
+1.30000	1.23420	1299.999987000	1.234199877
+1.34400	1.32432	1343.999986560	1.324319868
+1.45600	1.34544	1455.999985440	1.345439865
+1.50000	1.60000	1499.999985000	1.599999840
+1.56000	1.23400	1559.999984400	1.233999877
+1.66000	1.53465	1659.999983400	1.534649847
+
diff --git a/regression-test/data/datatype_p0/decimalv2/test_decimalv2_calc_with_conversion.out b/regression-test/data/datatype_p0/decimalv2/test_decimalv2_calc_with_conversion.out
new file mode 100644
index 00000000000..2e57ced4d3f
--- /dev/null
+++ b/regression-test/data/datatype_p0/decimalv2/test_decimalv2_calc_with_conversion.out
@@ -0,0 +1,133 @@
+-- This file is automatically generated. You should know what you did if you want to edit this
+-- !select_all --
+\N	\N	\N	\N
+1.10000	1.20000	1.56000	1.23400
+1.10000	1.40000	1.50000	1.60000
+1.20000	1.20000	1.34400	1.32432
+1.20000	1.20000	1.66000	1.53465
+1.30000	1.20000	1.45600	1.34544
+2.10000	1.20000	1.30000	1.23400
+2.10000	1.20000	1.30000	1.23420
+2.20000	1.40000	1.21000	1.12300
+
+-- !select_calc1 --
+\N	\N	\N	\N	\N	\N
+1.10000	1.10000	2.200000000	0E-9	1.210000000	1.000000000
+1.10000	1.10000	2.200000000	0E-9	1.210000000	1.000000000
+1.20000	1.20000	2.400000000	0E-9	1.440000000	1.000000000
+1.20000	1.20000	2.400000000	0E-9	1.440000000	1.000000000
+1.30000	1.30000	2.600000000	0E-9	1.690000000	1.000000000
+2.10000	2.10000	4.200000000	0E-9	4.410000000	1.000000000
+2.10000	2.10000	4.200000000	0E-9	4.410000000	1.000000000
+2.20000	2.20000	4.400000000	0E-9	4.840000000	1.000000000
+
+-- !select_calc2 --
+\N	\N	\N	\N	\N	\N	\N	\N	\N	\N
+1.10000	1.20000	2.300000000	-0.100000000	1.320000000	0.916666667	2.300000000	0.100000000	1.320000000	1.090909091
+1.10000	1.40000	2.500000000	-0.300000000	1.540000000	0.785714286	2.500000000	0.300000000	1.540000000	1.272727273
+1.20000	1.20000	2.400000000	0E-9	1.440000000	1.000000000	2.400000000	0E-9	1.440000000	1.000000000
+1.20000	1.20000	2.400000000	0E-9	1.440000000	1.000000000	2.400000000	0E-9	1.440000000	1.000000000
+1.30000	1.20000	2.500000000	0.100000000	1.560000000	1.083333333	2.500000000	-0.100000000	1.560000000	0.923076923
+2.10000	1.20000	3.300000000	0.900000000	2.520000000	1.750000000	3.300000000	-0.900000000	2.520000000	0.571428571
+2.10000	1.20000	3.300000000	0.900000000	2.520000000	1.750000000	3.300000000	-0.900000000	2.520000000	0.571428571
+2.20000	1.40000	3.600000000	0.800000000	3.080000000	1.571428571	3.600000000	-0.800000000	3.080000000	0.636363636
+
+-- !select_calc3 --
+\N	\N	\N	\N	\N	\N	\N	\N	\N	\N
+1.10000	1.50000	2.600000000	-0.400000000	1.650000000	0.733333333	2.600000000	0.400000000	1.650000000	1.363636364
+1.10000	1.56000	2.660000000	-0.460000000	1.716000000	0.705128205	2.660000000	0.460000000	1.716000000	1.418181818
+1.20000	1.34400	2.544000000	-0.144000000	1.612800000	0.892857143	2.544000000	0.144000000	1.612800000	1.120000000
+1.20000	1.66000	2.860000000	-0.460000000	1.992000000	0.722891566	2.860000000	0.460000000	1.992000000	1.383333333
+1.30000	1.45600	2.756000000	-0.156000000	1.892800000	0.892857143	2.756000000	0.156000000	1.892800000	1.120000000
+2.10000	1.30000	3.400000000	0.800000000	2.730000000	1.615384615	3.400000000	-0.800000000	2.730000000	0.619047619
+2.10000	1.30000	3.400000000	0.800000000	2.730000000	1.615384615	3.400000000	-0.800000000	2.730000000	0.619047619
+2.20000	1.21000	3.410000000	0.990000000	2.662000000	1.818181818	3.410000000	-0.990000000	2.662000000	0.550000000
+
+-- !select_calc4 --
+\N	\N	\N	\N	\N	\N	\N	\N	\N	\N
+1.10000	1.23400	2.334000000	-0.134000000	1.357400000	0.891410049	2.334000000	0.134000000	1.357400000	1.121818182
+1.10000	1.60000	2.700000000	-0.500000000	1.760000000	0.687500000	2.700000000	0.500000000	1.760000000	1.454545455
+1.20000	1.32432	2.524320000	-0.124320000	1.589184000	0.906125408	2.524320000	0.124320000	1.589184000	1.103600000
+1.20000	1.53465	2.734650000	-0.334650000	1.841580000	0.781937250	2.734650000	0.334650000	1.841580000	1.278875000
+1.30000	1.34544	2.645440000	-0.045440000	1.749072000	0.966226662	2.645440000	0.045440000	1.749072000	1.034953846
+2.10000	1.23400	3.334000000	0.866000000	2.591400000	1.701782820	3.334000000	-0.866000000	2.591400000	0.587619048
+2.10000	1.23420	3.334200000	0.865800000	2.591820000	1.701507049	3.334200000	-0.865800000	2.591820000	0.587714286
+2.20000	1.12300	3.323000000	1.077000000	2.470600000	1.959038290	3.323000000	-1.077000000	2.470600000	0.510454545
+
+-- !select_calc5 --
+\N	\N	\N	\N	\N
+1.20000	2.400000000	0E-9	1.440000000	1.000000000
+1.20000	2.400000000	0E-9	1.440000000	1.000000000
+1.20000	2.400000000	0E-9	1.440000000	1.000000000
+1.20000	2.400000000	0E-9	1.440000000	1.000000000
+1.20000	2.400000000	0E-9	1.440000000	1.000000000
+1.20000	2.400000000	0E-9	1.440000000	1.000000000
+1.40000	2.800000000	0E-9	1.960000000	1.000000000
+1.40000	2.800000000	0E-9	1.960000000	1.000000000
+
+-- !select_calc6 --
+\N	\N	\N	\N	\N	\N	\N	\N	\N	\N
+1.20000	1.30000	2.500000000	-0.100000000	1.560000000	0.972289742	2.500000000	0.100000000	1.560000000	1.083333333
+1.20000	1.30000	2.500000000	-0.100000000	1.560000000	0.972447326	2.500000000	0.100000000	1.560000000	1.083333333
+1.20000	1.34400	2.544000000	-0.144000000	1.612800000	0.906125408	2.544000000	0.144000000	1.612800000	1.120000000
+1.20000	1.45600	2.656000000	-0.256000000	1.747200000	0.891901534	2.656000000	0.256000000	1.747200000	1.213333333
+1.20000	1.56000	2.760000000	-0.360000000	1.872000000	0.972447326	2.760000000	0.360000000	1.872000000	1.300000000
+1.20000	1.66000	2.860000000	-0.460000000	1.992000000	0.781937250	2.860000000	0.460000000	1.992000000	1.383333333
+1.40000	1.21000	2.610000000	0.190000000	1.694000000	1.246660730	2.610000000	-0.190000000	1.694000000	0.864285714
+1.40000	1.50000	2.900000000	-0.100000000	2.100000000	0.875000000	2.900000000	0.100000000	2.100000000	1.071428571
+
+-- !select_calc7 --
+\N	\N	\N	\N	\N	\N	\N	\N	\N	\N
+1.20000	1.23400	2.434000000	-0.034000000	1.480800000	0.972447326	2.434000000	0.034000000	1.480800000	1.028333333
+1.20000	1.23400	2.434000000	-0.034000000	1.480800000	0.972447326	2.434000000	0.034000000	1.480800000	1.028333333
+1.20000	1.23420	2.434200000	-0.034200000	1.481040000	0.972289742	2.434200000	0.034200000	1.481040000	1.028500000
+1.20000	1.32432	2.524320000	-0.124320000	1.589184000	0.906125408	2.524320000	0.124320000	1.589184000	1.103600000
+1.20000	1.34544	2.545440000	-0.145440000	1.614528000	0.891901534	2.545440000	0.145440000	1.614528000	1.121200000
+1.20000	1.53465	2.734650000	-0.334650000	1.841580000	0.781937250	2.734650000	0.334650000	1.841580000	1.278875000
+1.40000	1.12300	2.523000000	0.277000000	1.572200000	1.246660730	2.523000000	-0.277000000	1.572200000	0.802142857
+1.40000	1.60000	3.000000000	-0.200000000	2.240000000	0.875000000	3.000000000	0.200000000	2.240000000	1.142857143
+
+-- !select_calc8 --
+\N	\N	\N	\N	\N
+1.21000	2.420000000	0E-9	1.464100000	1.000000000
+1.30000	2.600000000	0E-9	1.690000000	1.000000000
+1.30000	2.600000000	0E-9	1.690000000	1.000000000
+1.34400	2.688000000	0E-9	1.806336000	1.000000000
+1.45600	2.912000000	0E-9	2.119936000	1.000000000
+1.50000	3.000000000	0E-9	2.250000000	1.000000000
+1.56000	3.120000000	0E-9	2.433600000	1.000000000
+1.66000	3.320000000	0E-9	2.755600000	1.000000000
+
+-- !select_calc9 --
+\N	\N	\N	\N	\N	\N	\N	\N	\N	\N
+1.21000	1.12300	2.333000000	0.087000000	1.358830000	1.077471060	2.333000000	-0.087000000	1.358830000	0.928099174
+1.30000	1.23400	2.534000000	0.066000000	1.604200000	1.053484603	2.534000000	-0.066000000	1.604200000	0.949230769
+1.30000	1.23420	2.534200000	0.065800000	1.604460000	1.053313888	2.534200000	-0.065800000	1.604460000	0.949384615
+1.34400	1.32432	2.668320000	0.019680000	1.779886080	1.014860457	2.668320000	-0.019680000	1.779886080	0.985357143
+1.45600	1.34544	2.801440000	0.110560000	1.958960640	1.082173861	2.801440000	-0.110560000	1.958960640	0.924065934
+1.50000	1.60000	3.100000000	-0.100000000	2.400000000	0.937500000	3.100000000	0.100000000	2.400000000	1.066666667
+1.56000	1.23400	2.794000000	0.326000000	1.925040000	1.264181524	2.794000000	-0.326000000	1.925040000	0.791025641
+1.66000	1.53465	3.194650000	0.125350000	2.547519000	1.081679862	3.194650000	-0.125350000	2.547519000	0.924487952
+
+-- !select_calc10 --
+\N	\N	\N	\N	\N
+1.12300	2.246000000	0E-9	1.261129000	1.000000000
+1.23400	2.468000000	0E-9	1.522756000	1.000000000
+1.23400	2.468000000	0E-9	1.522756000	1.000000000
+1.23420	2.468400000	0E-9	1.523249640	1.000000000
+1.32432	2.648640000	0E-9	1.753823463	1.000000000
+1.34544	2.690880000	0E-9	1.810208794	1.000000000
+1.53465	3.069300000	0E-9	2.355150623	1.000000000
+1.60000	3.200000000	0E-9	2.560000000	1.000000000
+
+-- !calc_overflow --
+\N	\N	\N	\N
+1.21000	1.12300	1209.9999879000	1.122999887700
+1.30000	1.23400	1299.9999870000	1.233999876600
+1.30000	1.23420	1299.9999870000	1.234199876580
+1.34400	1.32432	1343.9999865600	1.324319867568
+1.45600	1.34544	1455.9999854400	1.345439865456
+1.50000	1.60000	1499.9999850000	1.599999840000
+1.56000	1.23400	1559.9999844000	1.233999876600
+1.66000	1.53465	1659.9999834000	1.534649846535
+
diff --git a/regression-test/data/datatype_p0/decimalv2/test_decimalv2_common.out b/regression-test/data/datatype_p0/decimalv2/test_decimalv2_common.out
new file mode 100644
index 00000000000..98dde3c6fc1
--- /dev/null
+++ b/regression-test/data/datatype_p0/decimalv2/test_decimalv2_common.out
@@ -0,0 +1,2047 @@
+-- This file is automatically generated. You should know what you did if you want to edit this
+-- !predicate_test_bitmap_eq_test_decimalv2_common_dup_tbl --
+
+-- !predicate_test_bitmap_ne_test_decimalv2_common_dup_tbl --
+\N	1.11110	1.11110	1.11110
+\N	4.44440	4.44440	4.44440
+\N	8.88880	8.88880	8.88880
+\N	8.88880	8.88880	8.88880
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	1.11110	1.11110
+2.22220	2.22220	2.22220	1.11110
+2.22220	2.22220	2.22220	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	1.11110	1.11110
+3.33330	3.33330	3.33330	\N
+3.33330	3.33330	3.33330	1.11110
+3.33330	3.33330	3.33330	3.33330
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	1.11110	1.11110
+4.44440	4.44440	4.44440	\N
+4.44440	4.44440	4.44440	1.11110
+4.44440	4.44440	4.44440	4.44440
+5.55550	\N	5.55550	5.55550
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	1.11110	1.11110
+5.55550	5.55550	5.55550	\N
+5.55550	5.55550	5.55550	1.11110
+5.55550	5.55550	5.55550	5.55550
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	1.11110	1.11110
+6.66660	6.66660	6.66660	1.11110
+6.66660	6.66660	6.66660	6.66660
+7.77770	\N	7.77770	7.77770
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	1.11110	1.11110
+7.77770	7.77770	7.77770	\N
+7.77770	7.77770	7.77770	1.11110
+7.77770	7.77770	7.77770	7.77770
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	1.11110	1.11110
+8.88880	8.88880	8.88880	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	\N	9.99990	9.99990
+9.99990	\N	9.99990	9.99990
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	1.11110	1.11110
+9.99990	9.99990	9.99990	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_bitmap_lt_test_decimalv2_common_dup_tbl --
+\N	1.11110	1.11110	1.11110
+\N	4.44440	4.44440	4.44440
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	1.11110	1.11110
+2.22220	2.22220	2.22220	1.11110
+2.22220	2.22220	2.22220	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	1.11110	1.11110
+3.33330	3.33330	3.33330	\N
+3.33330	3.33330	3.33330	1.11110
+3.33330	3.33330	3.33330	3.33330
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	1.11110	1.11110
+4.44440	4.44440	4.44440	\N
+4.44440	4.44440	4.44440	1.11110
+4.44440	4.44440	4.44440	4.44440
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	1.11110	1.11110
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	1.11110	1.11110
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	1.11110	1.11110
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	1.11110	1.11110
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	1.11110	1.11110
+
+-- !predicate_test_bitmap_gt_test_decimalv2_common_dup_tbl --
+\N	8.88880	8.88880	8.88880
+\N	8.88880	8.88880	8.88880
+5.55550	\N	5.55550	5.55550
+5.55550	5.55550	5.55550	\N
+5.55550	5.55550	5.55550	1.11110
+5.55550	5.55550	5.55550	5.55550
+6.66660	6.66660	6.66660	1.11110
+6.66660	6.66660	6.66660	6.66660
+7.77770	\N	7.77770	7.77770
+7.77770	7.77770	7.77770	\N
+7.77770	7.77770	7.77770	1.11110
+7.77770	7.77770	7.77770	7.77770
+8.88880	8.88880	8.88880	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	\N	9.99990	9.99990
+9.99990	\N	9.99990	9.99990
+9.99990	9.99990	9.99990	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_eq_test_decimalv2_common_dup_tbl --
+
+-- !predicate_test_ne_test_decimalv2_common_dup_tbl --
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	\N	2.22220
+2.22220	2.22220	1.11110	1.11110
+2.22220	2.22220	2.22220	1.11110
+2.22220	2.22220	2.22220	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	\N	3.33330
+3.33330	3.33330	1.11110	1.11110
+3.33330	3.33330	3.33330	\N
+3.33330	3.33330	3.33330	1.11110
+3.33330	3.33330	3.33330	3.33330
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	1.11110	1.11110
+4.44440	4.44440	4.44440	\N
+4.44440	4.44440	4.44440	1.11110
+4.44440	4.44440	4.44440	4.44440
+5.55550	\N	5.55550	5.55550
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	1.11110	1.11110
+5.55550	5.55550	5.55550	\N
+5.55550	5.55550	5.55550	1.11110
+5.55550	5.55550	5.55550	5.55550
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	1.11110	1.11110
+6.66660	6.66660	6.66660	1.11110
+6.66660	6.66660	6.66660	6.66660
+7.77770	\N	7.77770	7.77770
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	1.11110	1.11110
+7.77770	7.77770	7.77770	\N
+7.77770	7.77770	7.77770	1.11110
+7.77770	7.77770	7.77770	7.77770
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	1.11110	1.11110
+8.88880	8.88880	8.88880	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	\N	9.99990	9.99990
+9.99990	\N	9.99990	9.99990
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	1.11110	1.11110
+9.99990	9.99990	9.99990	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_lt_test_decimalv2_common_dup_tbl --
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	\N	2.22220
+2.22220	2.22220	1.11110	1.11110
+2.22220	2.22220	2.22220	1.11110
+2.22220	2.22220	2.22220	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	\N	3.33330
+3.33330	3.33330	1.11110	1.11110
+3.33330	3.33330	3.33330	\N
+3.33330	3.33330	3.33330	1.11110
+3.33330	3.33330	3.33330	3.33330
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	1.11110	1.11110
+4.44440	4.44440	4.44440	\N
+4.44440	4.44440	4.44440	1.11110
+4.44440	4.44440	4.44440	4.44440
+
+-- !predicate_test_gt_test_decimalv2_common_dup_tbl --
+5.55550	\N	5.55550	5.55550
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	1.11110	1.11110
+5.55550	5.55550	5.55550	\N
+5.55550	5.55550	5.55550	1.11110
+5.55550	5.55550	5.55550	5.55550
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	1.11110	1.11110
+6.66660	6.66660	6.66660	1.11110
+6.66660	6.66660	6.66660	6.66660
+7.77770	\N	7.77770	7.77770
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	1.11110	1.11110
+7.77770	7.77770	7.77770	\N
+7.77770	7.77770	7.77770	1.11110
+7.77770	7.77770	7.77770	7.77770
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	1.11110	1.11110
+8.88880	8.88880	8.88880	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	\N	9.99990	9.99990
+9.99990	\N	9.99990	9.99990
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	1.11110	1.11110
+9.99990	9.99990	9.99990	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_null_test_decimalv2_common_dup_tbl --
+\N	1.11110	1.11110	1.11110
+\N	4.44440	4.44440	4.44440
+\N	8.88880	8.88880	8.88880
+\N	8.88880	8.88880	8.88880
+
+-- !predicate_test_notnull_test_decimalv2_common_dup_tbl --
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	\N	2.22220
+2.22220	2.22220	1.11110	1.11110
+2.22220	2.22220	2.22220	1.11110
+2.22220	2.22220	2.22220	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	\N	3.33330
+3.33330	3.33330	1.11110	1.11110
+3.33330	3.33330	3.33330	\N
+3.33330	3.33330	3.33330	1.11110
+3.33330	3.33330	3.33330	3.33330
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	1.11110	1.11110
+4.44440	4.44440	4.44440	\N
+4.44440	4.44440	4.44440	1.11110
+4.44440	4.44440	4.44440	4.44440
+5.55550	\N	5.55550	5.55550
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	1.11110	1.11110
+5.55550	5.55550	5.55550	\N
+5.55550	5.55550	5.55550	1.11110
+5.55550	5.55550	5.55550	5.55550
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	1.11110	1.11110
+6.66660	6.66660	6.66660	1.11110
+6.66660	6.66660	6.66660	6.66660
+7.77770	\N	7.77770	7.77770
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	1.11110	1.11110
+7.77770	7.77770	7.77770	\N
+7.77770	7.77770	7.77770	1.11110
+7.77770	7.77770	7.77770	7.77770
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	1.11110	1.11110
+8.88880	8.88880	8.88880	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	\N	9.99990	9.99990
+9.99990	\N	9.99990	9.99990
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	1.11110	1.11110
+9.99990	9.99990	9.99990	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_in_test_decimalv2_common_dup_tbl --
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	1.11110	1.11110
+4.44440	4.44440	4.44440	\N
+4.44440	4.44440	4.44440	1.11110
+4.44440	4.44440	4.44440	4.44440
+5.55550	\N	5.55550	5.55550
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	1.11110	1.11110
+5.55550	5.55550	5.55550	\N
+5.55550	5.55550	5.55550	1.11110
+5.55550	5.55550	5.55550	5.55550
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	1.11110	1.11110
+6.66660	6.66660	6.66660	1.11110
+6.66660	6.66660	6.66660	6.66660
+7.77770	\N	7.77770	7.77770
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	1.11110	1.11110
+7.77770	7.77770	7.77770	\N
+7.77770	7.77770	7.77770	1.11110
+7.77770	7.77770	7.77770	7.77770
+
+-- !predicate_test_notin_test_decimalv2_common_dup_tbl --
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	\N	2.22220
+2.22220	2.22220	1.11110	1.11110
+2.22220	2.22220	2.22220	1.11110
+2.22220	2.22220	2.22220	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	\N	3.33330
+3.33330	3.33330	1.11110	1.11110
+3.33330	3.33330	3.33330	\N
+3.33330	3.33330	3.33330	1.11110
+3.33330	3.33330	3.33330	3.33330
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	1.11110	1.11110
+8.88880	8.88880	8.88880	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	\N	9.99990	9.99990
+9.99990	\N	9.99990	9.99990
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	1.11110	1.11110
+9.99990	9.99990	9.99990	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_bitmap_eq_test_decimalv2_common_dup_tbl --
+
+-- !predicate_test_bitmap_ne_test_decimalv2_common_dup_tbl --
+\N	1.11110	1.11110	1.11110
+\N	4.44440	4.44440	4.44440
+\N	8.88880	8.88880	8.88880
+\N	8.88880	8.88880	8.88880
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	1.11110	1.11110
+2.22220	2.22220	2.22220	1.11110
+2.22220	2.22220	2.22220	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	1.11110	1.11110
+3.33330	3.33330	3.33330	\N
+3.33330	3.33330	3.33330	1.11110
+3.33330	3.33330	3.33330	3.33330
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	1.11110	1.11110
+4.44440	4.44440	4.44440	\N
+4.44440	4.44440	4.44440	1.11110
+4.44440	4.44440	4.44440	4.44440
+5.55550	\N	5.55550	5.55550
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	1.11110	1.11110
+5.55550	5.55550	5.55550	\N
+5.55550	5.55550	5.55550	1.11110
+5.55550	5.55550	5.55550	5.55550
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	1.11110	1.11110
+6.66660	6.66660	6.66660	1.11110
+6.66660	6.66660	6.66660	6.66660
+7.77770	\N	7.77770	7.77770
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	1.11110	1.11110
+7.77770	7.77770	7.77770	\N
+7.77770	7.77770	7.77770	1.11110
+7.77770	7.77770	7.77770	7.77770
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	1.11110	1.11110
+8.88880	8.88880	8.88880	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	\N	9.99990	9.99990
+9.99990	\N	9.99990	9.99990
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	1.11110	1.11110
+9.99990	9.99990	9.99990	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_bitmap_lt_test_decimalv2_common_dup_tbl --
+\N	1.11110	1.11110	1.11110
+\N	4.44440	4.44440	4.44440
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	1.11110	1.11110
+2.22220	2.22220	2.22220	1.11110
+2.22220	2.22220	2.22220	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	1.11110	1.11110
+3.33330	3.33330	3.33330	\N
+3.33330	3.33330	3.33330	1.11110
+3.33330	3.33330	3.33330	3.33330
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	1.11110	1.11110
+4.44440	4.44440	4.44440	\N
+4.44440	4.44440	4.44440	1.11110
+4.44440	4.44440	4.44440	4.44440
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	1.11110	1.11110
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	1.11110	1.11110
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	1.11110	1.11110
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	1.11110	1.11110
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	1.11110	1.11110
+
+-- !predicate_test_bitmap_gt_test_decimalv2_common_dup_tbl --
+\N	8.88880	8.88880	8.88880
+\N	8.88880	8.88880	8.88880
+5.55550	\N	5.55550	5.55550
+5.55550	5.55550	5.55550	\N
+5.55550	5.55550	5.55550	1.11110
+5.55550	5.55550	5.55550	5.55550
+6.66660	6.66660	6.66660	1.11110
+6.66660	6.66660	6.66660	6.66660
+7.77770	\N	7.77770	7.77770
+7.77770	7.77770	7.77770	\N
+7.77770	7.77770	7.77770	1.11110
+7.77770	7.77770	7.77770	7.77770
+8.88880	8.88880	8.88880	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	\N	9.99990	9.99990
+9.99990	\N	9.99990	9.99990
+9.99990	9.99990	9.99990	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_eq_test_decimalv2_common_dup_tbl --
+
+-- !predicate_test_ne_test_decimalv2_common_dup_tbl --
+\N	1.11110	1.11110	1.11110
+\N	4.44440	4.44440	4.44440
+\N	8.88880	8.88880	8.88880
+\N	8.88880	8.88880	8.88880
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	\N	2.22220
+2.22220	2.22220	1.11110	1.11110
+2.22220	2.22220	2.22220	1.11110
+2.22220	2.22220	2.22220	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	\N	3.33330
+3.33330	3.33330	1.11110	1.11110
+3.33330	3.33330	3.33330	\N
+3.33330	3.33330	3.33330	1.11110
+3.33330	3.33330	3.33330	3.33330
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	1.11110	1.11110
+4.44440	4.44440	4.44440	\N
+4.44440	4.44440	4.44440	1.11110
+4.44440	4.44440	4.44440	4.44440
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	1.11110	1.11110
+5.55550	5.55550	5.55550	\N
+5.55550	5.55550	5.55550	1.11110
+5.55550	5.55550	5.55550	5.55550
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	1.11110	1.11110
+6.66660	6.66660	6.66660	1.11110
+6.66660	6.66660	6.66660	6.66660
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	1.11110	1.11110
+7.77770	7.77770	7.77770	\N
+7.77770	7.77770	7.77770	1.11110
+7.77770	7.77770	7.77770	7.77770
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	1.11110	1.11110
+8.88880	8.88880	8.88880	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	1.11110	1.11110
+9.99990	9.99990	9.99990	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_lt_test_decimalv2_common_dup_tbl --
+\N	1.11110	1.11110	1.11110
+\N	4.44440	4.44440	4.44440
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	\N	2.22220
+2.22220	2.22220	1.11110	1.11110
+2.22220	2.22220	2.22220	1.11110
+2.22220	2.22220	2.22220	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	\N	3.33330
+3.33330	3.33330	1.11110	1.11110
+3.33330	3.33330	3.33330	\N
+3.33330	3.33330	3.33330	1.11110
+3.33330	3.33330	3.33330	3.33330
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	1.11110	1.11110
+4.44440	4.44440	4.44440	\N
+4.44440	4.44440	4.44440	1.11110
+4.44440	4.44440	4.44440	4.44440
+5.55550	1.11110	1.11110	1.11110
+6.66660	1.11110	1.11110	1.11110
+7.77770	1.11110	1.11110	1.11110
+8.88880	1.11110	1.11110	1.11110
+9.99990	1.11110	1.11110	1.11110
+
+-- !predicate_test_gt_test_decimalv2_common_dup_tbl --
+\N	8.88880	8.88880	8.88880
+\N	8.88880	8.88880	8.88880
+5.55550	5.55550	1.11110	1.11110
+5.55550	5.55550	5.55550	\N
+5.55550	5.55550	5.55550	1.11110
+5.55550	5.55550	5.55550	5.55550
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	1.11110	1.11110
+6.66660	6.66660	6.66660	1.11110
+6.66660	6.66660	6.66660	6.66660
+7.77770	7.77770	1.11110	1.11110
+7.77770	7.77770	7.77770	\N
+7.77770	7.77770	7.77770	1.11110
+7.77770	7.77770	7.77770	7.77770
+8.88880	8.88880	1.11110	1.11110
+8.88880	8.88880	8.88880	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	9.99990	1.11110	1.11110
+9.99990	9.99990	9.99990	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_null_test_decimalv2_common_dup_tbl --
+1.11110	\N	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+5.55550	\N	5.55550	5.55550
+7.77770	\N	7.77770	7.77770
+9.99990	\N	9.99990	9.99990
+9.99990	\N	9.99990	9.99990
+
+-- !predicate_test_notnull_test_decimalv2_common_dup_tbl --
+\N	1.11110	1.11110	1.11110
+\N	4.44440	4.44440	4.44440
+\N	8.88880	8.88880	8.88880
+\N	8.88880	8.88880	8.88880
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	\N	2.22220
+2.22220	2.22220	1.11110	1.11110
+2.22220	2.22220	2.22220	1.11110
+2.22220	2.22220	2.22220	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	\N	3.33330
+3.33330	3.33330	1.11110	1.11110
+3.33330	3.33330	3.33330	\N
+3.33330	3.33330	3.33330	1.11110
+3.33330	3.33330	3.33330	3.33330
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	1.11110	1.11110
+4.44440	4.44440	4.44440	\N
+4.44440	4.44440	4.44440	1.11110
+4.44440	4.44440	4.44440	4.44440
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	1.11110	1.11110
+5.55550	5.55550	5.55550	\N
+5.55550	5.55550	5.55550	1.11110
+5.55550	5.55550	5.55550	5.55550
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	1.11110	1.11110
+6.66660	6.66660	6.66660	1.11110
+6.66660	6.66660	6.66660	6.66660
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	1.11110	1.11110
+7.77770	7.77770	7.77770	\N
+7.77770	7.77770	7.77770	1.11110
+7.77770	7.77770	7.77770	7.77770
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	1.11110	1.11110
+8.88880	8.88880	8.88880	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	1.11110	1.11110
+9.99990	9.99990	9.99990	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_in_test_decimalv2_common_dup_tbl --
+\N	4.44440	4.44440	4.44440
+4.44440	4.44440	1.11110	1.11110
+4.44440	4.44440	4.44440	\N
+4.44440	4.44440	4.44440	1.11110
+4.44440	4.44440	4.44440	4.44440
+5.55550	5.55550	1.11110	1.11110
+5.55550	5.55550	5.55550	\N
+5.55550	5.55550	5.55550	1.11110
+5.55550	5.55550	5.55550	5.55550
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	1.11110	1.11110
+6.66660	6.66660	6.66660	1.11110
+6.66660	6.66660	6.66660	6.66660
+7.77770	7.77770	1.11110	1.11110
+7.77770	7.77770	7.77770	\N
+7.77770	7.77770	7.77770	1.11110
+7.77770	7.77770	7.77770	7.77770
+
+-- !predicate_test_notin_test_decimalv2_common_dup_tbl --
+\N	1.11110	1.11110	1.11110
+\N	8.88880	8.88880	8.88880
+\N	8.88880	8.88880	8.88880
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	\N	2.22220
+2.22220	2.22220	1.11110	1.11110
+2.22220	2.22220	2.22220	1.11110
+2.22220	2.22220	2.22220	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	\N	3.33330
+3.33330	3.33330	1.11110	1.11110
+3.33330	3.33330	3.33330	\N
+3.33330	3.33330	3.33330	1.11110
+3.33330	3.33330	3.33330	3.33330
+4.44440	1.11110	1.11110	1.11110
+5.55550	1.11110	1.11110	1.11110
+6.66660	1.11110	1.11110	1.11110
+7.77770	1.11110	1.11110	1.11110
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	1.11110	1.11110
+8.88880	8.88880	8.88880	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	1.11110	1.11110
+9.99990	9.99990	9.99990	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_bitmap_eq_test_decimalv2_common_dup_tbl --
+
+-- !predicate_test_bitmap_ne_test_decimalv2_common_dup_tbl --
+\N	1.11110	1.11110	1.11110
+\N	4.44440	4.44440	4.44440
+\N	8.88880	8.88880	8.88880
+\N	8.88880	8.88880	8.88880
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	1.11110	1.11110
+2.22220	2.22220	2.22220	1.11110
+2.22220	2.22220	2.22220	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	1.11110	1.11110
+3.33330	3.33330	3.33330	\N
+3.33330	3.33330	3.33330	1.11110
+3.33330	3.33330	3.33330	3.33330
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	1.11110	1.11110
+4.44440	4.44440	4.44440	\N
+4.44440	4.44440	4.44440	1.11110
+4.44440	4.44440	4.44440	4.44440
+5.55550	\N	5.55550	5.55550
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	1.11110	1.11110
+5.55550	5.55550	5.55550	\N
+5.55550	5.55550	5.55550	1.11110
+5.55550	5.55550	5.55550	5.55550
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	1.11110	1.11110
+6.66660	6.66660	6.66660	1.11110
+6.66660	6.66660	6.66660	6.66660
+7.77770	\N	7.77770	7.77770
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	1.11110	1.11110
+7.77770	7.77770	7.77770	\N
+7.77770	7.77770	7.77770	1.11110
+7.77770	7.77770	7.77770	7.77770
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	1.11110	1.11110
+8.88880	8.88880	8.88880	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	\N	9.99990	9.99990
+9.99990	\N	9.99990	9.99990
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	1.11110	1.11110
+9.99990	9.99990	9.99990	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_bitmap_lt_test_decimalv2_common_dup_tbl --
+\N	1.11110	1.11110	1.11110
+\N	4.44440	4.44440	4.44440
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	1.11110	1.11110
+2.22220	2.22220	2.22220	1.11110
+2.22220	2.22220	2.22220	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	1.11110	1.11110
+3.33330	3.33330	3.33330	\N
+3.33330	3.33330	3.33330	1.11110
+3.33330	3.33330	3.33330	3.33330
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	1.11110	1.11110
+4.44440	4.44440	4.44440	\N
+4.44440	4.44440	4.44440	1.11110
+4.44440	4.44440	4.44440	4.44440
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	1.11110	1.11110
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	1.11110	1.11110
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	1.11110	1.11110
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	1.11110	1.11110
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	1.11110	1.11110
+
+-- !predicate_test_bitmap_gt_test_decimalv2_common_dup_tbl --
+\N	8.88880	8.88880	8.88880
+\N	8.88880	8.88880	8.88880
+5.55550	\N	5.55550	5.55550
+5.55550	5.55550	5.55550	\N
+5.55550	5.55550	5.55550	1.11110
+5.55550	5.55550	5.55550	5.55550
+6.66660	6.66660	6.66660	1.11110
+6.66660	6.66660	6.66660	6.66660
+7.77770	\N	7.77770	7.77770
+7.77770	7.77770	7.77770	\N
+7.77770	7.77770	7.77770	1.11110
+7.77770	7.77770	7.77770	7.77770
+8.88880	8.88880	8.88880	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	\N	9.99990	9.99990
+9.99990	\N	9.99990	9.99990
+9.99990	9.99990	9.99990	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_eq_test_decimalv2_common_dup_tbl --
+
+-- !predicate_test_ne_test_decimalv2_common_dup_tbl --
+\N	1.11110	1.11110	1.11110
+\N	4.44440	4.44440	4.44440
+\N	8.88880	8.88880	8.88880
+\N	8.88880	8.88880	8.88880
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	1.11110	1.11110
+2.22220	2.22220	2.22220	1.11110
+2.22220	2.22220	2.22220	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	1.11110	1.11110
+3.33330	3.33330	3.33330	\N
+3.33330	3.33330	3.33330	1.11110
+3.33330	3.33330	3.33330	3.33330
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	1.11110	1.11110
+4.44440	4.44440	4.44440	\N
+4.44440	4.44440	4.44440	1.11110
+4.44440	4.44440	4.44440	4.44440
+5.55550	\N	5.55550	5.55550
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	1.11110	1.11110
+5.55550	5.55550	5.55550	\N
+5.55550	5.55550	5.55550	1.11110
+5.55550	5.55550	5.55550	5.55550
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	1.11110	1.11110
+6.66660	6.66660	6.66660	1.11110
+6.66660	6.66660	6.66660	6.66660
+7.77770	\N	7.77770	7.77770
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	1.11110	1.11110
+7.77770	7.77770	7.77770	\N
+7.77770	7.77770	7.77770	1.11110
+7.77770	7.77770	7.77770	7.77770
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	1.11110	1.11110
+8.88880	8.88880	8.88880	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	\N	9.99990	9.99990
+9.99990	\N	9.99990	9.99990
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	1.11110	1.11110
+9.99990	9.99990	9.99990	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_lt_test_decimalv2_common_dup_tbl --
+\N	1.11110	1.11110	1.11110
+\N	4.44440	4.44440	4.44440
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	1.11110	1.11110
+2.22220	2.22220	2.22220	1.11110
+2.22220	2.22220	2.22220	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	1.11110	1.11110
+3.33330	3.33330	3.33330	\N
+3.33330	3.33330	3.33330	1.11110
+3.33330	3.33330	3.33330	3.33330
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	1.11110	1.11110
+4.44440	4.44440	4.44440	\N
+4.44440	4.44440	4.44440	1.11110
+4.44440	4.44440	4.44440	4.44440
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	1.11110	1.11110
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	1.11110	1.11110
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	1.11110	1.11110
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	1.11110	1.11110
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	1.11110	1.11110
+
+-- !predicate_test_gt_test_decimalv2_common_dup_tbl --
+\N	8.88880	8.88880	8.88880
+\N	8.88880	8.88880	8.88880
+5.55550	\N	5.55550	5.55550
+5.55550	5.55550	5.55550	\N
+5.55550	5.55550	5.55550	1.11110
+5.55550	5.55550	5.55550	5.55550
+6.66660	6.66660	6.66660	1.11110
+6.66660	6.66660	6.66660	6.66660
+7.77770	\N	7.77770	7.77770
+7.77770	7.77770	7.77770	\N
+7.77770	7.77770	7.77770	1.11110
+7.77770	7.77770	7.77770	7.77770
+8.88880	8.88880	8.88880	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	\N	9.99990	9.99990
+9.99990	\N	9.99990	9.99990
+9.99990	9.99990	9.99990	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_null_test_decimalv2_common_dup_tbl --
+2.22220	2.22220	\N	2.22220
+3.33330	3.33330	\N	3.33330
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	\N	6.66660
+
+-- !predicate_test_notnull_test_decimalv2_common_dup_tbl --
+\N	1.11110	1.11110	1.11110
+\N	4.44440	4.44440	4.44440
+\N	8.88880	8.88880	8.88880
+\N	8.88880	8.88880	8.88880
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	1.11110	1.11110
+2.22220	2.22220	2.22220	1.11110
+2.22220	2.22220	2.22220	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	1.11110	1.11110
+3.33330	3.33330	3.33330	\N
+3.33330	3.33330	3.33330	1.11110
+3.33330	3.33330	3.33330	3.33330
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	1.11110	1.11110
+4.44440	4.44440	4.44440	\N
+4.44440	4.44440	4.44440	1.11110
+4.44440	4.44440	4.44440	4.44440
+5.55550	\N	5.55550	5.55550
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	1.11110	1.11110
+5.55550	5.55550	5.55550	\N
+5.55550	5.55550	5.55550	1.11110
+5.55550	5.55550	5.55550	5.55550
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	1.11110	1.11110
+6.66660	6.66660	6.66660	1.11110
+6.66660	6.66660	6.66660	6.66660
+7.77770	\N	7.77770	7.77770
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	1.11110	1.11110
+7.77770	7.77770	7.77770	\N
+7.77770	7.77770	7.77770	1.11110
+7.77770	7.77770	7.77770	7.77770
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	1.11110	1.11110
+8.88880	8.88880	8.88880	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	\N	9.99990	9.99990
+9.99990	\N	9.99990	9.99990
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	1.11110	1.11110
+9.99990	9.99990	9.99990	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_in_test_decimalv2_common_dup_tbl --
+\N	4.44440	4.44440	4.44440
+4.44440	4.44440	4.44440	\N
+4.44440	4.44440	4.44440	1.11110
+4.44440	4.44440	4.44440	4.44440
+5.55550	\N	5.55550	5.55550
+5.55550	5.55550	5.55550	\N
+5.55550	5.55550	5.55550	1.11110
+5.55550	5.55550	5.55550	5.55550
+6.66660	6.66660	6.66660	1.11110
+6.66660	6.66660	6.66660	6.66660
+7.77770	\N	7.77770	7.77770
+7.77770	7.77770	7.77770	\N
+7.77770	7.77770	7.77770	1.11110
+7.77770	7.77770	7.77770	7.77770
+
+-- !predicate_test_notin_test_decimalv2_common_dup_tbl --
+\N	1.11110	1.11110	1.11110
+\N	8.88880	8.88880	8.88880
+\N	8.88880	8.88880	8.88880
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	1.11110	1.11110
+2.22220	2.22220	2.22220	1.11110
+2.22220	2.22220	2.22220	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	1.11110	1.11110
+3.33330	3.33330	3.33330	\N
+3.33330	3.33330	3.33330	1.11110
+3.33330	3.33330	3.33330	3.33330
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	1.11110	1.11110
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	1.11110	1.11110
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	1.11110	1.11110
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	1.11110	1.11110
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	1.11110	1.11110
+8.88880	8.88880	8.88880	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	\N	9.99990	9.99990
+9.99990	\N	9.99990	9.99990
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	1.11110	1.11110
+9.99990	9.99990	9.99990	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_bitmap_eq_test_decimalv2_common_dup_tbl --
+
+-- !predicate_test_bitmap_ne_test_decimalv2_common_dup_tbl --
+\N	1.11110	1.11110	1.11110
+\N	4.44440	4.44440	4.44440
+\N	8.88880	8.88880	8.88880
+\N	8.88880	8.88880	8.88880
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	1.11110	1.11110
+2.22220	2.22220	2.22220	1.11110
+2.22220	2.22220	2.22220	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	1.11110	1.11110
+3.33330	3.33330	3.33330	\N
+3.33330	3.33330	3.33330	1.11110
+3.33330	3.33330	3.33330	3.33330
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	1.11110	1.11110
+4.44440	4.44440	4.44440	\N
+4.44440	4.44440	4.44440	1.11110
+4.44440	4.44440	4.44440	4.44440
+5.55550	\N	5.55550	5.55550
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	1.11110	1.11110
+5.55550	5.55550	5.55550	\N
+5.55550	5.55550	5.55550	1.11110
+5.55550	5.55550	5.55550	5.55550
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	1.11110	1.11110
+6.66660	6.66660	6.66660	1.11110
+6.66660	6.66660	6.66660	6.66660
+7.77770	\N	7.77770	7.77770
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	1.11110	1.11110
+7.77770	7.77770	7.77770	\N
+7.77770	7.77770	7.77770	1.11110
+7.77770	7.77770	7.77770	7.77770
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	1.11110	1.11110
+8.88880	8.88880	8.88880	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	\N	9.99990	9.99990
+9.99990	\N	9.99990	9.99990
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	1.11110	1.11110
+9.99990	9.99990	9.99990	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_bitmap_lt_test_decimalv2_common_dup_tbl --
+\N	1.11110	1.11110	1.11110
+\N	4.44440	4.44440	4.44440
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	1.11110	1.11110
+2.22220	2.22220	2.22220	1.11110
+2.22220	2.22220	2.22220	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	1.11110	1.11110
+3.33330	3.33330	3.33330	\N
+3.33330	3.33330	3.33330	1.11110
+3.33330	3.33330	3.33330	3.33330
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	1.11110	1.11110
+4.44440	4.44440	4.44440	\N
+4.44440	4.44440	4.44440	1.11110
+4.44440	4.44440	4.44440	4.44440
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	1.11110	1.11110
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	1.11110	1.11110
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	1.11110	1.11110
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	1.11110	1.11110
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	1.11110	1.11110
+
+-- !predicate_test_bitmap_gt_test_decimalv2_common_dup_tbl --
+\N	8.88880	8.88880	8.88880
+\N	8.88880	8.88880	8.88880
+5.55550	\N	5.55550	5.55550
+5.55550	5.55550	5.55550	\N
+5.55550	5.55550	5.55550	1.11110
+5.55550	5.55550	5.55550	5.55550
+6.66660	6.66660	6.66660	1.11110
+6.66660	6.66660	6.66660	6.66660
+7.77770	\N	7.77770	7.77770
+7.77770	7.77770	7.77770	\N
+7.77770	7.77770	7.77770	1.11110
+7.77770	7.77770	7.77770	7.77770
+8.88880	8.88880	8.88880	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	\N	9.99990	9.99990
+9.99990	\N	9.99990	9.99990
+9.99990	9.99990	9.99990	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_eq_test_decimalv2_common_dup_tbl --
+
+-- !predicate_test_ne_test_decimalv2_common_dup_tbl --
+\N	1.11110	1.11110	1.11110
+\N	4.44440	4.44440	4.44440
+\N	8.88880	8.88880	8.88880
+\N	8.88880	8.88880	8.88880
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	\N	2.22220
+2.22220	2.22220	1.11110	1.11110
+2.22220	2.22220	2.22220	1.11110
+2.22220	2.22220	2.22220	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	\N	3.33330
+3.33330	3.33330	1.11110	1.11110
+3.33330	3.33330	3.33330	1.11110
+3.33330	3.33330	3.33330	3.33330
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	1.11110	1.11110
+4.44440	4.44440	4.44440	1.11110
+4.44440	4.44440	4.44440	4.44440
+5.55550	\N	5.55550	5.55550
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	1.11110	1.11110
+5.55550	5.55550	5.55550	1.11110
+5.55550	5.55550	5.55550	5.55550
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	1.11110	1.11110
+6.66660	6.66660	6.66660	1.11110
+6.66660	6.66660	6.66660	6.66660
+7.77770	\N	7.77770	7.77770
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	1.11110	1.11110
+7.77770	7.77770	7.77770	1.11110
+7.77770	7.77770	7.77770	7.77770
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	1.11110	1.11110
+8.88880	8.88880	8.88880	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	\N	9.99990	9.99990
+9.99990	\N	9.99990	9.99990
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	1.11110	1.11110
+9.99990	9.99990	9.99990	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_lt_test_decimalv2_common_dup_tbl --
+\N	1.11110	1.11110	1.11110
+\N	4.44440	4.44440	4.44440
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	\N	2.22220
+2.22220	2.22220	1.11110	1.11110
+2.22220	2.22220	2.22220	1.11110
+2.22220	2.22220	2.22220	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	\N	3.33330
+3.33330	3.33330	1.11110	1.11110
+3.33330	3.33330	3.33330	1.11110
+3.33330	3.33330	3.33330	3.33330
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	1.11110	1.11110
+4.44440	4.44440	4.44440	1.11110
+4.44440	4.44440	4.44440	4.44440
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	1.11110	1.11110
+5.55550	5.55550	5.55550	1.11110
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	1.11110	1.11110
+6.66660	6.66660	6.66660	1.11110
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	1.11110	1.11110
+7.77770	7.77770	7.77770	1.11110
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	1.11110	1.11110
+8.88880	8.88880	8.88880	1.11110
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	1.11110	1.11110
+9.99990	9.99990	9.99990	1.11110
+
+-- !predicate_test_gt_test_decimalv2_common_dup_tbl --
+\N	8.88880	8.88880	8.88880
+\N	8.88880	8.88880	8.88880
+5.55550	\N	5.55550	5.55550
+5.55550	5.55550	5.55550	5.55550
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	6.66660	6.66660
+7.77770	\N	7.77770	7.77770
+7.77770	7.77770	7.77770	7.77770
+8.88880	8.88880	8.88880	8.88880
+9.99990	\N	9.99990	9.99990
+9.99990	\N	9.99990	9.99990
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_null_test_decimalv2_common_dup_tbl --
+3.33330	3.33330	3.33330	\N
+4.44440	4.44440	4.44440	\N
+5.55550	5.55550	5.55550	\N
+7.77770	7.77770	7.77770	\N
+
+-- !predicate_test_notnull_test_decimalv2_common_dup_tbl --
+\N	1.11110	1.11110	1.11110
+\N	4.44440	4.44440	4.44440
+\N	8.88880	8.88880	8.88880
+\N	8.88880	8.88880	8.88880
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	\N	2.22220
+2.22220	2.22220	1.11110	1.11110
+2.22220	2.22220	2.22220	1.11110
+2.22220	2.22220	2.22220	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	\N	3.33330
+3.33330	3.33330	1.11110	1.11110
+3.33330	3.33330	3.33330	1.11110
+3.33330	3.33330	3.33330	3.33330
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	1.11110	1.11110
+4.44440	4.44440	4.44440	1.11110
+4.44440	4.44440	4.44440	4.44440
+5.55550	\N	5.55550	5.55550
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	1.11110	1.11110
+5.55550	5.55550	5.55550	1.11110
+5.55550	5.55550	5.55550	5.55550
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	1.11110	1.11110
+6.66660	6.66660	6.66660	1.11110
+6.66660	6.66660	6.66660	6.66660
+7.77770	\N	7.77770	7.77770
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	1.11110	1.11110
+7.77770	7.77770	7.77770	1.11110
+7.77770	7.77770	7.77770	7.77770
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	1.11110	1.11110
+8.88880	8.88880	8.88880	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	\N	9.99990	9.99990
+9.99990	\N	9.99990	9.99990
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	1.11110	1.11110
+9.99990	9.99990	9.99990	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_in_test_decimalv2_common_dup_tbl --
+\N	4.44440	4.44440	4.44440
+4.44440	4.44440	4.44440	4.44440
+5.55550	\N	5.55550	5.55550
+5.55550	5.55550	5.55550	5.55550
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	6.66660	6.66660
+7.77770	\N	7.77770	7.77770
+7.77770	7.77770	7.77770	7.77770
+
+-- !predicate_test_notin_test_decimalv2_common_dup_tbl --
+\N	1.11110	1.11110	1.11110
+\N	8.88880	8.88880	8.88880
+\N	8.88880	8.88880	8.88880
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	\N	2.22220
+2.22220	2.22220	1.11110	1.11110
+2.22220	2.22220	2.22220	1.11110
+2.22220	2.22220	2.22220	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	\N	3.33330
+3.33330	3.33330	1.11110	1.11110
+3.33330	3.33330	3.33330	1.11110
+3.33330	3.33330	3.33330	3.33330
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	1.11110	1.11110
+4.44440	4.44440	4.44440	1.11110
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	1.11110	1.11110
+5.55550	5.55550	5.55550	1.11110
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	1.11110	1.11110
+6.66660	6.66660	6.66660	1.11110
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	1.11110	1.11110
+7.77770	7.77770	7.77770	1.11110
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	1.11110	1.11110
+8.88880	8.88880	8.88880	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	\N	9.99990	9.99990
+9.99990	\N	9.99990	9.99990
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	1.11110	1.11110
+9.99990	9.99990	9.99990	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_bitmap_eq_test_decimalv2_common_uniq_tbl --
+5.55550	\N	5.55550	5.55550
+5.55550	5.55550	5.55550	\N
+
+-- !predicate_test_bitmap_ne_test_decimalv2_common_uniq_tbl --
+\N	1.11110	1.11110	1.11110
+\N	4.44440	4.44440	4.44440
+\N	8.88880	8.88880	8.88880
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	3.33330	\N
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	4.44440	\N
+5.55550	1.11110	1.11110	1.11110
+6.66660	1.11110	1.11110	1.11110
+7.77770	\N	7.77770	7.77770
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	7.77770	\N
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	\N	9.99990	9.99990
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_bitmap_lt_test_decimalv2_common_uniq_tbl --
+\N	1.11110	1.11110	1.11110
+\N	4.44440	4.44440	4.44440
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	3.33330	\N
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	4.44440	\N
+5.55550	1.11110	1.11110	1.11110
+6.66660	1.11110	1.11110	1.11110
+7.77770	1.11110	1.11110	1.11110
+8.88880	1.11110	1.11110	1.11110
+9.99990	1.11110	1.11110	1.11110
+
+-- !predicate_test_bitmap_gt_test_decimalv2_common_uniq_tbl --
+\N	8.88880	8.88880	8.88880
+7.77770	\N	7.77770	7.77770
+7.77770	7.77770	7.77770	\N
+8.88880	8.88880	8.88880	8.88880
+9.99990	\N	9.99990	9.99990
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_eq_test_decimalv2_common_uniq_tbl --
+5.55550	\N	5.55550	5.55550
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	5.55550	\N
+
+-- !predicate_test_ne_test_decimalv2_common_uniq_tbl --
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	\N	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	3.33330	\N
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	4.44440	\N
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	\N	6.66660
+7.77770	\N	7.77770	7.77770
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	7.77770	\N
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	\N	9.99990	9.99990
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_lt_test_decimalv2_common_uniq_tbl --
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	\N	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	3.33330	\N
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	4.44440	\N
+
+-- !predicate_test_gt_test_decimalv2_common_uniq_tbl --
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	\N	6.66660
+7.77770	\N	7.77770	7.77770
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	7.77770	\N
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	\N	9.99990	9.99990
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_null_test_decimalv2_common_uniq_tbl --
+\N	1.11110	1.11110	1.11110
+\N	4.44440	4.44440	4.44440
+\N	8.88880	8.88880	8.88880
+
+-- !predicate_test_notnull_test_decimalv2_common_uniq_tbl --
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	\N	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	3.33330	\N
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	4.44440	\N
+5.55550	\N	5.55550	5.55550
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	5.55550	\N
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	\N	6.66660
+7.77770	\N	7.77770	7.77770
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	7.77770	\N
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	\N	9.99990	9.99990
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_in_test_decimalv2_common_uniq_tbl --
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	4.44440	\N
+5.55550	\N	5.55550	5.55550
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	5.55550	\N
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	\N	6.66660
+7.77770	\N	7.77770	7.77770
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	7.77770	\N
+
+-- !predicate_test_notin_test_decimalv2_common_uniq_tbl --
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	\N	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	3.33330	\N
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	\N	9.99990	9.99990
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_bitmap_eq_test_decimalv2_common_agg_tbl --
+
+-- !predicate_test_bitmap_ne_test_decimalv2_common_agg_tbl --
+\N	1.11110	1.11110	1.11110
+\N	4.44440	4.44440	4.44440
+\N	8.88880	17.77760	8.88880
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	4.44440	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	5.55550	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	11.11100	3.33330
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	14.44430	4.44440
+5.55550	\N	5.55550	5.55550
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	17.77760	5.55550
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	14.44430	6.66660
+7.77770	\N	7.77770	7.77770
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	24.44420	7.77770
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	18.88870	8.88880
+9.99990	\N	19.99980	9.99990
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	21.11090	9.99990
+
+-- !predicate_test_bitmap_lt_test_decimalv2_common_agg_tbl --
+\N	1.11110	1.11110	1.11110
+\N	4.44440	4.44440	4.44440
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	4.44440	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	5.55550	2.22220
+3.33330	1.11110	1.11110	1.11110
+4.44440	1.11110	1.11110	1.11110
+5.55550	\N	5.55550	5.55550
+5.55550	1.11110	1.11110	1.11110
+6.66660	1.11110	1.11110	1.11110
+7.77770	1.11110	1.11110	1.11110
+8.88880	1.11110	1.11110	1.11110
+9.99990	1.11110	1.11110	1.11110
+
+-- !predicate_test_bitmap_gt_test_decimalv2_common_agg_tbl --
+\N	8.88880	17.77760	8.88880
+3.33330	3.33330	11.11100	3.33330
+4.44440	4.44440	14.44430	4.44440
+5.55550	5.55550	17.77760	5.55550
+6.66660	6.66660	14.44430	6.66660
+7.77770	\N	7.77770	7.77770
+7.77770	7.77770	24.44420	7.77770
+8.88880	8.88880	18.88870	8.88880
+9.99990	\N	19.99980	9.99990
+9.99990	9.99990	21.11090	9.99990
+
+-- !predicate_test_eq_test_decimalv2_common_agg_tbl --
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	14.44430	6.66660
+
+-- !predicate_test_ne_test_decimalv2_common_agg_tbl --
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	4.44440	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	5.55550	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	11.11100	3.33330
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	14.44430	4.44440
+5.55550	\N	5.55550	5.55550
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	17.77760	5.55550
+7.77770	\N	7.77770	7.77770
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	24.44420	7.77770
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	18.88870	8.88880
+9.99990	\N	19.99980	9.99990
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	21.11090	9.99990
+
+-- !predicate_test_lt_test_decimalv2_common_agg_tbl --
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	4.44440	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	5.55550	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	11.11100	3.33330
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	14.44430	4.44440
+5.55550	\N	5.55550	5.55550
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	17.77760	5.55550
+
+-- !predicate_test_gt_test_decimalv2_common_agg_tbl --
+7.77770	\N	7.77770	7.77770
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	24.44420	7.77770
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	18.88870	8.88880
+9.99990	\N	19.99980	9.99990
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	21.11090	9.99990
+
+-- !predicate_test_null_test_decimalv2_common_agg_tbl --
+\N	1.11110	1.11110	1.11110
+\N	4.44440	4.44440	4.44440
+\N	8.88880	17.77760	8.88880
+
+-- !predicate_test_notnull_test_decimalv2_common_agg_tbl --
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	4.44440	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	5.55550	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	11.11100	3.33330
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	14.44430	4.44440
+5.55550	\N	5.55550	5.55550
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	17.77760	5.55550
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	14.44430	6.66660
+7.77770	\N	7.77770	7.77770
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	24.44420	7.77770
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	18.88870	8.88880
+9.99990	\N	19.99980	9.99990
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	21.11090	9.99990
+
+-- !predicate_test_in_test_decimalv2_common_agg_tbl --
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	14.44430	4.44440
+5.55550	\N	5.55550	5.55550
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	17.77760	5.55550
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	14.44430	6.66660
+7.77770	\N	7.77770	7.77770
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	24.44420	7.77770
+
+-- !predicate_test_notin_test_decimalv2_common_agg_tbl --
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	4.44440	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	5.55550	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	11.11100	3.33330
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	18.88870	8.88880
+9.99990	\N	19.99980	9.99990
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	21.11090	9.99990
+
+-- !predicate_test_bitmap_eq_test_decimalv2_common_dist_tbl --
+7.77770	\N	7.77770	7.77770
+7.77770	7.77770	7.77770	\N
+7.77770	7.77770	7.77770	1.11110
+7.77770	7.77770	7.77770	7.77770
+
+-- !predicate_test_bitmap_ne_test_decimalv2_common_dist_tbl --
+\N	1.11110	1.11110	1.11110
+\N	4.44440	4.44440	4.44440
+\N	8.88880	8.88880	8.88880
+\N	8.88880	8.88880	8.88880
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	1.11110	1.11110
+2.22220	2.22220	2.22220	1.11110
+2.22220	2.22220	2.22220	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	1.11110	1.11110
+3.33330	3.33330	3.33330	\N
+3.33330	3.33330	3.33330	1.11110
+3.33330	3.33330	3.33330	3.33330
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	1.11110	1.11110
+4.44440	4.44440	4.44440	\N
+4.44440	4.44440	4.44440	1.11110
+4.44440	4.44440	4.44440	4.44440
+5.55550	\N	5.55550	5.55550
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	1.11110	1.11110
+5.55550	5.55550	5.55550	\N
+5.55550	5.55550	5.55550	1.11110
+5.55550	5.55550	5.55550	5.55550
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	1.11110	1.11110
+6.66660	6.66660	6.66660	1.11110
+6.66660	6.66660	6.66660	6.66660
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	1.11110	1.11110
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	1.11110	1.11110
+8.88880	8.88880	8.88880	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	\N	9.99990	9.99990
+9.99990	\N	9.99990	9.99990
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	1.11110	1.11110
+9.99990	9.99990	9.99990	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_bitmap_lt_test_decimalv2_common_dist_tbl --
+\N	1.11110	1.11110	1.11110
+\N	4.44440	4.44440	4.44440
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	1.11110	1.11110
+2.22220	2.22220	2.22220	1.11110
+2.22220	2.22220	2.22220	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	1.11110	1.11110
+3.33330	3.33330	3.33330	\N
+3.33330	3.33330	3.33330	1.11110
+3.33330	3.33330	3.33330	3.33330
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	1.11110	1.11110
+4.44440	4.44440	4.44440	\N
+4.44440	4.44440	4.44440	1.11110
+4.44440	4.44440	4.44440	4.44440
+5.55550	\N	5.55550	5.55550
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	1.11110	1.11110
+5.55550	5.55550	5.55550	\N
+5.55550	5.55550	5.55550	1.11110
+5.55550	5.55550	5.55550	5.55550
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	1.11110	1.11110
+6.66660	6.66660	6.66660	1.11110
+6.66660	6.66660	6.66660	6.66660
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	1.11110	1.11110
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	1.11110	1.11110
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	1.11110	1.11110
+
+-- !predicate_test_bitmap_gt_test_decimalv2_common_dist_tbl --
+\N	8.88880	8.88880	8.88880
+\N	8.88880	8.88880	8.88880
+8.88880	8.88880	8.88880	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	\N	9.99990	9.99990
+9.99990	\N	9.99990	9.99990
+9.99990	9.99990	9.99990	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_eq_test_decimalv2_common_dist_tbl --
+7.77770	\N	7.77770	7.77770
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	1.11110	1.11110
+7.77770	7.77770	7.77770	\N
+7.77770	7.77770	7.77770	1.11110
+7.77770	7.77770	7.77770	7.77770
+
+-- !predicate_test_ne_test_decimalv2_common_dist_tbl --
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	\N	2.22220
+2.22220	2.22220	1.11110	1.11110
+2.22220	2.22220	2.22220	1.11110
+2.22220	2.22220	2.22220	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	\N	3.33330
+3.33330	3.33330	1.11110	1.11110
+3.33330	3.33330	3.33330	\N
+3.33330	3.33330	3.33330	1.11110
+3.33330	3.33330	3.33330	3.33330
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	1.11110	1.11110
+4.44440	4.44440	4.44440	\N
+4.44440	4.44440	4.44440	1.11110
+4.44440	4.44440	4.44440	4.44440
+5.55550	\N	5.55550	5.55550
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	1.11110	1.11110
+5.55550	5.55550	5.55550	\N
+5.55550	5.55550	5.55550	1.11110
+5.55550	5.55550	5.55550	5.55550
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	1.11110	1.11110
+6.66660	6.66660	6.66660	1.11110
+6.66660	6.66660	6.66660	6.66660
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	1.11110	1.11110
+8.88880	8.88880	8.88880	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	\N	9.99990	9.99990
+9.99990	\N	9.99990	9.99990
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	1.11110	1.11110
+9.99990	9.99990	9.99990	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_lt_test_decimalv2_common_dist_tbl --
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	\N	2.22220
+2.22220	2.22220	1.11110	1.11110
+2.22220	2.22220	2.22220	1.11110
+2.22220	2.22220	2.22220	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	\N	3.33330
+3.33330	3.33330	1.11110	1.11110
+3.33330	3.33330	3.33330	\N
+3.33330	3.33330	3.33330	1.11110
+3.33330	3.33330	3.33330	3.33330
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	1.11110	1.11110
+4.44440	4.44440	4.44440	\N
+4.44440	4.44440	4.44440	1.11110
+4.44440	4.44440	4.44440	4.44440
+5.55550	\N	5.55550	5.55550
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	1.11110	1.11110
+5.55550	5.55550	5.55550	\N
+5.55550	5.55550	5.55550	1.11110
+5.55550	5.55550	5.55550	5.55550
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	1.11110	1.11110
+6.66660	6.66660	6.66660	1.11110
+6.66660	6.66660	6.66660	6.66660
+
+-- !predicate_test_gt_test_decimalv2_common_dist_tbl --
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	1.11110	1.11110
+8.88880	8.88880	8.88880	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	\N	9.99990	9.99990
+9.99990	\N	9.99990	9.99990
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	1.11110	1.11110
+9.99990	9.99990	9.99990	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_null_test_decimalv2_common_dist_tbl --
+\N	1.11110	1.11110	1.11110
+\N	4.44440	4.44440	4.44440
+\N	8.88880	8.88880	8.88880
+\N	8.88880	8.88880	8.88880
+
+-- !predicate_test_notnull_test_decimalv2_common_dist_tbl --
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	\N	2.22220
+2.22220	2.22220	1.11110	1.11110
+2.22220	2.22220	2.22220	1.11110
+2.22220	2.22220	2.22220	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	\N	3.33330
+3.33330	3.33330	1.11110	1.11110
+3.33330	3.33330	3.33330	\N
+3.33330	3.33330	3.33330	1.11110
+3.33330	3.33330	3.33330	3.33330
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	1.11110	1.11110
+4.44440	4.44440	4.44440	\N
+4.44440	4.44440	4.44440	1.11110
+4.44440	4.44440	4.44440	4.44440
+5.55550	\N	5.55550	5.55550
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	1.11110	1.11110
+5.55550	5.55550	5.55550	\N
+5.55550	5.55550	5.55550	1.11110
+5.55550	5.55550	5.55550	5.55550
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	1.11110	1.11110
+6.66660	6.66660	6.66660	1.11110
+6.66660	6.66660	6.66660	6.66660
+7.77770	\N	7.77770	7.77770
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	1.11110	1.11110
+7.77770	7.77770	7.77770	\N
+7.77770	7.77770	7.77770	1.11110
+7.77770	7.77770	7.77770	7.77770
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	1.11110	1.11110
+8.88880	8.88880	8.88880	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	\N	9.99990	9.99990
+9.99990	\N	9.99990	9.99990
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	1.11110	1.11110
+9.99990	9.99990	9.99990	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !predicate_test_in_test_decimalv2_common_dist_tbl --
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	1.11110	1.11110
+4.44440	4.44440	4.44440	\N
+4.44440	4.44440	4.44440	1.11110
+4.44440	4.44440	4.44440	4.44440
+5.55550	\N	5.55550	5.55550
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	1.11110	1.11110
+5.55550	5.55550	5.55550	\N
+5.55550	5.55550	5.55550	1.11110
+5.55550	5.55550	5.55550	5.55550
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	1.11110	1.11110
+6.66660	6.66660	6.66660	1.11110
+6.66660	6.66660	6.66660	6.66660
+7.77770	\N	7.77770	7.77770
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	1.11110	1.11110
+7.77770	7.77770	7.77770	\N
+7.77770	7.77770	7.77770	1.11110
+7.77770	7.77770	7.77770	7.77770
+
+-- !predicate_test_notin_test_decimalv2_common_dist_tbl --
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	\N	2.22220
+2.22220	2.22220	1.11110	1.11110
+2.22220	2.22220	2.22220	1.11110
+2.22220	2.22220	2.22220	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	\N	3.33330
+3.33330	3.33330	1.11110	1.11110
+3.33330	3.33330	3.33330	\N
+3.33330	3.33330	3.33330	1.11110
+3.33330	3.33330	3.33330	3.33330
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	1.11110	1.11110
+8.88880	8.88880	8.88880	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	\N	9.99990	9.99990
+9.99990	\N	9.99990	9.99990
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	1.11110	1.11110
+9.99990	9.99990	9.99990	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !after_del_test_decimalv2_common_dup_tbl --
+\N	8.88880	8.88880	8.88880
+\N	8.88880	8.88880	8.88880
+2.22220	2.22220	\N	2.22220
+3.33330	3.33330	\N	3.33330
+5.55550	\N	5.55550	5.55550
+5.55550	5.55550	5.55550	\N
+5.55550	5.55550	5.55550	1.11110
+5.55550	5.55550	5.55550	5.55550
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	6.66660	1.11110
+6.66660	6.66660	6.66660	6.66660
+7.77770	\N	7.77770	7.77770
+7.77770	7.77770	7.77770	\N
+7.77770	7.77770	7.77770	1.11110
+7.77770	7.77770	7.77770	7.77770
+8.88880	8.88880	8.88880	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	\N	9.99990	9.99990
+9.99990	\N	9.99990	9.99990
+9.99990	9.99990	9.99990	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !after_del_test_decimalv2_common_uniq_tbl --
+\N	1.11110	1.11110	1.11110
+\N	4.44440	4.44440	4.44440
+\N	8.88880	8.88880	8.88880
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	\N	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	3.33330	\N
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	4.44440	\N
+5.55550	\N	5.55550	5.55550
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	5.55550	\N
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	\N	6.66660
+7.77770	\N	7.77770	7.77770
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	7.77770	\N
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	8.88880	8.88880
+9.99990	\N	9.99990	9.99990
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	9.99990	9.99990
+
+-- !after_del_test_decimalv2_common_dist_tbl --
+\N	1.11110	1.11110	1.11110
+\N	4.44440	4.44440	4.44440
+1.11110	\N	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+1.11110	1.11110	1.11110	1.11110
+2.22220	\N	2.22220	2.22220
+2.22220	1.11110	1.11110	1.11110
+2.22220	2.22220	\N	2.22220
+2.22220	2.22220	1.11110	1.11110
+2.22220	2.22220	2.22220	1.11110
+2.22220	2.22220	2.22220	2.22220
+3.33330	1.11110	1.11110	1.11110
+3.33330	3.33330	\N	3.33330
+3.33330	3.33330	1.11110	1.11110
+3.33330	3.33330	3.33330	\N
+3.33330	3.33330	3.33330	1.11110
+3.33330	3.33330	3.33330	3.33330
+4.44440	1.11110	1.11110	1.11110
+4.44440	4.44440	1.11110	1.11110
+4.44440	4.44440	4.44440	\N
+4.44440	4.44440	4.44440	1.11110
+4.44440	4.44440	4.44440	4.44440
+5.55550	\N	5.55550	5.55550
+5.55550	1.11110	1.11110	1.11110
+5.55550	5.55550	1.11110	1.11110
+5.55550	5.55550	5.55550	\N
+5.55550	5.55550	5.55550	1.11110
+5.55550	5.55550	5.55550	5.55550
+6.66660	1.11110	1.11110	1.11110
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	\N	6.66660
+6.66660	6.66660	1.11110	1.11110
+6.66660	6.66660	6.66660	1.11110
+6.66660	6.66660	6.66660	6.66660
+7.77770	\N	7.77770	7.77770
+7.77770	1.11110	1.11110	1.11110
+7.77770	7.77770	1.11110	1.11110
+7.77770	7.77770	7.77770	\N
+7.77770	7.77770	7.77770	1.11110
+7.77770	7.77770	7.77770	7.77770
+8.88880	1.11110	1.11110	1.11110
+8.88880	8.88880	1.11110	1.11110
+9.99990	\N	9.99990	9.99990
+9.99990	\N	9.99990	9.99990
+9.99990	1.11110	1.11110	1.11110
+9.99990	9.99990	1.11110	1.11110
+9.99990	9.99990	9.99990	1.11110
+9.99990	9.99990	9.99990	9.99990
+
diff --git a/regression-test/data/datatype_p0/decimalv2/test_decimalv2_load.out b/regression-test/data/datatype_p0/decimalv2/test_decimalv2_load.out
new file mode 100644
index 00000000000..8156a9144aa
--- /dev/null
+++ b/regression-test/data/datatype_p0/decimalv2/test_decimalv2_load.out
@@ -0,0 +1,17 @@
+-- This file is automatically generated. You should know what you did if you want to edit this
+-- !query1 --
+1.99900
+2.88800
+3.66600
+7.88800
+11.99990
+837.43444
+
+-- !query2 --
+1.99900
+2.88800
+3.66600
+7.88800
+11.99990
+837.43444
+
diff --git a/regression-test/data/datatype_p0/decimalv2/test_decimalv2_overflow.out b/regression-test/data/datatype_p0/decimalv2/test_decimalv2_overflow.out
new file mode 100644
index 00000000000..02f0d00fb21
--- /dev/null
+++ b/regression-test/data/datatype_p0/decimalv2/test_decimalv2_overflow.out
@@ -0,0 +1,90 @@
+-- This file is automatically generated. You should know what you did if you want to edit this
+-- !sql1 --
+-214151953057016418.148439877
+
+-- !decimalv2_calc_overflow --
+123456789000.123456	12345678.12345678	1524157779151043787.117829481
+999999999999.999999	99999999.99999999	7766279631452231820.000000001
+
+-- !union1 --
+9.900000000
+9999999.999999999
+99999999999999999.999999999
+
+-- !union2 --
+9.900000000
+9999999.999999999
+99999999999999999.999999999
+
+-- !intersect1 --
+9.900000000
+
+-- !intersect2 --
+9.900000000
+
+-- !except1 --
+99999999999999999.999999999
+
+-- !except2 --
+9999999.999999999
+
+-- !add_overflow1 --
+999999999999999999.999999999
+
+-- !add_overflow2 --
+999999999999999999.999999998	1E-9	999999999999999999.999999999
+
+-- !add_overflow3 --
+1E-9	999999999999999999.999999998	999999999999999999.999999999
+
+-- !add_overflow3 --
+999999999999999999.999999998	1E-9	999999999999999999.999999999
+
+-- !sub_overflow1 --
+-999999999999999999.999999999
+
+-- !sub_overflow2 --
+-999999999999999999.999999998	1E-9	-999999999999999999.999999999
+
+-- !sub_overflow3 --
+1E-9	-999999999999999999.999999998	999999999999999999.999999999
+
+-- !sub_overflow3 --
+-999999999999999999.999999998	1E-9	-999999999999999999.999999999
+
+-- !multi_overflow1 --
+999999999999999999.999999999
+
+-- !multi_overflow2 --
+999999999999999999.999999999	999999999999999999.999999999
+
+-- !multi_overflow3 --
+999999999999999999.999999999	999999999999999999.999999999
+
+-- !multi_overflow4 --
+999999999999999999.999999999	1.000000000	999999999999999999.999999999
+
+-- !div_overflow1 --
+99999999999999999.999999999	0.100000000	999999999999999999.999999990
+
+-- !div_overflow2 --
+999999999999999999.999999990
+
+-- !div_overflow3 --
+99999999999999999.999999999	0.1	999999999999999999.999999990
+
+-- !div_overflow4 --
+999999999999999999.999999990
+
+-- !mod1 --
+99999999999999999.999999999	0.100000000	0.099999999
+
+-- !mod2 --
+0.099999999
+
+-- !mod3 --
+99999999999999999.999999999	0.1	0.099999999
+
+-- !mod4 --
+0.099999999
+
diff --git a/regression-test/data/datatype_p0/decimalv2/test_decimalv2_overflow2.out b/regression-test/data/datatype_p0/decimalv2/test_decimalv2_overflow2.out
new file mode 100644
index 00000000000..ecce20f1b22
--- /dev/null
+++ b/regression-test/data/datatype_p0/decimalv2/test_decimalv2_overflow2.out
@@ -0,0 +1,61 @@
+-- This file is automatically generated. You should know what you did if you want to edit this
+-- !add_overflow1 --
+999999999999999999.999999999
+
+-- !add_overflow2 --
+999999999999999999.999999998	1E-9	999999999999999999.999999999
+
+-- !add_overflow3 --
+1E-9	999999999999999999.999999998	999999999999999999.999999999
+
+-- !add_overflow3 --
+999999999999999999.999999998	1E-9	999999999999999999.999999999
+
+-- !sub_overflow1 --
+-999999999999999999.999999999
+
+-- !sub_overflow2 --
+-999999999999999999.999999998	1E-9	-999999999999999999.999999999
+
+-- !sub_overflow3 --
+1E-9	-999999999999999999.999999998	999999999999999999.999999999
+
+-- !sub_overflow3 --
+-999999999999999999.999999998	1E-9	-999999999999999999.999999999
+
+-- !multi_overflow1 --
+999999999999999999.999999999
+
+-- !multi_overflow2 --
+999999999999999999.999999999	999999999999999999.999999999000000000
+
+-- !multi_overflow3 --
+999999999999999999.999999999	999999999999999999.999999999000000000
+
+-- !multi_overflow4 --
+999999999999999999.999999999	1.000000000	999999999999999999.999999999
+
+-- !div_overflow1 --
+99999999999999999.999999999	0.100000000	999999999999999999.999999990
+
+-- !div_overflow2 --
+999999999999999999.999999990
+
+-- !div_overflow3 --
+99999999999999999.999999999	0.1	999999999999999999.9999999900000
+
+-- !div_overflow4 --
+999999999999999999.999999990
+
+-- !mod1 --
+99999999999999999.999999999	0.100000000	0.099999999
+
+-- !mod2 --
+0.099999999
+
+-- !mod3 --
+99999999999999999.999999999	0.1	0.099999999
+
+-- !mod4 --
+0.099999999
+
diff --git a/regression-test/data/datatype_p0/decimalv3/test_decimalv3_overflow.out b/regression-test/data/datatype_p0/decimalv3/test_decimalv3_overflow.out
index 8f0c6d92bc1..ddcadbfbf2e 100644
--- a/regression-test/data/datatype_p0/decimalv3/test_decimalv3_overflow.out
+++ b/regression-test/data/datatype_p0/decimalv3/test_decimalv3_overflow.out
@@ -1,4 +1,7 @@
 -- This file is automatically generated. You should know what you did if you want to edit this
+-- !sql1 --
+7379840948334924036536518953815.011655
+
 -- !decimal32_overflow1 --
 1	1234567.8	1234567.8
 9	9999999.9	89999999.1
diff --git a/regression-test/suites/datatype_p0/decimalv2/test_data/test.csv b/regression-test/suites/datatype_p0/decimalv2/test_data/test.csv
new file mode 100644
index 00000000000..4f1b10b5fbf
--- /dev/null
+++ b/regression-test/suites/datatype_p0/decimalv2/test_data/test.csv
@@ -0,0 +1,6 @@
+1.999
+2.888
+3.666
+7.888
+11.9999
+837.43444
\ No newline at end of file
diff --git a/regression-test/suites/datatype_p0/decimalv2/test_decimalv2_calc.groovy b/regression-test/suites/datatype_p0/decimalv2/test_decimalv2_calc.groovy
new file mode 100644
index 00000000000..e2439c6229d
--- /dev/null
+++ b/regression-test/suites/datatype_p0/decimalv2/test_decimalv2_calc.groovy
@@ -0,0 +1,201 @@
+// 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.
+
+suite("test_decimalv2_calc", "nonConcurrent") {
+
+    sql """
+        admin set frontend config("enable_decimal_conversion" = "false");
+    """
+    sql "set check_overflow_for_decimal=false;"
+
+    def table1 = "test_decimalv2_calc_tbl"
+
+    sql "drop table if exists ${table1}"
+
+    sql """
+    CREATE TABLE IF NOT EXISTS `${table1}` (
+        `decimal_key1` decimalv2(8, 5) NULL COMMENT "",
+        `decimal_key2` decimalv2(16, 5) NULL COMMENT "",
+        `decimal_value1` decimalv2(8, 5) NULL COMMENT "",
+        `decimal_value2` decimalv2(16, 5) NULL COMMENT "",
+      ) ENGINE=OLAP
+      DUPLICATE KEY(`decimal_key1`, `decimal_key2`)
+      COMMENT "OLAP"
+      DISTRIBUTED BY HASH(`decimal_key1`, `decimal_key2`) BUCKETS 4
+      PROPERTIES (
+      "replication_allocation" = "tag.location.default: 1",
+      "in_memory" = "false",
+      "storage_format" = "V2"
+    )
+    """
+
+    sql """insert into ${table1} values
+            (1.1,   1.4,    1.5,    1.6),
+            (1.1,   1.2,    1.56,   1.234),
+            (1.2,   1.2,    1.66,   1.534654),
+            (1.2,   1.2,    1.344,  1.32432),
+            (1.3,   1.2,    1.456,  1.345435),
+            (2.1,   1.2,    1.3,    1.234),
+            (2.1,   1.2,    1.3,    1.2342),
+            (2.2,   1.4,    1.21,   1.123),
+            (NULL,  NULL,   NULL,   NULL)
+    """
+    qt_select_all "select * from ${table1} order by 1, 2, 3, 4"
+
+    qt_select_calc1 """
+        select
+            decimal_key1, decimal_key1
+            , decimal_key1 + decimal_key1 v1
+            , decimal_key1 - decimal_key1 v2
+            , decimal_key1 * decimal_key1 v3
+            , decimal_key1 / decimal_key1 v4
+        from ${table1} order by 1, 2, 3, 4, 5;
+    """
+
+    qt_select_calc2 """
+        select
+            decimal_key1
+            , decimal_key2
+            , decimal_key1 + decimal_key2 v1
+            , decimal_key1 - decimal_key2 v2
+            , decimal_key1 * decimal_key2 v3
+            , decimal_key1 / decimal_key2 v4
+            , decimal_key2 + decimal_key1 v5
+            , decimal_key2 - decimal_key1 v6
+            , decimal_key2 * decimal_key1 v7
+            , decimal_key2 / decimal_key1 v8
+        from ${table1} order by 1, 2, 3, 4, 5, 6, 7, 8, 9, 10;
+    """
+
+    qt_select_calc3 """
+        select
+            decimal_key1
+            , decimal_value1
+            , decimal_key1 + decimal_value1 v1
+            , decimal_key1 - decimal_value1 v2
+            , decimal_key1 * decimal_value1 v3
+            , decimal_key1 / decimal_value1 v4
+            , decimal_value1 + decimal_key1 v5
+            , decimal_value1 - decimal_key1 v6
+            , decimal_value1 * decimal_key1 v7
+            , decimal_value1 / decimal_key1 v8
+        from ${table1} order by 1, 2, 3, 4, 5, 6, 7, 8, 9, 10;
+    """
+
+    qt_select_calc4 """
+        select
+            decimal_key1
+            , decimal_value2
+            , decimal_key1 + decimal_value2 v1
+            , decimal_key1 - decimal_value2 v2
+            , decimal_key1 * decimal_value2 v3
+            , decimal_key1 / decimal_value2 v4
+            , decimal_value2 + decimal_key1 v5
+            , decimal_value2 - decimal_key1 v6
+            , decimal_value2 * decimal_key1 v7
+            , decimal_value2 / decimal_key1 v8
+        from ${table1} order by 1, 2, 3, 4, 5, 6, 7, 8, 9, 10;
+    """
+
+    qt_select_calc5 """
+        select
+            decimal_key2
+            , decimal_key2 + decimal_key2 v1
+            , decimal_key2 - decimal_key2 v2
+            , decimal_key2 * decimal_key2 v3
+            , decimal_key2 / decimal_key2 v4
+        from ${table1} order by 1, 2, 3, 4, 5;
+    """
+
+    qt_select_calc6 """
+        select
+            decimal_key2
+            , decimal_value1
+            , decimal_key2 + decimal_value1 v1
+            , decimal_key2 - decimal_value1 v2
+            , decimal_key2 * decimal_value1 v3
+            , decimal_key2 / decimal_value2 v4
+            , decimal_value1 + decimal_key2 v5
+            , decimal_value1 - decimal_key2 v6
+            , decimal_value1 * decimal_key2 v7
+            , decimal_value1 / decimal_key2 v8
+        from ${table1} order by 1, 2, 3, 4, 5, 6, 7, 8, 9, 10;
+    """
+
+    qt_select_calc7 """
+        select
+            decimal_key2
+            , decimal_value2
+            , decimal_key2 + decimal_value2 v1
+            , decimal_key2 - decimal_value2 v2
+            , decimal_key2 * decimal_value2 v3
+            , decimal_key2 / decimal_value2 v4
+            , decimal_value2 + decimal_key2 v5
+            , decimal_value2 - decimal_key2 v6
+            , decimal_value2 * decimal_key2 v7
+            , decimal_value2 / decimal_key2 v8
+        from ${table1} order by 1, 2, 3, 4, 5, 6, 7, 8, 9, 10;
+    """
+
+    qt_select_calc8 """
+        select
+            decimal_value1
+            , decimal_value1 + decimal_value1 v1
+            , decimal_value1 - decimal_value1 v2
+            , decimal_value1 * decimal_value1 v3
+            , decimal_value1 / decimal_value1 v4
+        from ${table1} order by 1, 2, 3, 4, 5;
+    """
+
+    qt_select_calc9 """
+        select
+            decimal_value1
+            , decimal_value2
+            , decimal_value1 + decimal_value2 v1
+            , decimal_value1 - decimal_value2 v2
+            , decimal_value1 * decimal_value2 v3
+            , decimal_value1 / decimal_value2 v4
+            , decimal_value2 + decimal_value1 v5
+            , decimal_value2 - decimal_value1 v6
+            , decimal_value2 * decimal_value1 v7
+            , decimal_value2 / decimal_value1 v8
+        from ${table1} order by 1, 2, 3, 4, 5, 6, 7, 8, 9, 10;
+    """
+
+    qt_select_calc10 """
+        select
+            decimal_value2
+            , decimal_value2 + decimal_value2 v1
+            , decimal_value2 - decimal_value2 v2
+            , decimal_value2 * decimal_value2 v3
+            , decimal_value2 / decimal_value2 v4
+        from ${table1} order by 1, 2, 3, 4, 5;
+    """
+
+    qt_calc_overflow """
+        select
+            decimal_value1
+            , decimal_value2
+            , decimal_value1 * 999.99999 v1
+            , decimal_value2 * 0.9999999 v1
+        from ${table1} order by 1, 2, 3, 4;
+    """
+
+    sql """
+        admin set frontend config("enable_decimal_conversion" = "true");
+    """
+}
diff --git a/regression-test/suites/datatype_p0/decimalv2/test_decimalv2_calc_with_conversion.groovy b/regression-test/suites/datatype_p0/decimalv2/test_decimalv2_calc_with_conversion.groovy
new file mode 100644
index 00000000000..f500c195b26
--- /dev/null
+++ b/regression-test/suites/datatype_p0/decimalv2/test_decimalv2_calc_with_conversion.groovy
@@ -0,0 +1,197 @@
+// 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.
+
+suite("test_decimalv2_calc_with_conversion", "nonConcurrent") {
+
+    sql """
+        admin set frontend config("enable_decimal_conversion" = "true");
+    """
+    sql "set check_overflow_for_decimal=false;"
+
+    def table1 = "test_decimalv2_calc_tbl"
+
+    sql "drop table if exists ${table1}"
+
+    sql """
+    CREATE TABLE IF NOT EXISTS `${table1}` (
+        `decimal_key1` decimalv2(8, 5) NULL COMMENT "",
+        `decimal_key2` decimalv2(16, 5) NULL COMMENT "",
+        `decimal_value1` decimalv2(8, 5) NULL COMMENT "",
+        `decimal_value2` decimalv2(16, 5) NULL COMMENT "",
+      ) ENGINE=OLAP
+      DUPLICATE KEY(`decimal_key1`, `decimal_key2`)
+      COMMENT "OLAP"
+      DISTRIBUTED BY HASH(`decimal_key1`, `decimal_key2`) BUCKETS 4
+      PROPERTIES (
+      "replication_allocation" = "tag.location.default: 1",
+      "in_memory" = "false",
+      "storage_format" = "V2"
+    )
+    """
+
+    sql """insert into ${table1} values
+            (1.1,   1.4,    1.5,    1.6),
+            (1.1,   1.2,    1.56,   1.234),
+            (1.2,   1.2,    1.66,   1.534654),
+            (1.2,   1.2,    1.344,  1.32432),
+            (1.3,   1.2,    1.456,  1.345435),
+            (2.1,   1.2,    1.3,    1.234),
+            (2.1,   1.2,    1.3,    1.2342),
+            (2.2,   1.4,    1.21,   1.123),
+            (NULL,  NULL,   NULL,   NULL)
+    """
+    qt_select_all "select * from ${table1} order by 1, 2, 3, 4"
+
+    qt_select_calc1 """
+        select
+            decimal_key1, decimal_key1
+            , decimal_key1 + decimal_key1 v1
+            , decimal_key1 - decimal_key1 v2
+            , decimal_key1 * decimal_key1 v3
+            , decimal_key1 / decimal_key1 v4
+        from ${table1} order by 1, 2, 3, 4, 5;
+    """
+
+    qt_select_calc2 """
+        select
+            decimal_key1
+            , decimal_key2
+            , decimal_key1 + decimal_key2 v1
+            , decimal_key1 - decimal_key2 v2
+            , decimal_key1 * decimal_key2 v3
+            , decimal_key1 / decimal_key2 v4
+            , decimal_key2 + decimal_key1 v5
+            , decimal_key2 - decimal_key1 v6
+            , decimal_key2 * decimal_key1 v7
+            , decimal_key2 / decimal_key1 v8
+        from ${table1} order by 1, 2, 3, 4, 5, 6, 7, 8, 9, 10;
+    """
+
+    qt_select_calc3 """
+        select
+            decimal_key1
+            , decimal_value1
+            , decimal_key1 + decimal_value1 v1
+            , decimal_key1 - decimal_value1 v2
+            , decimal_key1 * decimal_value1 v3
+            , decimal_key1 / decimal_value1 v4
+            , decimal_value1 + decimal_key1 v5
+            , decimal_value1 - decimal_key1 v6
+            , decimal_value1 * decimal_key1 v7
+            , decimal_value1 / decimal_key1 v8
+        from ${table1} order by 1, 2, 3, 4, 5, 6, 7, 8, 9, 10;
+    """
+
+    qt_select_calc4 """
+        select
+            decimal_key1
+            , decimal_value2
+            , decimal_key1 + decimal_value2 v1
+            , decimal_key1 - decimal_value2 v2
+            , decimal_key1 * decimal_value2 v3
+            , decimal_key1 / decimal_value2 v4
+            , decimal_value2 + decimal_key1 v5
+            , decimal_value2 - decimal_key1 v6
+            , decimal_value2 * decimal_key1 v7
+            , decimal_value2 / decimal_key1 v8
+        from ${table1} order by 1, 2, 3, 4, 5, 6, 7, 8, 9, 10;
+    """
+
+    qt_select_calc5 """
+        select
+            decimal_key2
+            , decimal_key2 + decimal_key2 v1
+            , decimal_key2 - decimal_key2 v2
+            , decimal_key2 * decimal_key2 v3
+            , decimal_key2 / decimal_key2 v4
+        from ${table1} order by 1, 2, 3, 4, 5;
+    """
+
+    qt_select_calc6 """
+        select
+            decimal_key2
+            , decimal_value1
+            , decimal_key2 + decimal_value1 v1
+            , decimal_key2 - decimal_value1 v2
+            , decimal_key2 * decimal_value1 v3
+            , decimal_key2 / decimal_value2 v4
+            , decimal_value1 + decimal_key2 v5
+            , decimal_value1 - decimal_key2 v6
+            , decimal_value1 * decimal_key2 v7
+            , decimal_value1 / decimal_key2 v8
+        from ${table1} order by 1, 2, 3, 4, 5, 6, 7, 8, 9, 10;
+    """
+
+    qt_select_calc7 """
+        select
+            decimal_key2
+            , decimal_value2
+            , decimal_key2 + decimal_value2 v1
+            , decimal_key2 - decimal_value2 v2
+            , decimal_key2 * decimal_value2 v3
+            , decimal_key2 / decimal_value2 v4
+            , decimal_value2 + decimal_key2 v5
+            , decimal_value2 - decimal_key2 v6
+            , decimal_value2 * decimal_key2 v7
+            , decimal_value2 / decimal_key2 v8
+        from ${table1} order by 1, 2, 3, 4, 5, 6, 7, 8, 9, 10;
+    """
+
+    qt_select_calc8 """
+        select
+            decimal_value1
+            , decimal_value1 + decimal_value1 v1
+            , decimal_value1 - decimal_value1 v2
+            , decimal_value1 * decimal_value1 v3
+            , decimal_value1 / decimal_value1 v4
+        from ${table1} order by 1, 2, 3, 4, 5;
+    """
+
+    qt_select_calc9 """
+        select
+            decimal_value1
+            , decimal_value2
+            , decimal_value1 + decimal_value2 v1
+            , decimal_value1 - decimal_value2 v2
+            , decimal_value1 * decimal_value2 v3
+            , decimal_value1 / decimal_value2 v4
+            , decimal_value2 + decimal_value1 v5
+            , decimal_value2 - decimal_value1 v6
+            , decimal_value2 * decimal_value1 v7
+            , decimal_value2 / decimal_value1 v8
+        from ${table1} order by 1, 2, 3, 4, 5, 6, 7, 8, 9, 10;
+    """
+
+    qt_select_calc10 """
+        select
+            decimal_value2
+            , decimal_value2 + decimal_value2 v1
+            , decimal_value2 - decimal_value2 v2
+            , decimal_value2 * decimal_value2 v3
+            , decimal_value2 / decimal_value2 v4
+        from ${table1} order by 1, 2, 3, 4, 5;
+    """
+
+    qt_calc_overflow """
+        select
+            decimal_value1
+            , decimal_value2
+            , decimal_value1 * 999.99999 v1
+            , decimal_value2 * 0.9999999 v1
+        from ${table1} order by 1, 2, 3, 4;
+    """
+}
diff --git a/regression-test/suites/datatype_p0/decimalv2/test_decimalv2_common.groovy b/regression-test/suites/datatype_p0/decimalv2/test_decimalv2_common.groovy
new file mode 100644
index 00000000000..64ad8ba8f08
--- /dev/null
+++ b/regression-test/suites/datatype_p0/decimalv2/test_decimalv2_common.groovy
@@ -0,0 +1,412 @@
+// 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.
+
+suite("test_decimalv2_common", "nonConcurrent") {
+
+    sql """
+        admin set frontend config("enable_decimal_conversion" = "false");
+    """
+    sql "set check_overflow_for_decimal=false;"
+
+    def table_normal = "test_decimalv2_common_normal_tbl"
+    def table_dup = "test_decimalv2_common_dup_tbl" // duplicate key
+    def table_uniq = "test_decimalv2_common_uniq_tbl" // unique key
+    def table_agg = "test_decimalv2_common_agg_tbl" // aggregate key
+    def table_dist = "test_decimalv2_common_dist_tbl" // distributed by
+    def table_part = "test_decimalv2_common_part_tbl"; // partition by
+
+    sql "drop table if exists ${table_dup}"
+    sql "drop table if exists ${table_uniq}"
+    sql "drop table if exists ${table_agg}"
+    sql "drop table if exists ${table_dist}"
+    sql "drop table if exists ${table_part}"
+
+    sql """
+        CREATE TABLE IF NOT EXISTS `${table_dup}` (
+            `decimal_key1` decimalv2(8, 5) NULL COMMENT "",
+            `decimal_key2` decimalv2(16, 5) NULL COMMENT "",
+            `decimal_value1` decimalv2(8, 5) NULL COMMENT "",
+            `decimal_value2` decimalv2(16, 5) NULL COMMENT "",
+            INDEX `idx_key1` (`decimal_value1`) USING BITMAP,
+            INDEX `idx_key2` (`decimal_value2`) USING BITMAP
+          ) ENGINE=OLAP
+          DUPLICATE KEY(`decimal_key1`, `decimal_key2`)
+          COMMENT "OLAP"
+          DISTRIBUTED BY HASH(`decimal_key1`, `decimal_key2`) BUCKETS 4
+          PROPERTIES (
+          "replication_allocation" = "tag.location.default: 1",
+          "in_memory" = "false",
+          "storage_format" = "V2"
+        )
+    """
+
+    sql """
+        CREATE TABLE IF NOT EXISTS `${table_uniq}` (
+            `decimal_key1` decimalv2(8, 5) NULL COMMENT "",
+            `decimal_key2` decimalv2(16, 5) NULL COMMENT "",
+            `decimal_value1` decimalv2(8, 5) NULL COMMENT "",
+            `decimal_value2` decimalv2(16, 5) NULL COMMENT "",
+            INDEX `idx_key1` (`decimal_value1`) USING BITMAP,
+            INDEX `idx_key2` (`decimal_value2`) USING BITMAP
+          ) ENGINE=OLAP
+          UNIQUE KEY(`decimal_key1`, `decimal_key2`)
+          COMMENT "OLAP"
+          DISTRIBUTED BY HASH(`decimal_key1`, `decimal_key2`) BUCKETS 4
+          PROPERTIES (
+          "replication_allocation" = "tag.location.default: 1",
+          "in_memory" = "false",
+          "storage_format" = "V2"
+        )
+    """
+
+    sql """
+        CREATE TABLE IF NOT EXISTS `${table_agg}` (
+            `decimal_key1` decimalv2(8, 5) NULL COMMENT "",
+            `decimal_key2` decimalv2(16, 5) NULL COMMENT "",
+            `decimal_value1` decimalv2(8, 5) sum NULL COMMENT "",
+            `decimal_value2` decimalv2(16, 5) max NULL COMMENT ""
+          ) ENGINE=OLAP
+          AGGREGATE KEY(`decimal_key1`, `decimal_key2`)
+          COMMENT "OLAP"
+          DISTRIBUTED BY HASH(`decimal_key1`, `decimal_key2`) BUCKETS 4
+          PROPERTIES (
+          "replication_allocation" = "tag.location.default: 1",
+          "in_memory" = "false",
+          "storage_format" = "V2"
+        )
+    """
+
+    sql """
+        CREATE TABLE IF NOT EXISTS `${table_dist}` (
+            `decimal_key1` decimalv2(8, 5) NULL COMMENT "",
+            `decimal_key2` decimalv2(16, 5) NULL COMMENT "",
+            `decimal_value1` decimalv2(8, 5) NULL COMMENT "",
+            `decimal_value2` decimalv2(16, 5) NULL COMMENT "",
+            INDEX `idx_key1` (`decimal_value1`) USING BITMAP,
+            INDEX `idx_key2` (`decimal_value2`) USING BITMAP
+          ) ENGINE=OLAP
+          DUPLICATE KEY(`decimal_key1`, `decimal_key2`)
+          COMMENT "OLAP"
+          DISTRIBUTED BY HASH(`decimal_key1`, `decimal_key2`) BUCKETS 4
+          PROPERTIES (
+          "replication_allocation" = "tag.location.default: 1",
+          "in_memory" = "false",
+          "storage_format" = "V2"
+        )
+    """
+
+    /*** TODO:  Column[decimal_key1] type[decimalv2] cannot be a range partition key.
+    sql """
+        CREATE TABLE IF NOT EXISTS `${table_part}` (
+            `decimal_key1` decimalv2(8, 5) NULL COMMENT "",
+            `decimal_key2` decimalv2(16, 5) NULL COMMENT "",
+            `decimal_value1` decimalv2(8, 5) NULL COMMENT "",
+            `decimal_value2` decimalv2(16, 5) NULL COMMENT "",
+            INDEX `idx_key1` (`decimal_value1`) USING BITMAP,
+            INDEX `idx_key2` (`decimal_value2`) USING BITMAP
+          ) ENGINE=OLAP
+          UNIQUE KEY(`decimal_key1`, `decimal_key2`)
+          PARTITION BY RANGE(`decimal_key1`) (
+            PARTITION `p1` VALUES LESS THAN ('1.1111'),
+            PARTITION `p2` VALUES LESS THAN ('2.2222'),
+            PARTITION `p3` VALUES LESS THAN ('3.3333'),
+            PARTITION `p4` VALUES LESS THAN ('4.4444'),
+            PARTITION `p5` VALUES LESS THAN ('5.5555'),
+            PARTITION `p6` VALUES LESS THAN ('100.9999')
+          )
+          DISTRIBUTED BY HASH(`decimal_key1`) BUCKETS 2
+          PROPERTIES (
+          "replication_allocation" = "tag.location.default: 1",
+          "in_memory" = "false",
+          "storage_format" = "V2"
+        )
+    """
+    */
+
+    def insert_data = { table_name ->
+        sql """
+            insert into ${table_name}
+                values
+                    (1.1111, 1.1111, 1.1111, 1.1111),
+                    (2.2222, 1.1111, 1.1111, 1.1111),
+                    (3.3333, 1.1111, 1.1111, 1.1111),
+                    (4.4444, 1.1111, 1.1111, 1.1111),
+                    (5.5555, 1.1111, 1.1111, 1.1111),
+                    (6.6666, 1.1111, 1.1111, 1.1111),
+                    (7.7777, 1.1111, 1.1111, 1.1111),
+                    (8.8888, 1.1111, 1.1111, 1.1111),
+                    (9.9999, 1.1111, 1.1111, 1.1111);
+        """
+        sql """
+            insert into ${table_name}
+                values
+                    (1.1111, 1.1111, 1.1111, 1.1111),
+                    (2.2222, 2.2222, 1.1111, 1.1111),
+                    (3.3333, 3.3333, 1.1111, 1.1111),
+                    (4.4444, 4.4444, 1.1111, 1.1111),
+                    (5.5555, 5.5555, 1.1111, 1.1111),
+                    (6.6666, 6.6666, 1.1111, 1.1111),
+                    (7.7777, 7.7777, 1.1111, 1.1111),
+                    (8.8888, 8.8888, 1.1111, 1.1111),
+                    (9.9999, 9.9999, 1.1111, 1.1111);
+        """
+        sql """
+            insert into ${table_name}
+                values
+                    (1.1111, 1.1111, 1.1111, 1.1111),
+                    (2.2222, 2.2222, 2.2222, 1.1111),
+                    (3.3333, 3.3333, 3.3333, 1.1111),
+                    (4.4444, 4.4444, 4.4444, 1.1111),
+                    (5.5555, 5.5555, 5.5555, 1.1111),
+                    (6.6666, 6.6666, 6.6666, 1.1111),
+                    (7.7777, 7.7777, 7.7777, 1.1111),
+                    (8.8888, 8.8888, 8.8888, 1.1111),
+                    (9.9999, 9.9999, 9.9999, 1.1111);
+        """
+        sql """
+            insert into ${table_name}
+                values
+                    (1.1111, 1.1111, 1.1111, 1.1111),
+                    (2.2222, 2.2222, 2.2222, 2.2222),
+                    (3.3333, 3.3333, 3.3333, 3.3333),
+                    (4.4444, 4.4444, 4.4444, 4.4444),
+                    (5.5555, 5.5555, 5.5555, 5.5555),
+                    (6.6666, 6.6666, 6.6666, 6.6666),
+                    (7.7777, 7.7777, 7.7777, 7.7777),
+                    (8.8888, 8.8888, 8.8888, 8.8888),
+                    (9.9999, 9.9999, 9.9999, 9.9999);
+        """
+        sql """
+            insert into ${table_name}
+                values
+                    (null, 1.1111, 1.1111, 1.1111),
+                    (2.2222, null, 2.2222, 2.2222),
+                    (3.3333, 3.3333, null, 3.3333),
+                    (4.4444, 4.4444, 4.4444, null),
+                    (5.5555, 5.5555, 5.5555, null),
+                    (6.6666, 6.6666, null, 6.6666),
+                    (7.7777, null, 7.7777, 7.7777),
+                    (null, 8.8888, 8.8888, 8.8888),
+                    (9.9999, null, 9.9999, 9.9999);
+        """
+        sql """
+            insert into ${table_name}
+                values
+                    (1.1111, null, 1.1111, 1.1111),
+                    (2.2222, 2.2222, null, 2.2222),
+                    (3.3333, 3.3333, 3.3333, null),
+                    (null, 4.4444, 4.4444, 4.4444),
+                    (5.5555, null, 5.5555, 5.5555),
+                    (6.6666, 6.6666, null, 6.6666),
+                    (7.7777, 7.7777, 7.7777, null),
+                    (null, 8.8888, 8.8888, 8.8888),
+                    (9.9999, null, 9.9999, 9.9999);
+        """
+    }
+
+    insert_data(table_dup)
+    insert_data(table_agg)
+    insert_data(table_uniq)
+    insert_data(table_dist)
+    // insert_data(table_part)
+
+    def run_predicate_test = { table_name, col, col_value, bitmap_col, bitmap_col_value, in_list ->
+        def query = """
+            select
+                *
+            from
+                `${table_name}`
+            where
+                `${bitmap_col}` = ${bitmap_col_value}
+            order by 1, 2, 3, 4;
+        """
+        quickTest("predicate_test_bitmap_eq_${table_name}", query)
+        def query2 = """
+            select
+                *
+            from
+                `${table_name}`
+            where
+                `${bitmap_col}` <> ${bitmap_col_value}
+            order by 1, 2, 3, 4;
+        """
+        quickTest("predicate_test_bitmap_ne_${table_name}", query2)
+
+        def query3 = """
+            select
+                *
+            from
+                `${table_name}`
+            where
+                `${bitmap_col}` < ${bitmap_col_value}
+            order by 1, 2, 3, 4;
+        """
+        quickTest("predicate_test_bitmap_lt_${table_name}", query3)
+
+        def query4 = """
+            select
+                *
+            from
+                `${table_name}`
+            where
+                `${bitmap_col}` > ${bitmap_col_value}
+            order by 1, 2, 3, 4;
+        """
+        quickTest("predicate_test_bitmap_gt_${table_name}", query4)
+
+        query = """
+            select
+                *
+            from
+                `${table_name}`
+            where
+                `${col}` = ${col_value}
+            order by 1, 2, 3, 4;
+        """
+        quickTest("predicate_test_eq_${table_name}", query)
+        query2 = """
+            select
+                *
+            from
+                `${table_name}`
+            where
+                `${col}` <> ${col_value}
+            order by 1, 2, 3, 4;
+        """
+        quickTest("predicate_test_ne_${table_name}", query2)
+
+        query3 = """
+            select
+                *
+            from
+                `${table_name}`
+            where
+                `${col}` < ${col_value}
+            order by 1, 2, 3, 4;
+        """
+        quickTest("predicate_test_lt_${table_name}", query3)
+
+        query4 = """
+            select
+                *
+            from
+                `${table_name}`
+            where
+                `${col}` > ${col_value}
+            order by 1, 2, 3, 4;
+        """
+        quickTest("predicate_test_gt_${table_name}", query4)
+
+        quickTest("predicate_test_null_${table_name}", """
+            select * from ${table_name} where ${col} is null order by 1, 2, 3, 4;
+        """)
+
+        quickTest("predicate_test_notnull_${table_name}", """
+            select * from ${table_name} where ${col} is not null order by 1, 2, 3, 4;
+        """)
+
+        quickTest("predicate_test_in_${table_name}", """
+            select * from ${table_name} where ${col} in (${in_list}) order by 1, 2, 3, 4;
+        """)
+
+        quickTest("predicate_test_notin_${table_name}", """
+            select * from ${table_name} where ${col} not in (${in_list}) order by 1, 2, 3, 4;
+        """)
+
+        // sql """ set runtime_filter_wait_infinitely = true; """
+
+        // sql " set runtime_filter_type = 1; "
+
+        // quickTest("runtime_filter_${table_name}_1", """
+        //     select * from ${table_name} t1, ${table_name} t2 where t1.${col} = t2.${col} order by 1, 2, 3, 4, 5, 6, 7, 8;
+        // """)
+
+        // sql " set runtime_filter_type = 2; "
+
+        // quickTest("runtime_filter_${table_name}_2", """
+        //     select * from ${table_name} t1, ${table_name} t2 where t1.${col} = t2.${col} order by 1, 2, 3, 4, 5, 6, 7, 8;
+        // """)
+
+        // sql " set runtime_filter_type = 4; "
+
+        // quickTest("runtime_filter_${table_name}_3", """
+        //     select * from ${table_name} t1, ${table_name} t2 where t1.${col} = t2.${col} order by 1, 2, 3, 4, 5, 6, 7, 8;
+        // """)
+
+        // sql " set runtime_filter_type = 8; "
+
+        // quickTest("runtime_filter_${table_name}_4", """
+        //     select * from ${table_name} t1, ${table_name} t2 where t1.${col} = t2.${col} order by 1, 2, 3, 4, 5, 6, 7, 8;
+        // """)
+
+        // sql """ set runtime_filter_wait_infinitely = 0; """
+
+        // sql " set runtime_filter_type = 1; "
+
+        // quickTest("runtime_filter_${table_name}_5", """
+        //     select * from ${table_name} t1, ${table_name} t2 where t1.${col} = t2.${col} order by 1, 2, 3, 4, 5, 6, 7, 8;
+        // """)
+
+        // sql " set runtime_filter_type = 2; "
+
+        // quickTest("runtime_filter_${table_name}_6,", """
+        //     select * from ${table_name} t1, ${table_name} t2 where t1.${col} = t2.${col} order by 1, 2, 3, 4, 5, 6, 7, 8;
+        // """)
+
+        // sql " set runtime_filter_type = 4; "
+
+        // quickTest("runtime_filter_${table_name}_7", """
+        //     select * from ${table_name} t1, ${table_name} t2 where t1.${col} = t2.${col} order by 1, 2, 3, 4, 5, 6, 7, 8;
+        // """)
+
+        // sql " set runtime_filter_type = 8; "
+
+        // quickTest("runtime_filter_${table_name}_8", """
+        //     select * from ${table_name} t1, ${table_name} t2 where t1.${col} = t2.${col} order by 1, 2, 3, 4, 5, 6, 7, 8;
+        // """)
+    }
+
+    run_predicate_test(table_dup, "decimal_key1", "5.0", "decimal_value1", "5.0", "4.4444, 5.5555, 6.6666, 7.7777");
+    run_predicate_test(table_dup, "decimal_key2", "5.0", "decimal_value1", "5.0", "4.4444, 5.5555, 6.6666, 7.7777");
+    run_predicate_test(table_dup, "decimal_value1", "5.0", "decimal_value1", "5.0", "4.4444, 5.5555, 6.6666, 7.7777");
+    run_predicate_test(table_dup, "decimal_value2", "5.0", "decimal_value1", "5.0", "4.4444, 5.5555, 6.6666, 7.7777");
+    run_predicate_test(table_uniq, 'decimal_key1', '5.5555', 'decimal_value1', '5.5555', "4.4444, 5.5555, 6.6666, 7.7777");
+    run_predicate_test(table_agg, 'decimal_key1', '6.6666', 'decimal_value1', '6.6666', "4.4444, 5.5555, 6.6666, 7.7777");
+    run_predicate_test(table_dist, 'decimal_key1', '7.7777', 'decimal_value1', 'cast(7.7777 as decimalv2(8, 5))', "4.4444, 5.5555, 6.6666, 7.7777");
+    // run_predicate_test(table_part, 'decimal_key1', '8.88888', 'decimal_value1', '8.8888', "4.4444, 5.5555, 6.6666, 7.7777");
+
+    def run_delete_test =  { table_name, where ->
+        sql """
+            delete from ${table_name} where ${where};
+        """
+
+        quickTest("after_del_${table_name}", """
+            select * from ${table_name} order by 1, 2, 3, 4;
+        """)
+    }
+
+    run_delete_test(table_dup, "`decimal_value1` < 5.0")
+    run_delete_test(table_uniq, "`decimal_value1` > 9.9999")
+    // delete predicate on value column only supports Unique table with merge-on-write enabled and Duplicate table
+    // run_delete_test(table_agg, "`decimal_key1` = 7.77777")
+    run_delete_test(table_dist, "`decimal_value1` = 8.8888")
+    //run_delete_test(table_part, "`decimal_value1` > 10.9999")
+
+    sql """
+        admin set frontend config("enable_decimal_conversion" = "true");
+    """
+}
\ No newline at end of file
diff --git a/regression-test/suites/datatype_p0/decimalv2/test_decimalv2_load.groovy b/regression-test/suites/datatype_p0/decimalv2/test_decimalv2_load.groovy
new file mode 100644
index 00000000000..5c065a921a0
--- /dev/null
+++ b/regression-test/suites/datatype_p0/decimalv2/test_decimalv2_load.groovy
@@ -0,0 +1,90 @@
+// 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.
+
+suite("test_decimalv2_load", "nonConcurrent") {
+    def dbName = "test_decimalv2_load_db"
+    sql "CREATE DATABASE IF NOT EXISTS ${dbName}"
+    sql "USE $dbName"
+
+    sql """
+        admin set frontend config("enable_decimal_conversion" = "false");
+    """
+    sql "set check_overflow_for_decimal=false;"
+
+    def tableName = "test_decimalv2_load_tbl"
+    sql """ DROP TABLE IF EXISTS ${tableName} """
+    sql """
+    CREATE TABLE IF NOT EXISTS ${tableName} (
+          `a` decimalv2(8, 5)
+        ) ENGINE=OLAP
+        DUPLICATE KEY(`a`)
+        COMMENT 'OLAP'
+        DISTRIBUTED BY HASH(`a`) BUCKETS 1
+        PROPERTIES (
+        "replication_allocation" = "tag.location.default: 1"
+    );
+    """
+
+    streamLoad {
+        db dbName
+        table tableName
+        file "${context.file.parent}/test_data/test.csv"
+        time 30000
+
+        check { result, exception, startTime, endTime ->
+            if (exception != null) {
+                throw exception
+            }
+            log.info("Stream load result: ${result}".toString())
+            def json = parseJson(result)
+            assertEquals(6, json.NumberTotalRows)
+            assertEquals(6, json.NumberLoadedRows)
+        }
+    }
+
+    sql """ sync; """
+
+    qt_query1 """
+        select * from ${tableName} order by 1;
+    """
+
+    def tableName2 = "test_decimalv2_load_tbl2"
+    sql """ DROP TABLE IF EXISTS ${tableName2} """
+    sql """
+        CREATE TABLE IF NOT EXISTS ${tableName2} (
+              `a` decimalv2(8, 5)
+            ) ENGINE=OLAP
+            DUPLICATE KEY(`a`)
+            COMMENT 'OLAP'
+            DISTRIBUTED BY HASH(`a`) BUCKETS 1
+            PROPERTIES (
+            "replication_allocation" = "tag.location.default: 1"
+        );
+    """
+
+    sql """
+        insert into ${tableName2} select * from ${tableName};
+    """
+
+    qt_query2 """
+        select * from ${tableName2} order by 1;
+    """
+
+    sql """
+        admin set frontend config("enable_decimal_conversion" = "true");
+    """
+}
diff --git a/regression-test/suites/datatype_p0/decimalv2/test_decimalv2_overflow.groovy b/regression-test/suites/datatype_p0/decimalv2/test_decimalv2_overflow.groovy
new file mode 100644
index 00000000000..2b23bf2d5dc
--- /dev/null
+++ b/regression-test/suites/datatype_p0/decimalv2/test_decimalv2_overflow.groovy
@@ -0,0 +1,395 @@
+// 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.
+
+suite("test_decimalv2_overflow", "nonConcurrent") {
+    sql """
+        admin set frontend config("enable_decimal_conversion" = "false");
+    """
+
+    sql """ set check_overflow_for_decimal=false; """
+
+    def tblName1 = "test_decimalv2_overflow1"
+    sql "drop table if exists ${tblName1}"
+	sql """ CREATE  TABLE ${tblName1} (
+            `c1` decimalv2(22, 4)
+        ) ENGINE=OLAP
+        DISTRIBUTED BY HASH(`c1`) BUCKETS 10
+        PROPERTIES (
+        "replication_allocation" = "tag.location.default: 1"
+        ); """
+	sql "insert into ${tblName1} values(104665062791137173.7169)"
+
+	def tblName2 = "test_decimalv2_overflow2"
+	sql "drop table if exists ${tblName2}"
+    sql """ CREATE  TABLE ${tblName2} (
+              `c2`  decimalv2(20, 2),
+          ) ENGINE=OLAP
+        UNIQUE KEY(`c2`)
+        DISTRIBUTED BY HASH(`c2`) BUCKETS 10
+        PROPERTIES (
+        "replication_allocation" = "tag.location.default: 1"
+        ); """
+    sql "insert into ${tblName2} values(705091149953414452.46)"
+
+    // qt_sql1 """ select c2 / 10000 * c1 from ${tblName1}, ${tblName2}; """
+
+    qt_sql1 """ select c2 / 10000 * c1 from ${tblName1}, ${tblName2}; """
+
+    sql "drop TABLE IF EXISTS test_decimalv2_overflow;"
+    sql """
+        CREATE TABLE test_decimalv2_overflow(
+          k1 decimalv2(18, 6),
+          k2 decimalv2(16, 8)
+        )
+        DISTRIBUTED BY HASH(`k1`, `k2`) BUCKETS 8
+        PROPERTIES (
+        "replication_allocation" = "tag.location.default: 1"
+        );
+    """
+    sql """
+        insert into test_decimalv2_overflow values
+            (123456789000.123456, 12345678.12345678),
+            (999999999999.999999, 99999999.99999999);
+    """
+
+    // result type: (9,1)
+    qt_decimalv2_calc_overflow """
+        select k1, k2, k1 * k2 from test_decimalv2_overflow order by 1,2;
+    """
+
+    sql "drop TABLE IF EXISTS test_decimalv2_tb1;"
+    sql "drop TABLE IF EXISTS test_decimalv2_tb2;"
+
+    sql """
+        create table test_decimalv2_tb1(
+            k1 decimalv2(27, 9)
+        ) DISTRIBUTED BY HASH(`k1`) BUCKETS 8
+        PROPERTIES (
+            "replication_allocation" = "tag.location.default: 1"
+        );
+    """
+
+    sql """
+        create table test_decimalv2_tb2(
+            k2 decimalv2(19, 9)
+        ) DISTRIBUTED BY HASH(`k2`) BUCKETS 8
+        PROPERTIES (
+            "replication_allocation" = "tag.location.default: 1"
+        );
+    """
+
+    sql """
+        insert into test_decimalv2_tb1 values(99999999999999999.999999999), (9.9);
+    """
+
+    sql """
+        insert into test_decimalv2_tb2 values(9999999.999999999), (9.9);
+    """
+
+    qt_union1 """
+        select * from (select * from test_decimalv2_tb1 union select * from test_decimalv2_tb2) t order by 1;
+    """
+
+    qt_union2 """
+        select * from (select * from test_decimalv2_tb2 union select * from test_decimalv2_tb1) t order by 1;
+    """
+
+    qt_intersect1 """
+        select * from (select * from test_decimalv2_tb1 intersect select * from test_decimalv2_tb2) t order by 1;
+    """
+
+    qt_intersect2 """
+        select * from (select * from test_decimalv2_tb2 intersect select * from test_decimalv2_tb1) t order by 1;
+    """
+
+    qt_except1 """
+        select * from (select * from test_decimalv2_tb1 except select * from test_decimalv2_tb2) t order by 1;
+    """
+
+    qt_except2 """
+        select * from (select * from test_decimalv2_tb2 except select * from test_decimalv2_tb1) t order by 1;
+    """
+
+    sql """ set check_overflow_for_decimal=true; """
+    def prepare_decimalv2_overflow_test = {
+        sql """
+            drop TABLE if exists decimalv2_overflow_test;
+        """
+        sql """
+        CREATE TABLE decimalv2_overflow_test (
+            k1 decimalv2(27, 9),
+            k2 decimalv2(27, 9)
+        ) ENGINE=OLAP
+            DISTRIBUTED BY HASH(`k1`)
+            PROPERTIES (
+            "replication_num" = "1"
+            );
+        """
+    }
+    // max int128: 170141183460469231731687303715884105727, 39 digits
+
+    // add
+    prepare_decimalv2_overflow_test()
+    sql """
+        insert into decimalv2_overflow_test values(999999999999999999.999999998, 0.000000001);
+    """
+    // const + const
+    qt_add_overflow1 """
+        select cast(999999999999999999.999999998 as decimalv2(27,9)) + cast(0.000000001 as decimalv2(27,9));
+    """
+    // vector + const
+    qt_add_overflow2 """
+        select k1, 0.000000001, k1 + cast(0.000000001 as decimalv2(27,9)) from decimalv2_overflow_test order by 1,2,3;
+    """
+    // const + vector
+    qt_add_overflow3 """
+        select 0.000000001, k1, cast(0.000000001 as decimalv2(27,9)) + k1 from decimalv2_overflow_test order by 1,2,3;
+    """
+    // vector + vector
+    qt_add_overflow3 """
+        select k1, k2, k1 + k2 from decimalv2_overflow_test order by 1,2,3;
+    """
+
+    // add overflow
+    prepare_decimalv2_overflow_test()
+    sql """
+        insert into decimalv2_overflow_test values(999999999999999999.999999999, 0.000000001);
+    """
+    test {
+        sql """
+        select cast(999999999999999999.999999999 as decimalv2(27,9)) + cast(0.000000001 as decimalv2(27,9));
+        """
+        exception "Arithmetic overflow"
+    }
+    test {
+        sql """
+        select k1, 0.000000001, k1 + cast(0.000000001 as decimalv2(27,9)) from decimalv2_overflow_test order by 1,2,3;
+        """
+        exception "Arithmetic overflow"
+    }
+    test {
+        sql """
+        select 0.000000001, k1, cast(0.000000001 as decimalv2(27,9)) + k1 from decimalv2_overflow_test order by 1,2,3;
+        """
+        exception "Arithmetic overflow"
+    }
+    test {
+        sql """
+        select k1, k2, k1 + k2 from decimalv2_overflow_test order by 1,2,3;
+        """
+        exception "Arithmetic overflow"
+    }
+
+    // sub
+    prepare_decimalv2_overflow_test()
+    sql """
+        insert into decimalv2_overflow_test values(-999999999999999999.999999998, 0.000000001);
+    """
+    // const - const
+    qt_sub_overflow1 """
+        select cast(-999999999999999999.999999998 as decimalv2(27,9)) - cast(0.000000001 as decimalv2(27,9));
+    """
+    // vector - const
+    qt_sub_overflow2 """
+        select k1, 0.000000001, k1 - cast(0.000000001 as decimalv2(27,9)) from decimalv2_overflow_test order by 1,2,3;
+    """
+    // const - vector
+    qt_sub_overflow3 """
+        select 0.000000001, k1, cast(0.000000001 as decimalv2(27,9)) - k1 from decimalv2_overflow_test order by 1,2,3;
+    """
+    // vector - vector
+    qt_sub_overflow3 """
+        select k1, k2, k1 - k2 from decimalv2_overflow_test order by 1,2,3;
+    """
+
+    // sub overflow
+    prepare_decimalv2_overflow_test()
+    sql """
+        insert into decimalv2_overflow_test values(-999999999999999999.999999999, 0.000000001);
+    """
+    test {
+        sql """
+        select cast(-999999999999999999.999999999 as decimalv2(27,9)) - cast(0.000000001 as decimalv2(27,9));
+        """
+        exception "Arithmetic overflow"
+    }
+    test {
+        sql """
+        select k1, 0.000000001, k1 - cast(0.000000001 as decimalv2(27,9)) from decimalv2_overflow_test order by 1,2,3;
+        """
+        exception "Arithmetic overflow"
+    }
+    test {
+        sql """
+        select 0.000000001, k1, cast(0.100000000 as decimalv2(27,9)) - k1 from decimalv2_overflow_test order by 1,2,3;
+        """
+        exception "Arithmetic overflow"
+    }
+    test {
+        sql """
+        select k1, k2, k1 - k2 from decimalv2_overflow_test order by 1,2,3;
+        """
+        exception "Arithmetic overflow"
+    }
+
+    // multiply
+    prepare_decimalv2_overflow_test()
+    sql """
+        insert into decimalv2_overflow_test values(999999999999999999.999999999, 1.0);
+    """
+
+    // const * const
+    qt_multi_overflow1 """
+        select cast(999999999999999999.999999999 as decimalv2(27,9)) * cast(1.0 as decimalv2(27,9));
+    """
+    // vector * const
+    qt_multi_overflow2 """
+        select k1, k1 * 1.000000000 from decimalv2_overflow_test order by 1, 2;
+    """
+    // const * vector
+    qt_multi_overflow3 """
+        select k1, 1.000000000 * k1 from decimalv2_overflow_test order by 1, 2;
+    """
+    // vector * vector
+    qt_multi_overflow4 """
+        select k1, k2, k1 * k2 from decimalv2_overflow_test order by 1, 2;
+    """
+
+    prepare_decimalv2_overflow_test()
+    sql """
+        insert into decimalv2_overflow_test values(999999999999999999.999999999, 1.1);
+    """
+    test {
+        sql """
+        select cast(999999999999999999.999999999 as decimalv2(27,9)) * cast(1.1 as decimalv2(27,9));
+        """
+        exception "Arithmetic overflow"
+    }
+    test {
+        sql """
+        select cast(999999999999999999.999999999 as decimalv2(27,9)) * cast(999999999999999999.999999999 as decimalv2(27,9));
+        """
+        exception "Arithmetic overflow"
+    }
+    test {
+        sql """
+        select k1, k1 * 1.1 from decimalv2_overflow_test order by 1, 2;
+        """
+        exception "Arithmetic overflow"
+    }
+    test {
+        sql """
+        select k1, 1.1 * k1 from decimalv2_overflow_test order by 1, 2;
+        """
+        exception "Arithmetic overflow"
+    }
+    test {
+        sql """
+        select k1, k2, k1 * k2 from decimalv2_overflow_test order by 1, 2;
+        """
+        exception "Arithmetic overflow"
+    }
+
+    // divide
+    prepare_decimalv2_overflow_test()
+    sql """
+        insert into decimalv2_overflow_test values(99999999999999999.999999999, 0.1);
+    """
+    qt_div_overflow1 """
+        select k1, k2, k1 / k2 from decimalv2_overflow_test order by 1, 2;
+    """
+    qt_div_overflow2 """
+        select cast(99999999999999999.999999999 as decimalv2(27,9)) / cast(0.1 as decimalv2(27,9));
+    """
+    qt_div_overflow3 """
+        select k1, 0.1, k1 / 0.1 from decimalv2_overflow_test order by 1, 2, 3;
+    """
+    qt_div_overflow4 """
+        select cast(99999999999999999.999999999 as decimalv2(27,9)) / k2 from decimalv2_overflow_test order by 1;
+    """
+
+    // divide overflow
+    prepare_decimalv2_overflow_test()
+    sql """
+        insert into decimalv2_overflow_test values(999999999999999999.999999999, 0.1);
+    """
+    test {
+        sql """
+        select k1, k2, k1 / k2 from decimalv2_overflow_test;
+        """
+        exception "Arithmetic overflow"
+    }
+    test {
+        sql """
+        select cast(999999999999999999.999999999 as decimalv2(27,9)) / cast(0.1 as decimalv2(27,9));
+        """
+        exception "Arithmetic overflow"
+    }
+    test {
+        sql """
+        select cast(999999999999999999.999999999 as decimalv2(27,9)) / cast(0.000000001 as decimalv2(27,9));
+        """
+        exception "Arithmetic overflow"
+    }
+    test {
+        sql """
+        select k1, 0.1, k1 / 0.1 from decimalv2_overflow_test;
+        """
+        exception "Arithmetic overflow"
+    }
+    test {
+        sql """
+        select cast(999999999999999999.999999999 as decimalv2(27,9)) / k2 from decimalv2_overflow_test;
+        """
+        exception "Arithmetic overflow"
+    }
+
+    // mod
+    prepare_decimalv2_overflow_test()
+    sql """
+        insert into decimalv2_overflow_test values(99999999999999999.999999999, 0.1);
+    """
+    qt_mod1 """
+        select k1, k2, k1 % k2 from decimalv2_overflow_test order by 1, 2;
+    """
+    qt_mod2 """
+        select cast(99999999999999999.999999999 as decimalv2(27,9)) % cast(0.1 as decimalv2(27,9));
+    """
+    qt_mod3 """
+        select k1, 0.1, k1 % 0.1 from decimalv2_overflow_test order by 1, 2, 3;
+    """
+    qt_mod4 """
+        select cast(99999999999999999.999999999 as decimalv2(27,9)) % k2 from decimalv2_overflow_test order by 1;
+    """
+
+    // TODO
+    // decimalv2 +-*/ integer
+    // integer +-*/ decimalv2
+
+    // decimalv2 +-*/ decimalv3
+    // decimalv3 +-*/ decimalv2
+
+    // decimalv2 mod, pmod
+
+    // decimalv2 largeint
+
+    // decimalv3 +-*/ integer
+    // integer +-*/ decimalv3
+
+    /// Decimal <op> Real is not supported (traditional DBs convert Decimal <op> Real to Real)
+    // {decimalv2 | decimalv3} +-*/ {float, double}
+}
diff --git a/regression-test/suites/datatype_p0/decimalv2/test_decimalv2_overflow2.groovy b/regression-test/suites/datatype_p0/decimalv2/test_decimalv2_overflow2.groovy
new file mode 100644
index 00000000000..ad6dea6765c
--- /dev/null
+++ b/regression-test/suites/datatype_p0/decimalv2/test_decimalv2_overflow2.groovy
@@ -0,0 +1,288 @@
+// 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.
+
+suite("test_decimalv2_overflow2") {
+    sql """ set check_overflow_for_decimal=true; """
+    def prepare_decimalv2_overflow_test2 = {
+        sql """
+            drop TABLE if exists decimalv2_overflow_test2;
+        """
+        sql """
+        CREATE TABLE decimalv2_overflow_test2 (
+            k1 decimalv2(27, 9),
+            k2 decimalv2(27, 9)
+        ) ENGINE=OLAP
+            DISTRIBUTED BY HASH(`k1`)
+            PROPERTIES (
+            "replication_num" = "1"
+            );
+        """
+    }
+    // max int128: 170141183460469231731687303715884105727, 39 digits
+
+    // add
+    prepare_decimalv2_overflow_test2()
+    sql """
+        insert into decimalv2_overflow_test2 values(999999999999999999.999999998, 0.000000001);
+    """
+    // const + const
+    qt_add_overflow1 """
+        select /*+SET_VAR(enable_fold_constant_by_be=true)*/ cast(999999999999999999.999999998 as decimalv2(27,9)) + cast(0.000000001 as decimalv2(27,9));
+    """
+    // vector + const
+    qt_add_overflow2 """
+        select k1, 0.000000001, k1 + cast(0.000000001 as decimalv2(27,9)) from decimalv2_overflow_test2 order by 1,2,3;
+    """
+    // const + vector
+    qt_add_overflow3 """
+        select 0.000000001, k1, cast(0.000000001 as decimalv2(27,9)) + k1 from decimalv2_overflow_test2 order by 1,2,3;
+    """
+    // vector + vector
+    qt_add_overflow3 """
+        select k1, k2, k1 + k2 from decimalv2_overflow_test2 order by 1,2,3;
+    """
+
+    // add overflow
+    prepare_decimalv2_overflow_test2()
+    sql """
+        insert into decimalv2_overflow_test2 values(999999999999999999.999999999, 0.000000001);
+    """
+    test {
+        sql """
+        select /*+SET_VAR(enable_fold_constant_by_be=true)*/ cast(999999999999999999.999999999 as decimalv2(27,9)) + cast(0.000000001 as decimalv2(27,9));
+        """
+        exception "Arithmetic overflow"
+    }
+    test {
+        sql """
+        select k1, 0.000000001, k1 + cast(0.000000001 as decimalv2(27,9)) from decimalv2_overflow_test2 order by 1,2,3;
+        """
+        exception "Arithmetic overflow"
+    }
+    test {
+        sql """
+        select 0.000000001, k1, cast(0.000000001 as decimalv2(27,9)) + k1 from decimalv2_overflow_test2 order by 1,2,3;
+        """
+        exception "Arithmetic overflow"
+    }
+    test {
+        sql """
+        select k1, k2, k1 + k2 from decimalv2_overflow_test2 order by 1,2,3;
+        """
+        exception "Arithmetic overflow"
+    }
+
+    // sub
+    prepare_decimalv2_overflow_test2()
+    sql """
+        insert into decimalv2_overflow_test2 values(-999999999999999999.999999998, 0.000000001);
+    """
+    // const - const
+    qt_sub_overflow1 """
+        select /*+SET_VAR(enable_fold_constant_by_be=true)*/ cast(-999999999999999999.999999998 as decimalv2(27,9)) - cast(0.000000001 as decimalv2(27,9));
+    """
+    // vector - const
+    qt_sub_overflow2 """
+        select k1, 0.000000001, k1 - cast(0.000000001 as decimalv2(27,9)) from decimalv2_overflow_test2 order by 1,2,3;
+    """
+    // const - vector
+    qt_sub_overflow3 """
+        select 0.000000001, k1, cast(0.000000001 as decimalv2(27,9)) - k1 from decimalv2_overflow_test2 order by 1,2,3;
+    """
+    // vector - vector
+    qt_sub_overflow3 """
+        select k1, k2, k1 - k2 from decimalv2_overflow_test2 order by 1,2,3;
+    """
+
+    // sub overflow
+    prepare_decimalv2_overflow_test2()
+    sql """
+        insert into decimalv2_overflow_test2 values(-999999999999999999.999999999, 0.000000001);
+    """
+    test {
+        sql """
+        select /*+SET_VAR(enable_fold_constant_by_be=true)*/ cast(-999999999999999999.999999999 as decimalv2(27,9)) - cast(0.000000001 as decimalv2(27,9));
+        """
+        exception "Arithmetic overflow"
+    }
+    test {
+        sql """
+        select k1, 0.000000001, k1 - cast(0.000000001 as decimalv2(27,9)) from decimalv2_overflow_test2 order by 1,2,3;
+        """
+        exception "Arithmetic overflow"
+    }
+    test {
+        sql """
+        select 0.000000001, k1, cast(0.100000000 as decimalv2(27,9)) - k1 from decimalv2_overflow_test2 order by 1,2,3;
+        """
+        exception "Arithmetic overflow"
+    }
+    test {
+        sql """
+        select k1, k2, k1 - k2 from decimalv2_overflow_test2 order by 1,2,3;
+        """
+        exception "Arithmetic overflow"
+    }
+
+    // multiply
+    prepare_decimalv2_overflow_test2()
+    sql """
+        insert into decimalv2_overflow_test2 values(999999999999999999.999999999, 1.0);
+    """
+
+    // const * const
+    qt_multi_overflow1 """
+        select /*+SET_VAR(enable_fold_constant_by_be=true)*/ cast(999999999999999999.999999999 as decimalv2(27,9)) * cast(1.0 as decimalv2(27,9));
+    """
+    // vector * const
+    qt_multi_overflow2 """
+        select k1, k1 * 1.000000000 from decimalv2_overflow_test2 order by 1, 2;
+    """
+    // const * vector
+    qt_multi_overflow3 """
+        select k1, 1.000000000 * k1 from decimalv2_overflow_test2 order by 1, 2;
+    """
+    // vector * vector
+    qt_multi_overflow4 """
+        select k1, k2, k1 * k2 from decimalv2_overflow_test2 order by 1, 2;
+    """
+
+    prepare_decimalv2_overflow_test2()
+    sql """
+        insert into decimalv2_overflow_test2 values(999999999999999999.999999999, 1.1);
+    """
+    test {
+        sql """
+        select /*+SET_VAR(enable_fold_constant_by_be=true)*/ cast(999999999999999999.999999999 as decimalv2(27,9)) * cast(1.1 as decimalv2(27,9));
+        """
+        exception "Arithmetic overflow"
+    }
+    test {
+        sql """
+        select /*+SET_VAR(enable_fold_constant_by_be=true)*/ cast(999999999999999999.999999999 as decimalv2(27,9)) * cast(999999999999999999.999999999 as decimalv2(27,9));
+        """
+        exception "Arithmetic overflow"
+    }
+    test {
+        sql """
+        select k1, k1 * cast(1.1 as decimalv2(27,9)) from decimalv2_overflow_test2 order by 1, 2;
+        """
+        exception "Arithmetic overflow"
+    }
+    test {
+        sql """
+        select k1, cast(1.1 as decimalv2(27,9)) * k1 from decimalv2_overflow_test2 order by 1, 2;
+        """
+        exception "Arithmetic overflow"
+    }
+    test {
+        sql """
+        select k1, k2, k1 * k2 from decimalv2_overflow_test2 order by 1, 2;
+        """
+        exception "Arithmetic overflow"
+    }
+
+    // divide
+    prepare_decimalv2_overflow_test2()
+    sql """
+        insert into decimalv2_overflow_test2 values(99999999999999999.999999999, 0.1);
+    """
+    qt_div_overflow1 """
+        select k1, k2, k1 / k2 from decimalv2_overflow_test2 order by 1, 2;
+    """
+    qt_div_overflow2 """
+        select /*+SET_VAR(enable_fold_constant_by_be=true)*/ cast(99999999999999999.999999999 as decimalv2(27,9)) / cast(0.1 as decimalv2(27,9));
+    """
+    qt_div_overflow3 """
+        select k1, 0.1, k1 / 0.1 from decimalv2_overflow_test2 order by 1, 2, 3;
+    """
+    qt_div_overflow4 """
+        select cast(99999999999999999.999999999 as decimalv2(27,9)) / k2 from decimalv2_overflow_test2 order by 1;
+    """
+
+    // divide overflow
+    prepare_decimalv2_overflow_test2()
+    sql """
+        insert into decimalv2_overflow_test2 values(999999999999999999.999999999, 0.1);
+    """
+    test {
+        sql """
+        select k1, k2, k1 / k2 from decimalv2_overflow_test2;
+        """
+        exception "Arithmetic overflow"
+    }
+    test {
+        sql """
+        select /*+SET_VAR(enable_fold_constant_by_be=true)*/ cast(999999999999999999.999999999 as decimalv2(27,9)) / cast(0.1 as decimalv2(27,9));
+        """
+        exception "Arithmetic overflow"
+    }
+    test {
+        sql """
+        select /*+SET_VAR(enable_fold_constant_by_be=true)*/ cast(999999999999999999.999999999 as decimalv2(27,9)) / cast(0.000000001 as decimalv2(27,9));
+        """
+        exception "Arithmetic overflow"
+    }
+    test {
+        sql """
+        select k1, 0.1, k1 / cast(0.1 as decimalv2(27,9)) from decimalv2_overflow_test2;
+        """
+        exception "Arithmetic overflow"
+    }
+    test {
+        sql """
+        select cast(999999999999999999.999999999 as decimalv2(27,9)) / k2 from decimalv2_overflow_test2;
+        """
+        exception "Arithmetic overflow"
+    }
+
+    // mod
+    prepare_decimalv2_overflow_test2()
+    sql """
+        insert into decimalv2_overflow_test2 values(99999999999999999.999999999, 0.1);
+    """
+    qt_mod1 """
+        select k1, k2, k1 % k2 from decimalv2_overflow_test2 order by 1, 2;
+    """
+    qt_mod2 """
+        select cast(99999999999999999.999999999 as decimalv2(27,9)) % cast(0.1 as decimalv2(27,9));
+    """
+    qt_mod3 """
+        select k1, 0.1, k1 % 0.1 from decimalv2_overflow_test2 order by 1, 2, 3;
+    """
+    qt_mod4 """
+        select cast(99999999999999999.999999999 as decimalv2(27,9)) % k2 from decimalv2_overflow_test2 order by 1;
+    """
+
+
+    // TODO
+    // decimalv2 +-*/ integer
+    // integer +-*/ decimalv2
+
+    // decimalv2 +-*/ decimalv3
+    // decimalv3 +-*/ decimalv2
+
+    // decimalv2 mod, pmod
+
+    // decimalv2 largeint
+
+    // decimalv3 +-*/ integer
+    // integer +-*/ decimalv3
+
+    /// Decimal <op> Real is not supported (traditional DBs convert Decimal <op> Real to Real)
+    // {decimalv2 | decimalv3} +-*/ {float, double}
+}
diff --git a/regression-test/suites/datatype_p0/decimalv3/test_decimalv3_overflow.groovy b/regression-test/suites/datatype_p0/decimalv3/test_decimalv3_overflow.groovy
index f97d1aea970..fc9d264a05c 100644
--- a/regression-test/suites/datatype_p0/decimalv3/test_decimalv3_overflow.groovy
+++ b/regression-test/suites/datatype_p0/decimalv3/test_decimalv3_overflow.groovy
@@ -41,9 +41,7 @@ suite("test_decimalv3_overflow") {
         ); """
     sql "insert into ${tblName2} values(705091149953414452.46)"
 
-    // qt_sql1 """ select c2 / 10000 * c1 from ${tblName1}, ${tblName2}; """
-
-    sql """ select c2 / 10000 * c1 from ${tblName1}, ${tblName2}; """
+    qt_sql1 """ select c2 / 10000 * c1 from ${tblName1}, ${tblName2}; """
 
     //=======================================
     // decimal32


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