{"record":{"id":"d8d17d43d1280888","repo":"apache/druid","slug":"unknown-file-type-s","errorCode":null,"errorMessage":"Unknown file type[%s]","messagePattern":"Unknown file type\\[(.+?)\\]","errorType":"exception","errorClass":"SegmentLoadingException","httpStatus":null,"severity":"error","filePath":"extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsDataSegmentKiller.java","lineNumber":78,"sourceCode":"    }\n  }\n\n  private static Path getPath(DataSegment segment)\n  {\n    return new Path(String.valueOf(segment.getLoadSpec().get(PATH_KEY)));\n  }\n\n  @Override\n  public void kill(DataSegment segment) throws SegmentLoadingException\n  {\n    final Path segmentPath = getPath(segment);\n    log.info(\"Killing segment[%s] mapped to path[%s]\", segment.getId(), segmentPath);\n\n    try (final FileSystem fs = segmentPath.getFileSystem(config)) {\n      final String filename = segmentPath.getName();\n      final CompressionUtils.Format compressionFormat = CompressionUtils.Format.fromFileName(filename);\n      if (compressionFormat != CompressionUtils.Format.ZIP && compressionFormat != CompressionUtils.Format.LZ4) {\n        throw new SegmentLoadingException(\"Unknown file type[%s]\", segmentPath);\n      } else {\n\n        if (!fs.exists(segmentPath)) {\n          log.warn(\"Segment path [%s] does not exist\", segmentPath);\n          return;\n        }\n\n        // There are 3 supported path formats for each segment compression format:\n        //    - hdfs://nn1/hdfs_base_directory/data_source_name/interval/version/shardNum/index.zip\n        //    - hdfs://nn1/hdfs_base_directory/data_source_name/interval/version/shardNum_index.zip\n        //    - hdfs://nn1/hdfs_base_directory/data_source_name/interval/version/shardNum_UUID_index.zip\n        // The same formats with an index.lz4 suffix are also supported.\n        final String[] segmentParts = filename.split(\"_\");\n\n        Path descriptorPath = new Path(segmentPath.getParent(), \"descriptor.json\");\n        if (segmentParts.length > 1) {\n          Preconditions.checkState(segmentParts.length <= 3 &&\n                                   StringUtils.isNumeric(segmentParts[0]) &&","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-core/hdfs-storage/src/main/java/org/apache/druid/storage/hdfs/HdfsDataSegmentKiller.java#L60-L96","documentation":"HdfsDataSegmentKiller.kill deletes a segment's files on HDFS. It inspects the segment file name via CompressionUtils.Format.fromFileName and only knows how to kill ZIP and LZ4-compressed segments; anything else (including non-compressed or unrecognized names) raises this SegmentLoadingException. The killer intentionally refuses formats it cannot safely remove.","triggerScenarios":"Calling kill() on a segment whose path filename does not resolve to .zip or .lz4 — e.g. a directory-style or uncompressed segment, a renamed file, or a custom deep-storage layout.","commonSituations":"Segments written by very old Druid versions or migrated from other deep storage layouts; manually renamed/moved segment files on HDFS; metadata store entries pointing at non-standard paths; users invoking kill API on unsupported segment shapes.","solutions":["Inspect the actual file at the segment path (hdfs dfs -ls) to see its real naming/format.","If it is a plain directory or unsupported layout, delete it manually with hdfs dfs -rm -r after confirming no coordinator use.","Verify the segment's loadSpec/payload in the metadata store matches the on-disk file; fix stale entries.","Keep only ZIP/LZ4 segments under HDFS deep storage, or re-ingest/re-compact segments into the supported layout.","Catch SegmentLoadingException in tooling and skip such segments rather than aborting a kill batch."],"exampleFix":"// before\nkiller.kill(segment); // throws for non-zip/lz4\n// after\ntry {\n  killer.kill(segment);\n} catch (SegmentLoadingException e) {\n  log.warn(\"Skipping segment %s: %s\", segment.getId(), e.getMessage());\n  FileSystem fs = segmentPath.getFileSystem(config);\n  fs.delete(segmentPath, true); // manual removal if verified\n}","handlingStrategy":"fallback","validationCode":"CompressionUtils.Format f = CompressionUtils.Format.fromFileName(new Path(path).getName());\nboolean killable = f == CompressionUtils.Format.ZIP || f == CompressionUtils.Format.LZ4;","typeGuard":null,"tryCatchPattern":"try { killer.kill(segment); }\ncatch (SegmentLoadingException e) {\n  log.warn(\"Unsupported segment layout, manual cleanup needed: %s\", e.getMessage());\n}","preventionTips":["Only store ZIP/LZ4-compressed segments on HDFS deep storage.","Check the on-disk filename before calling kill in cleanup tooling.","Keep metadata-store loadSpecs in sync with real paths.","Skip-and-report unsupported segments in batch kill jobs instead of aborting."],"tags":["hdfs","segment-kill","compression","unsupported-format"],"backgroundTag":"file-not-found","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}