apache/flink · error · UnsupportedOperationException

Sink with pre-write topology is not supported for DataStream

Error message

Sink with pre-write topology is not supported for DataStream v2 atm.

What it means

Error "Sink with pre-write topology is not supported for DataStream v2 atm." thrown in apache/flink.

Source

Thrown at flink-datastream/src/main/java/org/apache/flink/streaming/runtime/translators/DataStreamV2SinkTransformationTranslator.java:186

                    };
            DataStream<CommittableMessage<CommT>> committableMessageDataStream =
                    preCommittingSink.addPreCommitTopology(
                            new DataStream<>(
                                    new StreamExecutionEnvironment(), dummyTransformation));
            return committableMessageDataStream
                    .getExecutionEnvironment()
                    .getTransformations()
                    .isEmpty();
        }

        private void expand() {

            final int sizeBefore = executionEnvironment.getTransformations().size();

            AbstractDataStream<T> prewritten = inputStream;

            if (sink instanceof SupportsPreWriteTopology) {
                throw new UnsupportedOperationException(
                        "Sink with pre-write topology is not supported for DataStream v2 atm.");
            } else if (sink instanceof SupportsPreCommitTopology) {
                if (sink.getClass()
                        .getName()
                        .equals("org.apache.flink.connector.file.sink.FileSink")) {
                    if (!checkSinkDoNotAddCommitTopology(sink)) {
                        throw new UnsupportedOperationException(
                                "Sink with pre-commit topology is not supported for DataStream v2 atm.");
                    }
                } else {
                    throw new UnsupportedOperationException(
                            "Sink with pre-commit topology is not supported for DataStream v2 atm.");
                }
            } else if (sink instanceof SupportsPostCommitTopology) {
                throw new UnsupportedOperationException(
                        "Sink with post-commit topology is not supported for DataStream v2 atm.");
            }

View on GitHub (pinned to 2f3c205e92)

Solutions

  1. Address the cause reported by the error message: Sink with pre-write topology is not supported for DataStream v2 atm.
  2. Verify the inputs, configuration values, and classpath/dependency setup related to this operation, then retry.

Example fix

Correct the condition described ("Sink with pre-write topology is not supported for DataStream v2 atm.") and rerun the job or command.

When it happens

Trigger: Triggered at runtime when the operation fails because: Sink with pre-write topology is not supported for DataStream v2 atm.

Common situations: Commonly caused by misconfiguration, missing dependencies or files, unsupported types or operations, or invalid user input leading to: Sink with pre-write topology is not supported for DataStream v2 atm.


AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14). Data as JSON: /api/errors/f538d991c72d3d39. Report an issue: GitHub.