{"record":{"id":"b3865d8745084012","repo":"apache/druid","slug":"no-such-system-field-s","errorCode":null,"errorMessage":"No such system field[%s]","messagePattern":"No such system field\\[(.+?)\\]","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/data/input/impl/systemfield/SystemField.java","lineNumber":60,"sourceCode":"  private final String fieldName;\n  private final ColumnType columnType;\n\n  SystemField(final String fieldName, final ColumnType columnType)\n  {\n    this.fieldName = fieldName;\n    this.columnType = columnType;\n  }\n\n  @JsonCreator\n  public static SystemField fromFieldName(final String fieldName)\n  {\n    for (final SystemField field : values()) {\n      if (field.getFieldName().equals(fieldName)) {\n        return field;\n      }\n    }\n\n    throw new IAE(\"No such system field[%s]\", fieldName);\n  }\n\n  /**\n   * Name of this system field.\n   */\n  @JsonValue\n  public String getFieldName()\n  {\n    return fieldName;\n  }\n\n  /**\n   * Type of this system field.\n   */\n  @SuppressWarnings(\"unused\") // Not used, but still useful for signifying intent\n  public ColumnType getColumnType()\n  {\n    return columnType;","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/data/input/impl/systemfield/SystemField.java#L42-L78","documentation":"SystemField.fromFieldName looks up a system field (such as __partition_column or __file) by its column name and throws this IllegalArgumentException when no registered enum constant matches the given field name.","triggerScenarios":"Referencing a system field column name in an MSQ/ingestion query or spec that does not equal any SystemField's getFieldName(), e.g. a typo like '__parition_column' or an unsupported field name.","commonSituations":"Typoed system field names in SQL queries against external input, copying field names from older Druid versions where names changed, case mismatches.","solutions":["Use an exact supported system field name (e.g. __file, __partition_column)","Check spelling and double-underscore prefix","Consult SystemField enum for the list of valid names in your Druid version"],"exampleFix":"// before\nSELECT __parition_column FROM TABLE(EXTERN(...))\n// after\nSELECT __partition_column FROM TABLE(EXTERN(...))","handlingStrategy":"validation","validationCode":"boolean known = Arrays.stream(SystemField.values()).anyMatch(f -> f.getFieldName().equals(name));","typeGuard":"Optional<SystemField> safeFromFieldName(String n) { try { return Optional.of(SystemField.fromFieldName(n)); } catch (IllegalArgumentException e) { return Optional.empty(); } }","tryCatchPattern":"try { SystemField.fromFieldName(name); } catch (IllegalArgumentException e) { log.error(\"Unknown system field {}\", name); }","preventionTips":["Only use documented system field names like __file and __partition_column","Double-check spelling and the leading double underscore","List SystemField values' fieldNames when unsure"],"tags":["system-field","invalid-enum","sql"],"backgroundTag":"invalid-enum-value","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"}