{"record":{"id":"1c9a5a3fbc4d9087","repo":"apache/iceberg","slug":"s-doesn-t-implement-tosnapshot","errorCode":null,"errorMessage":"%s doesn't implement toSnapshot","messagePattern":"(.+?) doesn't implement toSnapshot","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"api/src/main/java/org/apache/iceberg/IncrementalScan.java","lineNumber":99,"sourceCode":"   * <p>If the end snapshot is not configured, it defaults to the current table snapshot\n   * (inclusive).\n   *\n   * @param toSnapshotId the end snapshot ID (inclusive)\n   * @return this for method chaining\n   */\n  ThisT toSnapshot(long toSnapshotId);\n\n  /**\n   * Instructs this scan to look for changes up to a particular snapshot ref (inclusive).\n   *\n   * <p>If the end snapshot is not configured, it defaults to the current table snapshot\n   * (inclusive).\n   *\n   * @param ref the end snapshot Ref (inclusive)\n   * @return this for method chaining\n   */\n  default ThisT toSnapshot(String ref) {\n    throw new UnsupportedOperationException(\n        this.getClass().getName() + \" doesn't implement toSnapshot\");\n  }\n\n  /**\n   * Use the specified branch\n   *\n   * @param branch the branch name\n   * @return this for method chaining\n   */\n  default ThisT useBranch(String branch) {\n    throw new UnsupportedOperationException(\n        this.getClass().getName() + \" doesn't implement useBranch\");\n  }\n}\n","sourceCodeStart":81,"sourceCodeEnd":114,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/api/src/main/java/org/apache/iceberg/IncrementalScan.java#L81-L114","documentation":"Default-interface guard on IncrementalScan: thrown only when the concrete scan implementation did not override toSnapshot, so bounding the scan by an end snapshot is unsupported for that class. The %s names the offending runtime class; the cause is a missing implementation, not invalid arguments.","triggerScenarios":"Thrown at api/src/main/java/org/apache/iceberg/IncrementalScan.java:99 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a scan implementation that supports incremental scans and honors end-snapshot bounds","Catch UnsupportedOperationException and fall back to scanning the current snapshot","Override toSnapshot in the custom scan implementation"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}