{"record":{"id":"40ccf0ad8fbaa5ff","repo":"apache/iceberg","slug":"getconf-is-not-implemented","errorCode":null,"errorMessage":"getConf is not implemented","messagePattern":"getConf is not implemented","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/hadoop/HadoopConfigurable.java","lineNumber":62,"sourceCode":"      Function<Configuration, SerializableSupplier<Configuration>> confSerializer);\n\n  /**\n   * Set the configuration to be used by this object.\n   *\n   * @param conf configuration to be used\n   */\n  @Override\n  default void setConf(Configuration conf) {\n    throw new UnsupportedOperationException(\"setConf is not implemented\");\n  }\n\n  /**\n   * Return the configuration used by this object.\n   *\n   * @return Configuration\n   */\n  default Configuration getConf() {\n    throw new UnsupportedOperationException(\"getConf is not implemented\");\n  }\n}\n","sourceCodeStart":44,"sourceCodeEnd":65,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/hadoop/HadoopConfigurable.java#L44-L65","documentation":"HadoopConfigurable's default getConf throws UnsupportedOperationException. Any implementation that did not override getConf (or never had a Configuration set) fails when a caller tries to read the configuration, e.g. HadoopFileIO.deleteFile internally uses getConf() to resolve the FileSystem.","triggerScenarios":"Calling getConf() on a HadoopConfigurable subclass that does not override it, or calling operations like deleteFile on a HadoopFileIO that was deserialized/instantiated without a Configuration being set.","commonSituations":"Custom FileIO implementations extending HadoopConfigurable without implementing both accessors; objects created reflectively without going through the setConf lifecycle; using a FileIO after Kryo/Java deserialization into an environment where conf injection was skipped.","solutions":["Override getConf in your implementation to return the stored Configuration.","Ensure setConf is invoked before any operation that calls getConf.","Use HadoopFileIO directly (which implements both) rather than subclassing HadoopConfigurable minimally."],"exampleFix":"// before\nclass MyFileIO extends HadoopConfigurable { /* no getConf override */ }\n// after\nclass MyFileIO extends HadoopConfigurable {\n  private Configuration conf;\n  @Override public void setConf(Configuration conf) { this.conf = conf; }\n  @Override public Configuration getConf() { return conf; }\n}","handlingStrategy":"type-guard","validationCode":"// ensure setConf was called at least once before relying on getConf()/file operations","typeGuard":"if (obj instanceof HadoopFileIO) { /* getConf is implemented */ } else { /* avoid getConf */ }","tryCatchPattern":"try {\n  Configuration conf = obj.getConf();\n} catch (UnsupportedOperationException e) {\n  LOG.error(\"{} does not implement getConf\", obj.getClass().getName());\n}","preventionTips":["Always pair setConf with getConf when implementing HadoopConfigurable.","Use HadoopFileIO rather than minimal HadoopConfigurable subclasses where possible.","Beware deserialized FileIO objects: re-inject configuration before use."],"tags":["unsupported","hadoop","configuration"],"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-14T16:17:12.679Z"}