{"record":{"id":"3dc0a529bd7d6585","repo":"apache/iceberg","slug":"this-getclass-getname-does-not-implement-p","errorCode":null,"errorMessage":"this.getClass().getName() + \" does not implement prefixMismatchMode\"","messagePattern":"this\\.getClass\\(\\)\\.getName\\(\\) \\+ \" does not implement prefixMismatchMode\"","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"api/src/main/java/org/apache/iceberg/actions/DeleteOrphanFiles.java","lineNumber":109,"sourceCode":"   * metadata references files that match listed/provided files except for authority/scheme.\n   *\n   * <p>Possible values are \"ERROR\", \"IGNORE\", \"DELETE\". The default mismatch mode is \"ERROR\", which\n   * means an exception is thrown whenever there is a mismatch in authority/scheme. It's the\n   * recommended mismatch mode and should be changed only in some rare circumstances. If there is a\n   * mismatch, use {@link #equalSchemes(Map)} and {@link #equalAuthorities(Map)} to resolve\n   * conflicts by providing equivalent schemes and authorities. If it is impossible to determine\n   * whether the conflicting authorities/schemes are equal, set the prefix mismatch mode to \"IGNORE\"\n   * to skip files with mismatches. If you have manually inspected all conflicting\n   * authorities/schemes, provided equivalent schemes/authorities and are absolutely confident the\n   * remaining ones are different, set the prefix mismatch mode to \"DELETE\" to consider files with\n   * mismatches as orphan. It will be impossible to recover files after deletion, so the \"DELETE\"\n   * prefix mismatch mode must be used with extreme caution.\n   *\n   * @param newPrefixMismatchMode mode for handling prefix mismatches\n   * @return this for method chaining\n   */\n  default DeleteOrphanFiles prefixMismatchMode(PrefixMismatchMode newPrefixMismatchMode) {\n    throw new UnsupportedOperationException(\n        this.getClass().getName() + \" does not implement prefixMismatchMode\");\n  }\n\n  /**\n   * Passes schemes that should be considered equal.\n   *\n   * <p>The key may include a comma-separated list of schemes. For instance, Map(\"s3a,s3,s3n\",\n   * \"s3\").\n   *\n   * @param newEqualSchemes list of equal schemes\n   * @return this for method chaining\n   */\n  default DeleteOrphanFiles equalSchemes(Map<String, String> newEqualSchemes) {\n    throw new UnsupportedOperationException(\n        this.getClass().getName() + \" does not implement equalSchemes\");\n  }\n\n  /**","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/api/src/main/java/org/apache/iceberg/actions/DeleteOrphanFiles.java#L91-L127","documentation":"DeleteOrphanFiles is an action interface whose fluent configuration methods are defaults that throw UnsupportedOperationException. prefixMismatchMode(PrefixMismatchMode) sets how URI prefix mismatches (scheme/authority differences) are handled during orphan file deletion; an action implementation that has not overridden it throws instead of returning the configured action.","triggerScenarios":"Calling deleteOrphanFiles().prefixMismatchMode(...) on an action implementation (e.g., from an older Spark/Flink version or a custom action) that does not override prefixMismatchMode.","commonSituations":"Configuring prefix handling for object-store migrations (S3 to GCS, scheme/authority normalization) while running an older Iceberg engine runtime where the option was not yet implemented; copying config code from newer examples onto an older dependency.","solutions":["Upgrade the engine integration (e.g., iceberg-spark) to a version whose DeleteOrphanFiles implementation supports prefixMismatchMode.","Remove the prefixMismatchMode call if the runtime does not need prefix mismatch handling (default mode ignores/none).","If implementing a custom DeleteOrphanFiles action, override prefixMismatchMode to store and honor the mode."],"exampleFix":"// before\nDeleteOrphanFiles a = actions.deleteOrphanFiles(table).prefixMismatchMode(PrefixMismatchMode.REMOVE); // throws on old impl\n// after (guard by version/capability, or upgrade)\nDeleteOrphanFiles a = SparkActions.get().deleteOrphanFiles(table).prefixMismatchMode(PrefixMismatchMode.REMOVE);","handlingStrategy":"try-catch","validationCode":"// upgrade check: ensure the action impl overrides prefixMismatchMode\nboolean ok = Arrays.stream(deleteOrphanFiles.getClass().getMethods()).anyMatch(m -> \"prefixMismatchMode\".equals(m.getName()) && m.getDeclaringClass() != DeleteOrphanFiles.class);","typeGuard":"boolean implemented = deleteOrphanFiles.getClass() != DeleteOrphanFiles.class;","tryCatchPattern":"try { action = action.prefixMismatchMode(PrefixMismatchMode.REMOVE); } catch (UnsupportedOperationException e) { action = action; /* proceed with default mode */ }","preventionTips":["Only configure prefixMismatchMode on runtimes whose Iceberg version supports it","Check the release notes of your engine integration for prefix handling support"],"tags":["java","iceberg","unsupported-operation","fluent-builder"],"backgroundTag":"method-not-implemented","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}