{"record":{"id":"e945dc588826eeb6","repo":"apache/druid","slug":"failed-to-read-data-for-s","errorCode":null,"errorMessage":"Failed to read data for [%s]","messagePattern":"Failed to read data for \\[(.+?)\\]","errorType":"exception","errorClass":"RE","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java","lineNumber":1230,"sourceCode":"        throw DruidException.defensive(\"Unsupported BitmapIndexType[%s]\", indexType);\n      }\n\n      columnBuilder.setDictionaryEncodedColumnSupplier(() -> closer.register(new NestedFieldDictionaryEncodedColumn(\n          types,\n          longs.get(),\n          doubles.get(),\n          ints.get(),\n          stringDictionarySupplier.get(),\n          longDictionarySupplier.get(),\n          doubleDictionarySupplier.get(),\n          arrayDictionarySupplier != null ? arrayDictionarySupplier.get() : null,\n          localDictionarySupplier.get(),\n          nullBitmap\n      )));\n      return columnBuilder.build();\n    }\n    catch (IOException ex) {\n      throw new RE(ex, \"Failed to read data for [%s]\", field);\n    }\n  }\n\n  private static final class IntTypeStrategy implements TypeStrategy<Integer>\n  {\n    @Override\n    public int estimateSizeBytes(Integer value)\n    {\n      return Integer.BYTES;\n    }\n\n    @Override\n    public Integer read(ByteBuffer buffer)\n    {\n      return buffer.getInt();\n    }\n\n    @Override","sourceCodeStart":1212,"sourceCodeEnd":1248,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java#L1212-L1248","documentation":"CompressedNestedDataComplexColumn's field-reading code wraps IOExceptions from reading compressed dictionaries, bitmaps, or value data into RE 'Failed to read data for [%s]'. It means the nested field's on-disk data could not be read/deserialized.","triggerScenarios":"Constructing the column (loadField path) when reading any nested field file raises IOException — truncated files, corrupt compression blocks, or unreadable mmap regions.","commonSituations":"Truncated segment files from failed deep-storage download; disk/NFS I/O errors; incompatible segment format from a different writer version.","solutions":["Re-download the segment from deep storage to replace truncated files","Check underlying disk/NFS health for I/O errors","Confirm writer/reader Druid version compatibility for nested columns","Re-ingest the segment if data is corrupt"],"exampleFix":"// before\n// failing repeatedly on corrupt field file\nColumnHolder c = columnBuilder.build();\n// after\ntry { c = columnBuilder.build(); } catch (RE e) { cache.drop(segmentId); /* refetch */ throw e; }","handlingStrategy":"try-catch","validationCode":"try (InputStream in = openFieldFile(fieldFileName)) { /* read fully to validate before handing to column */ byte[] all = in.readAllBytes(); if (all.length < expectedMinBytes) throw new IOException(\"truncated field file\"); }","typeGuard":"boolean fieldFileReadable(File f) { return f != null && f.isFile() && f.length() > 0 && f.canRead(); }","tryCatchPattern":"try { col = buildColumn(...); } catch (RE e) { log.error(e, \"Failed reading nested field %s\", field); cacheCleaner.cleanup(segmentDir); throw e; }","preventionTips":["Watch NFS/disk I/O error rates on historicals","Validate deep-storage object sizes after download","Re-ingest segments that repeatedly fail field reads"],"tags":["nested-column","io-exception","segment"],"backgroundTag":"file-read-failed","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}