Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
rui-mo committed Nov 29, 2024
1 parent 2e5dadc commit eae60f5
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions velox/dwio/parquet/tests/reader/ParquetTableScanTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,29 @@ TEST_F(ParquetTableScanTest, countStar) {
assertQuery(plan, {split}, "SELECT 20");
}

TEST_F(ParquetTableScanTest, decimalSchemaEvolution) {
// decimal.parquet holds two columns (a: DECIMAL(5, 2), b: DECIMAL(20, 5)) and
// 20 rows (10 rows per group). Data is in plain uncompressed format:
// a: [100.01 .. 100.20]
// b: [100000000000000.00001 .. 100000000000000.00020]
std::vector<int64_t> unscaledShortValues(20);
std::iota(unscaledShortValues.begin(), unscaledShortValues.end(), 10001);
for (auto i = 0; i < unscaledShortValues.size(); ++i) {
unscaledShortValues[i] *= 1000;
}
loadData(
getExampleFilePath("decimal.parquet"),
ROW({"a"}, {DECIMAL(8, 5)}),
makeRowVector(
{"a"},
{
makeFlatVector(unscaledShortValues, DECIMAL(8, 5)),
}));

assertSelectWithFilter(
{"a"}, {}, "", "SELECT a FROM tmp");
}

TEST_F(ParquetTableScanTest, decimalSubfieldFilter) {
// decimal.parquet holds two columns (a: DECIMAL(5, 2), b: DECIMAL(20, 5)) and
// 20 rows (10 rows per group). Data is in plain uncompressed format:
Expand Down

0 comments on commit eae60f5

Please sign in to comment.