Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix read parquet for different encodings across row groups #9129

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions velox/dwio/common/SelectiveColumnReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ void SelectiveColumnReader::prepareNulls(
}
}
}
returnReaderNulls_ = false;
if (resultNulls_ && resultNulls_->unique() &&
resultNulls_->capacity() >= bits::nbytes(numRows) + simd::kPadding) {
// Clear whole capacity because future uses could hit
Expand Down
Binary file not shown.
26 changes: 26 additions & 0 deletions velox/dwio/parquet/tests/reader/ParquetReaderTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,32 @@ TEST_F(ParquetReaderTest, varcharFilters) {
"nation.parquet", rowType, std::move(filters), expected);
}

TEST_F(ParquetReaderTest, readDifferentEncodingsWithFilter) {
FilterMap filters;
filters.insert({"n_1", exec::equal(1)});
auto rowType = ROW({"n_0", "n_1", "n_2"}, {INTEGER(), INTEGER(), VARCHAR()});
auto expected = makeRowVector({
makeFlatVector<int32_t>({1, 2, 3, 4, 1, 2, 3, 4, 6, 9}),
makeFlatVector<int32_t>(10, [](auto row) { return 1; }),
makeNullableFlatVector<std::string>(
{"A",
"B",
std::nullopt,
std::nullopt,
"A",
"B",
std::nullopt,
std::nullopt,
"F",
std::nullopt}),
});
assertReadWithFilters(
"different_encodings_with_filter.parquet",
rowType,
std::move(filters),
expected);
}

// This test is to verify filterRowGroups() doesn't throw the fileOffset Velox
// check failure
TEST_F(ParquetReaderTest, filterRowGroups) {
Expand Down
Loading