Skip to content

Commit

Permalink
fix(core) make the error message more frendly to users. (#1593) (#1630)
Browse files Browse the repository at this point in the history
Co-authored-by: Yu Zhang <[email protected]>
(cherry picked from commit 5b05779)
(cherry picked from commit f14a13c)
  • Loading branch information
yu-shipit authored and Yu Zhang committed Aug 14, 2023
1 parent 9bf26ed commit d61e670
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,8 @@ class RecordBuilder(memFactory: MemFactory,
val oldOffset = curRecordOffset
if (reuseOneContainer) resetContainerPointers() else newContainer()
logger.trace(s"Moving $recordNumBytes bytes from end of old container to new container")
require((containerSize - ContainerHeaderLen) > (recordNumBytes + numBytes), "Record too big for container")
require((containerSize - ContainerHeaderLen) > (recordNumBytes + numBytes),
"The intermediate or final result is too big. For queries, please try to add more query filters or time range.")
unsafe.copyMemory(oldBase, oldOffset, curBase, curRecordOffset, recordNumBytes)
if (mapOffset != -1L) mapOffset = curRecordOffset + (mapOffset - oldOffset)
curRecEndOffset = curRecordOffset + recordNumBytes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,9 @@ class MetadataExecSpec extends AnyFunSpec with Matchers with ScalaFutures with B
val resp = execPlan.execute(memStore, querySessionOverridden).runToFuture.futureValue
resp match {
case QueryError(_, _, ex: IllegalArgumentException) =>
ex.getMessage shouldEqual "requirement failed: Record too big for container"
ex.getMessage shouldEqual "requirement failed:" +
" The intermediate or final result is too big. For queries, please try to" +
" add more query filters or time range."
case _ =>
fail(s"Expected to see an exception for exceeding the default " +
s"container limit of ${execPlan.maxRecordContainerSize(queryConfig)}")
Expand Down

0 comments on commit d61e670

Please sign in to comment.