diff --git a/processing/src/main/java/io/druid/segment/data/GenericIndexedWriter.java b/processing/src/main/java/io/druid/segment/data/GenericIndexedWriter.java index e13665e555b..d655232ba8d 100644 --- a/processing/src/main/java/io/druid/segment/data/GenericIndexedWriter.java +++ b/processing/src/main/java/io/druid/segment/data/GenericIndexedWriter.java @@ -66,7 +66,7 @@ public class GenericIndexedWriter implements Closeable public void write(T objectToWrite) throws IOException { - if (prevObject != null && strategy.compare(prevObject, objectToWrite) >= 0) { + if (objectsSorted && prevObject != null && strategy.compare(prevObject, objectToWrite) >= 0) { objectsSorted = false; }