{"record":{"id":"094db1c975dcd673","repo":"prestodb/presto","slug":"rewind-is-not-supported-in-this-connectorsplitsour","errorCode":null,"errorMessage":"rewind is not supported in this ConnectorSplitSource","messagePattern":"rewind is not supported in this ConnectorSplitSource","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"presto-spi/src/main/java/com/facebook/presto/spi/ConnectorSplitSource.java","lineNumber":31,"sourceCode":" */\npackage com.facebook.presto.spi;\n\nimport com.facebook.presto.spi.connector.ConnectorPartitionHandle;\n\nimport java.io.Closeable;\nimport java.util.List;\nimport java.util.concurrent.CompletableFuture;\n\nimport static java.util.Objects.requireNonNull;\n\npublic interface ConnectorSplitSource\n        extends Closeable\n{\n    CompletableFuture<ConnectorSplitBatch> getNextBatch(ConnectorPartitionHandle partitionHandle, int maxSize);\n\n    default void rewind(ConnectorPartitionHandle partitionHandle)\n    {\n        throw new UnsupportedOperationException(\"rewind is not supported in this ConnectorSplitSource\");\n    }\n\n    @Override\n    void close();\n\n    /**\n     * Returns whether any more {@link ConnectorSplit} may be produced.\n     * <p>\n     * This method should only be called when there has been no invocation of getNextBatch,\n     * or result Future of previous getNextBatch is done.\n     * Calling this method at other time is not useful because the contract of such an invocation\n     * will be inherently racy.\n     */\n    boolean isFinished();\n\n    class ConnectorSplitBatch\n    {\n        private final List<ConnectorSplit> splits;","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-spi/src/main/java/com/facebook/presto/spi/ConnectorSplitSource.java#L13-L49","documentation":"ConnectorSplitSource.rewind is an optional capability: the interface's default implementation throws UnsupportedOperationException, so split sources that have not overridden rewind cannot go back to re-emit splits for a given partition handle.","triggerScenarios":"Calling rewind on any ConnectorSplitSource implementation that does not override the default rewind method (e.g. a connector's split source built from a simple iterator).","commonSituations":"Query retry logic that asks the split source to rewind after a failure; connectors that do not implement rewindable split sourcing being used in a context that assumes support; code written against a custom split source lacking rewind.","solutions":["Use a ConnectorSplitSource implementation that overrides rewind","Restructure logic to re-create the split source instead of rewinding it","Check rewind support (e.g. instanceof the rewirable type) before calling"],"exampleFix":"// before\nsplitSource.rewind(partitionHandle);\n// after\nsplitSource.close();\nConnectorSplitSource fresh = connector.getSplits(...); // re-create instead","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { splitSource.rewind(partitionHandle); } catch (UnsupportedOperationException e) { splitSource.close(); splitSource = connector.getSplits(txnHandle, session, table, partitionHandle); }","preventionTips":["Assume rewind is unsupported by default for custom split sources","On retry paths, prefer re-creating the split source over rewinding","Implement rewind() in connectors used by rewind-requiring query plans"],"tags":["presto","spi","unsupported-operation","splits"],"backgroundTag":"unsupported-operation","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}