Skip to content

Commit

Permalink
Fix velox_row_test (#211)
Browse files Browse the repository at this point in the history
* fix row test
* fix code style
  • Loading branch information
jinchengchenghh authored Apr 23, 2023
1 parent 10addd0 commit a9b9109
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 37 deletions.
30 changes: 0 additions & 30 deletions velox/functions/prestosql/tests/DecimalArithmeticTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<TypeKind::LONG_DECIMAL>(
// 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<TypeKind::LONG_DECIMAL>(
// makeLongDecimalFlatVector({1000000, 4000000}, DECIMAL(38, 5)),
// "multiply(c0, c1)",
// {longFlat, longFlat1});

// testDecimalExpr<TypeKind::LONG_DECIMAL>(
// makeLongDecimalFlatVector({1000, 4000}, DECIMAL(38, 7)),
// "multiply(c0, c1)",
// {makeLongDecimalFlatVector({1000, 2000}, DECIMAL(20, 5)),
// makeLongDecimalFlatVector({1000, 2000}, DECIMAL(20, 5))});

testDecimalExpr<TypeKind::LONG_DECIMAL>(
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.
Expand Down
8 changes: 1 addition & 7 deletions velox/row/tests/UnsafeRowBatchDeserializerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -652,8 +652,6 @@ class UnsafeRowComplexBatchDeserializerTests
makeFlatVector<StringView>(batchSize, [](vector_size_t i) {
return StringView::makeInline("string" + std::to_string(i));
});
auto decimalVector =
makeLongDecimalFlatVector({2200, 4400}, DECIMAL(20, 3));
auto intArrayVector = makeArrayVector<int64_t>(
batchSize,
[](vector_size_t row) { return row % 3; },
Expand All @@ -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<memory::MemoryPool> pool_ = memory::getDefaultMemoryPool();
Expand Down

0 comments on commit a9b9109

Please sign in to comment.