{"record":{"id":"5ed03bfafc3c0eee","repo":"apache/beam","slug":"unexpected-standardresolveoptions-s-hadoopresourceid","errorCode":null,"errorMessage":"Unexpected StandardResolveOptions %s","messagePattern":"Unexpected StandardResolveOptions (.+?)","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"sdks/java/io/hadoop-file-system/src/main/java/org/apache/beam/sdk/io/hdfs/HadoopResourceId.java","lineNumber":55,"sourceCode":"\n  HadoopResourceId(URI uri) {\n    this.uri = uri;\n  }\n\n  @Override\n  public ResourceId resolve(String other, ResolveOptions resolveOptions) {\n    checkState(\n        isDirectory(), String.format(\"Expected this resource is a directory, but had [%s].\", uri));\n    if (resolveOptions == StandardResolveOptions.RESOLVE_DIRECTORY) {\n      if (!other.endsWith(\"/\")) {\n        other += \"/\";\n      }\n      return new HadoopResourceId(uri.resolve(other));\n    } else if (resolveOptions == StandardResolveOptions.RESOLVE_FILE) {\n      checkArgument(!other.endsWith(\"/\"), \"Resolving a file with a directory path: %s\", other);\n      return new HadoopResourceId(uri.resolve(other));\n    } else {\n      throw new UnsupportedOperationException(\n          String.format(\"Unexpected StandardResolveOptions %s\", resolveOptions));\n    }\n  }\n\n  @Override\n  public ResourceId getCurrentDirectory() {\n    return new HadoopResourceId(uri.getPath().endsWith(\"/\") ? uri : uri.resolve(\".\"));\n  }\n\n  @Override\n  public boolean isDirectory() {\n    return uri.getPath().endsWith(\"/\");\n  }\n\n  @Override\n  public String getFilename() {\n    if (isDirectory()) {\n      Path parentPath = new Path(uri).getParent();","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/io/hadoop-file-system/src/main/java/org/apache/beam/sdk/io/hdfs/HadoopResourceId.java#L37-L73","documentation":"HadoopResourceId.resolve() only supports RESOLVE_DIRECTORY and RESOLVE_FILE among StandardResolveOptions; any other option triggers an UnsupportedOperationException. It signals that the requested resolve mode has no Hadoop-URI equivalent.","triggerScenarios":"Calling resourceId.resolve(child, someStandardResolveOption) with an option other than RESOLVE_DIRECTORY or RESOLVE_FILE — currently no third option exists in the standard enum, so this is effectively defensive/unreachable except via nonstandard or future options.","commonSituations":"Custom FileSystems/matchers passing their own resolve options; code written against a newer Beam API introducing a new StandardResolveOptions constant but running against this HadoopResourceId implementation; generic filesystem abstraction layers forwarding unknown options.","solutions":["Use only StandardResolveOptions.RESOLVE_DIRECTORY or RESOLVE_FILE when resolving against HadoopResourceId.","Check the Beam SDK version alignment: if using a newly added resolve option, upgrade the hadoop-file-system module or avoid it for Hadoop-based resource IDs.","Wrap resolve calls to validate the option and fall back to RESOLVE_DIRECTORY semantics where appropriate."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"checkArgument(resolveOption == StandardResolveOptions.RESOLVE_DIRECTORY || resolveOption == StandardResolveOptions.RESOLVE_FILE, \"Unsupported resolve option: %s\", resolveOption);","typeGuard":"null","tryCatchPattern":"try { return resourceId.resolve(child, option); } catch (UnsupportedOperationException e) { return resourceId.resolve(child, StandardResolveOptions.RESOLVE_DIRECTORY); }","preventionTips":["Only pass RESOLVE_DIRECTORY or RESOLVE_FILE for Hadoop resource IDs","Keep Beam SDK module versions aligned","Abstract resolve options behind a helper that validates against supported values"],"tags":["java","filesystem","unsupported-operation","beam"],"backgroundTag":"unsupported-operation","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}