Skip to content
Open
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
5 changes: 5 additions & 0 deletions dwio/nimble/velox/FieldWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1614,6 +1614,11 @@ class FlatMapFieldWriter : public FieldWriter {
NIMBLE_CHECK(
currentValueFields_.empty() && allValueFields_.empty(),
"Mixing map and flatmap vectors in the FlatMapFieldWriter is not supported");
// Mark that we have passthrough flatmap writes (ROW vector written as MAP).
// This is used to skip the raw size check in writeColumnStats() since
// getRawSizeFromVector doesn't properly align with column stats collection
// for passthrough flatmaps.
context_.setHasPassthroughFlatMapWrites(true);
const auto& rowVector = vector->as<velox::RowVector>();
NIMBLE_CHECK_NOT_NULL(
rowVector,
Expand Down
11 changes: 11 additions & 0 deletions dwio/nimble/velox/FieldWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,14 @@ class FieldWriterContext {
ignoreTopLevelNulls_ = value;
}

inline bool hasPassthroughFlatMapWrites() const {
return hasPassthroughFlatMapWrites_;
}

inline void setHasPassthroughFlatMapWrites(bool value) {
hasPassthroughFlatMapWrites_ = value;
}

inline std::unique_ptr<InputBufferGrowthPolicy>& inputBufferGrowthPolicy() {
return inputBufferGrowthPolicy_;
}
Expand Down Expand Up @@ -424,6 +432,9 @@ class FieldWriterContext {
folly::F14FastSet<uint32_t> deduplicatedMapNodeIds_;
bool ignoreTopLevelNulls_{false};
bool disableSharedStringBuffers_{false};
// Set to true when a flatmap passthrough write is detected
// (ROW vector written as MAP via flatMapColumns configuration).
bool hasPassthroughFlatMapWrites_{false};

std::unique_ptr<InputBufferGrowthPolicy> inputBufferGrowthPolicy_;
std::unique_ptr<InputBufferGrowthPolicy> stringBufferGrowthPolicy_;
Expand Down
Loading