You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by ab...@apache.org on 2025/12/16 02:46:52 UTC
(druid) branch column_name_smoosher_error created (now 57af3d6472b)
This is an automated email from the ASF dual-hosted git repository.
abhishekrb pushed a change to branch column_name_smoosher_error
in repository https://gitbox.apache.org/repos/asf/druid.git
at 57af3d6472b Improve error message when serialized bytes exceeds smoosher's max
This branch includes the following new commits:
new 57af3d6472b Improve error message when serialized bytes exceeds smoosher's max
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
(druid) 01/01: Improve error message when serialized bytes exceeds smoosher's max
Posted by ab...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
abhishekrb pushed a commit to branch column_name_smoosher_error
in repository https://gitbox.apache.org/repos/asf/druid.git
commit 57af3d6472b70ad48bed26e26144c5b488589e88
Author: Abhishek Balaji Radhakrishnan <ab...@gmail.com>
AuthorDate: Mon Dec 15 18:45:36 2025 -0800
Improve error message when serialized bytes exceeds smoosher's max
- Include column name and a suggestion on how to remediate
---
.../java/util/common/io/smoosh/FileSmoosher.java | 9 ++++++++-
.../util/common/io/smoosh/SmooshedFileMapperTest.java | 19 +++++++++++++++++++
2 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/processing/src/main/java/org/apache/druid/java/util/common/io/smoosh/FileSmoosher.java b/processing/src/main/java/org/apache/druid/java/util/common/io/smoosh/FileSmoosher.java
index 1d1bed181df..2c8d8bec13d 100644
--- a/processing/src/main/java/org/apache/druid/java/util/common/io/smoosh/FileSmoosher.java
+++ b/processing/src/main/java/org/apache/druid/java/util/common/io/smoosh/FileSmoosher.java
@@ -23,6 +23,7 @@ import com.google.common.base.Joiner;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import com.google.common.primitives.Ints;
+import org.apache.druid.error.DruidException;
import org.apache.druid.java.util.common.FileUtils;
import org.apache.druid.java.util.common.IAE;
import org.apache.druid.java.util.common.IOE;
@@ -158,7 +159,13 @@ public class FileSmoosher implements SegmentFileBuilder
public SmooshedWriter addWithSmooshedWriter(final String name, final long size) throws IOException
{
if (size > maxChunkSize) {
- throw new IAE("Asked to add buffers[%,d] larger than configured max[%,d]", size, maxChunkSize);
+ throw DruidException.forPersona(DruidException.Persona.ADMIN)
+ .ofCategory(DruidException.Category.RUNTIME_FAILURE)
+ .build("Serialized buffer size[%,d] for column[%s] exceeds the maximum[%,d]. "
+ + "Consider adjusting the tuningConfig - for example, reduce maxRowsPerSegment, "
+ + "or partition your data further.",
+ size, name, maxChunkSize
+ );
}
// If current writer is in use then create a new SmooshedWriter which
diff --git a/processing/src/test/java/org/apache/druid/java/util/common/io/smoosh/SmooshedFileMapperTest.java b/processing/src/test/java/org/apache/druid/java/util/common/io/smoosh/SmooshedFileMapperTest.java
index 11660f6d3b5..3d8c01d1af9 100644
--- a/processing/src/test/java/org/apache/druid/java/util/common/io/smoosh/SmooshedFileMapperTest.java
+++ b/processing/src/test/java/org/apache/druid/java/util/common/io/smoosh/SmooshedFileMapperTest.java
@@ -22,10 +22,13 @@ package org.apache.druid.java.util.common.io.smoosh;
import com.google.common.io.Files;
import com.google.common.primitives.Ints;
import junit.framework.Assert;
+import org.apache.druid.error.DruidException;
+import org.apache.druid.error.DruidExceptionMatcher;
import org.apache.druid.java.util.common.BufferUtils;
import org.apache.druid.java.util.common.ISE;
import org.apache.druid.java.util.common.StringUtils;
import org.apache.druid.segment.file.SegmentFileChannel;
+import org.hamcrest.MatcherAssert;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
@@ -80,6 +83,22 @@ public class SmooshedFileMapperTest
validateOutput(baseDir);
}
+ @Test
+ public void testColumnSerializedSizeExceedsMaximum() throws Exception
+ {
+ File baseDir = folder.newFolder("base");
+ try (FileSmoosher smoosher = new FileSmoosher(baseDir, 5)) {
+ MatcherAssert.assertThat(
+ org.junit.Assert.assertThrows(
+ DruidException.class,
+ () -> smoosher.addWithChannel("foo", 10)
+ ),
+ new DruidExceptionMatcher(DruidException.Persona.ADMIN, DruidException.Category.RUNTIME_FAILURE, "general")
+ .expectMessageContains("Serialized buffer size[10] for column[foo] exceeds the maximum[5].")
+ );
+ }
+ }
+
@Test(expected = ISE.class)
public void testExceptionForUnClosedFiles() throws Exception
{
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org