apache/druid · error · IllegalArgumentException
useJsonNodeReader cannot be set to true when assumeNewlineDe
Error message
useJsonNodeReader cannot be set to true when assumeNewlineDelimited is true.
What it means
JsonInputFormat's constructor forbids combining assumeNewlineDelimited=true with useJsonNodeReader=true. The newline-delimited fast path and the streaming JsonNodeReader path are mutually exclusive implementation strategies, so the format refuses the ambiguous configuration with IAE.
Source
Thrown at processing/src/main/java/org/apache/druid/data/input/impl/JsonInputFormat.java:110
Boolean keepNullColumns,
boolean lineSplittable,
Boolean assumeNewlineDelimited,
Boolean useJsonNodeReader
)
{
super(flattenSpec);
this.featureSpec = featureSpec == null ? Collections.emptyMap() : featureSpec;
this.objectMapper = new ObjectMapper();
this.keepNullColumns = keepNullColumns;
for (Entry<String, Boolean> entry : this.featureSpec.entrySet()) {
Feature feature = Feature.valueOf(entry.getKey());
objectMapper.configure(feature, entry.getValue());
}
this.lineSplittable = lineSplittable;
this.assumeNewlineDelimited = assumeNewlineDelimited != null && assumeNewlineDelimited;
this.useJsonNodeReader = useJsonNodeReader != null && useJsonNodeReader;
if (this.assumeNewlineDelimited && this.useJsonNodeReader) {
throw new IAE("useJsonNodeReader cannot be set to true when assumeNewlineDelimited is true.");
}
}
@JsonProperty
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public Map<String, Boolean> getFeatureSpec()
{
return featureSpec;
}
boolean isLineSplittable()
{
return lineSplittable;
}
public boolean isKeepNullColumns()
{
if (keepNullColumns != null) {View on GitHub (pinned to 9b90983fd2)
Solutions
- Remove "useJsonNodeReader": true if newline-delimited fast parsing is the priority
- Or remove "assumeNewlineDelimited": true if you need the JsonNodeReader
- Keep both flags unset (defaults) unless a specific optimization is required
Example fix
// before
{"type":"json","assumeNewlineDelimited":true,"useJsonNodeReader":true}
// after
{"type":"json","assumeNewlineDelimited":true} Defensive patterns
Strategy: validation
Validate before calling
// Before submitting the JSON inputFormat spec
if (Boolean.TRUE.equals(fmt.get("assumeNewlineDelimited")) && Boolean.TRUE.equals(fmt.get("useJsonNodeReader"))) {
fmt.remove("useJsonNodeReader");
} Try / catch
try { new JsonInputFormat(..., lineSplittable, assumeNewlineDelimited, useJsonNodeReader, ...); } catch (IAE e) { /* drop one flag and rebuild */ } Prevention
- Enable only one JSON performance flag per spec and document why in the template
- Keep a lint rule that flags inputFormat objects containing both booleans as true
When it happens
Trigger: Submitting an inputFormat of type 'json' with both "assumeNewlineDelimited": true and "useJsonNodeReader": true in the spec.
Common situations: Merging two performance-tuned spec templates, each enabling one of the flags; blindly enabling all JSON performance options to speed up ingestion.
Related errors
- Must provide at least one range
- Problem parsing object at prefix[%s]: %s.
- Invalid format specification
- The gRPC query server requires either a Basic or Anonymous a
- Metric [%s] not whitelisted.
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/59a0454be57ede64.
Report an issue: GitHub.