Skip to content

Commit

Permalink
Fix estimatedRowCount and selective read flatmap as struct for featur…
Browse files Browse the repository at this point in the history
…e-reaped files

Reviewed By: sdruzkin

Differential Revision: D67581964
  • Loading branch information
Yuhta authored and facebook-github-bot committed Dec 23, 2024
1 parent 0d039d6 commit 552c8ce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dwio/nimble/velox/FieldReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1768,7 +1768,7 @@ class RowFieldReader final : public FieldReader {
totalBytes += nullCount * nullOverheadBits(reader->type()) / 8;
} else if (rowCount == 0) {
rowCount = childRowCount;
} else {
} else if (childRowCount != 0) {
NIMBLE_CHECK(
rowCount == childRowCount,
fmt::format(
Expand Down Expand Up @@ -2298,7 +2298,7 @@ class StructFlatMapFieldReader : public FlatMapFieldReaderBase<T, hasNull> {
nullOverheadBits(node->valueReader()->type()) / 8;
} else if (rowCount == 0) {
rowCount = nonNullCount;
} else {
} else if (nonNullCount != 0) {
NIMBLE_CHECK(
rowCount == nonNullCount,
fmt::format(
Expand Down Expand Up @@ -2449,7 +2449,7 @@ class MergedFlatMapFieldReader final
// Estimation of map key vector size in velox::MapVector.
// Adding memory for key vector's BaseVector::nulls_
totalBytes += rowCount * this->keyNodes_.size() / 8;
// MergedFlatMap key field is either velox::StringView or primative type
// MergedFlatMap key field is either velox::StringView or primitive type
uint64_t totalKeyBytesPerRow{0};
if constexpr (std::is_same<T, velox::StringView>::value) {
for (const auto& node : this->keyNodes_) {
Expand Down

0 comments on commit 552c8ce

Please sign in to comment.