{"record":{"id":"59a0454be57ede64","repo":"apache/druid","slug":"usejsonnodereader-cannot-be-set-to-true-when-assum","errorCode":null,"errorMessage":"useJsonNodeReader cannot be set to true when assumeNewlineDelimited is true.","messagePattern":"useJsonNodeReader cannot be set to true when assumeNewlineDelimited is true\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/data/input/impl/JsonInputFormat.java","lineNumber":110,"sourceCode":"      Boolean keepNullColumns,\n      boolean lineSplittable,\n      Boolean assumeNewlineDelimited,\n      Boolean useJsonNodeReader\n  )\n  {\n    super(flattenSpec);\n    this.featureSpec = featureSpec == null ? Collections.emptyMap() : featureSpec;\n    this.objectMapper = new ObjectMapper();\n    this.keepNullColumns = keepNullColumns;\n    for (Entry<String, Boolean> entry : this.featureSpec.entrySet()) {\n      Feature feature = Feature.valueOf(entry.getKey());\n      objectMapper.configure(feature, entry.getValue());\n    }\n    this.lineSplittable = lineSplittable;\n    this.assumeNewlineDelimited = assumeNewlineDelimited != null && assumeNewlineDelimited;\n    this.useJsonNodeReader = useJsonNodeReader != null && useJsonNodeReader;\n    if (this.assumeNewlineDelimited && this.useJsonNodeReader) {\n      throw new IAE(\"useJsonNodeReader cannot be set to true when assumeNewlineDelimited is true.\");\n    }\n  }\n\n  @JsonProperty\n  @JsonInclude(JsonInclude.Include.NON_EMPTY)\n  public Map<String, Boolean> getFeatureSpec()\n  {\n    return featureSpec;\n  }\n\n  boolean isLineSplittable()\n  {\n    return lineSplittable;\n  }\n\n  public boolean isKeepNullColumns()\n  {\n    if (keepNullColumns != null) {","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/data/input/impl/JsonInputFormat.java#L92-L128","documentation":"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.","triggerScenarios":"Submitting an inputFormat of type 'json' with both \"assumeNewlineDelimited\": true and \"useJsonNodeReader\": true in the spec.","commonSituations":"Merging two performance-tuned spec templates, each enabling one of the flags; blindly enabling all JSON performance options to speed up ingestion.","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"],"exampleFix":"// before\n{\"type\":\"json\",\"assumeNewlineDelimited\":true,\"useJsonNodeReader\":true}\n// after\n{\"type\":\"json\",\"assumeNewlineDelimited\":true}","handlingStrategy":"validation","validationCode":"// Before submitting the JSON inputFormat spec\nif (Boolean.TRUE.equals(fmt.get(\"assumeNewlineDelimited\")) && Boolean.TRUE.equals(fmt.get(\"useJsonNodeReader\"))) {\n    fmt.remove(\"useJsonNodeReader\");\n}","typeGuard":null,"tryCatchPattern":"try { new JsonInputFormat(..., lineSplittable, assumeNewlineDelimited, useJsonNodeReader, ...); } catch (IAE e) { /* drop one flag and rebuild */ }","preventionTips":["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"],"tags":["json","configuration"],"backgroundTag":"mutually-exclusive-options","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}