From a9b910927b5fd961e14bd2889edca6dedf4f8979 Mon Sep 17 00:00:00 2001 From: Jin Chengcheng Date: Sun, 23 Apr 2023 13:30:35 +0800 Subject: [PATCH] Fix velox_row_test (#211) * fix row test * fix code style --- .../prestosql/tests/DecimalArithmeticTest.cpp | 30 ------------------- .../tests/UnsafeRowBatchDeserializerTest.cpp | 8 +---- 2 files changed, 1 insertion(+), 37 deletions(-) diff --git a/velox/functions/prestosql/tests/DecimalArithmeticTest.cpp b/velox/functions/prestosql/tests/DecimalArithmeticTest.cpp index 0083dbc22d69..f774d2b10a67 100644 --- a/velox/functions/prestosql/tests/DecimalArithmeticTest.cpp +++ b/velox/functions/prestosql/tests/DecimalArithmeticTest.cpp @@ -224,36 +224,6 @@ TEST_F(DecimalArithmeticTest, subtract) { "Decimal overflow: 1 - -99999999999999999999999999999999999999"); } -TEST_F(DecimalArithmeticTest, sparkMultiply) { - // auto shortFlat = makeShortDecimalFlatVector({1000, 2000}, DECIMAL(17, - // 3)); - // // Multiply short and short, returning long. - // testDecimalExpr( - // makeLongDecimalFlatVector({1000000, 4000000}, DECIMAL(35, 6)), - // "multiply(c0, c1)", - // {shortFlat, shortFlat}); - - // auto longFlat = makeLongDecimalFlatVector({1000, 2000}, DECIMAL(21, 3)); - // auto longFlat1 = makeLongDecimalFlatVector({1000, 2000}, DECIMAL(21, 2)); - // // Multiply short and short, returning long. - // testDecimalExpr( - // makeLongDecimalFlatVector({1000000, 4000000}, DECIMAL(38, 5)), - // "multiply(c0, c1)", - // {longFlat, longFlat1}); - - // testDecimalExpr( - // makeLongDecimalFlatVector({1000, 4000}, DECIMAL(38, 7)), - // "multiply(c0, c1)", - // {makeLongDecimalFlatVector({1000, 2000}, DECIMAL(20, 5)), - // makeLongDecimalFlatVector({1000, 2000}, DECIMAL(20, 5))}); - - testDecimalExpr( - makeLongDecimalFlatVector({1000}, DECIMAL(38, 7)), - "multiply(c0, c1)", - {makeShortDecimalFlatVector({1}, DECIMAL(10, 0)), - makeLongDecimalFlatVector({1123210000000000000}, DECIMAL(38, 18))}); -} - TEST_F(DecimalArithmeticTest, multiply) { auto shortFlat = makeShortDecimalFlatVector({1000, 2000}, DECIMAL(17, 3)); // Multiply short and short, returning long. diff --git a/velox/row/tests/UnsafeRowBatchDeserializerTest.cpp b/velox/row/tests/UnsafeRowBatchDeserializerTest.cpp index 47a8f1f2909c..31b1a686c0e7 100644 --- a/velox/row/tests/UnsafeRowBatchDeserializerTest.cpp +++ b/velox/row/tests/UnsafeRowBatchDeserializerTest.cpp @@ -652,8 +652,6 @@ class UnsafeRowComplexBatchDeserializerTests makeFlatVector(batchSize, [](vector_size_t i) { return StringView::makeInline("string" + std::to_string(i)); }); - auto decimalVector = - makeLongDecimalFlatVector({2200, 4400}, DECIMAL(20, 3)); auto intArrayVector = makeArrayVector( batchSize, [](vector_size_t row) { return row % 3; }, @@ -665,11 +663,7 @@ class UnsafeRowComplexBatchDeserializerTests return StringView::makeInline("str" + std::to_string(row + index)); }); return makeRowVector( - {intVector, - stringVector, - decimalVector, - intArrayVector, - stringArrayVector}); + {intVector, stringVector, intArrayVector, stringArrayVector}); } std::shared_ptr pool_ = memory::getDefaultMemoryPool();