Skip to content

Commit e99c1c5

Browse files
amitkduttafacebook-github-bot
authored andcommitted
misc: Throw spill limit error in validateSpillBytesSize
Summary: Throwing spilling exception to properly catagorize spilling issues. Differential Revision: D71249799
1 parent ce890ec commit e99c1c5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

velox/exec/Spill.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,12 @@ void SpillState::setPartitionSpilled(uint32_t partition) {
133133
void SpillState::validateSpillBytesSize(uint64_t bytes) {
134134
static constexpr uint64_t kMaxSpillBytesPerWrite =
135135
std::numeric_limits<int32_t>::max();
136-
VELOX_CHECK_LT(bytes, kMaxSpillBytesPerWrite, "Spill bytes will overflow.");
136+
if (bytes >= kMaxSpillBytesPerWrite) {
137+
VELOX_SPILL_LIMIT_EXCEEDED(fmt::format(
138+
"Spill bytes will overflow. Bytes {}, kMaxSpillBytesPerWrite: {}",
139+
bytes,
140+
kMaxSpillBytesPerWrite));
141+
}
137142
}
138143

139144
void SpillState::updateSpilledInputBytes(uint64_t bytes) {

0 commit comments

Comments
 (0)