From 552c8ce564578ce3fc81dc2b29f6e44ec33ae5fc Mon Sep 17 00:00:00 2001 From: Jimmy Lu Date: Sun, 22 Dec 2024 16:33:29 -0800 Subject: [PATCH] Fix estimatedRowCount and selective read flatmap as struct for feature-reaped files Reviewed By: sdruzkin Differential Revision: D67581964 --- dwio/nimble/velox/FieldReader.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dwio/nimble/velox/FieldReader.cpp b/dwio/nimble/velox/FieldReader.cpp index c468aae..5ea0c91 100644 --- a/dwio/nimble/velox/FieldReader.cpp +++ b/dwio/nimble/velox/FieldReader.cpp @@ -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( @@ -2298,7 +2298,7 @@ class StructFlatMapFieldReader : public FlatMapFieldReaderBase { nullOverheadBits(node->valueReader()->type()) / 8; } else if (rowCount == 0) { rowCount = nonNullCount; - } else { + } else if (nonNullCount != 0) { NIMBLE_CHECK( rowCount == nonNullCount, fmt::format( @@ -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::value) { for (const auto& node : this->keyNodes_) {