apache/seatunnel · error · UnsupportedOperationException

PostHog source connector only supports batch mode

Error message

PostHog source connector only supports batch mode

What it means

The PostHog source connector only supports batch mode. Its getBoundedness() implementation throws UnsupportedOperationException when job mode is not BATCH; unlike Gitlab/Jira it throws proactively even in the check, returning BOUNDED only for batch jobs. It is invoked during job initialization and by tests like shouldRequireStreamingModeWithCheckpointing.

Source

Thrown at seatunnel-connectors-v2/connector-http/connector-http-posthog/src/main/java/org/apache/seatunnel/connectors/seatunnel/posthog/source/PostHogSource.java:62

    public PostHogSource(ReadonlyConfig pluginConfig) {
        sourceParameter.buildWithConfig(pluginConfig);
        catalogTable = CatalogTableUtil.buildWithConfig(pluginConfig);
    }

    @Override
    public String getPluginName() {
        return PLUGIN_NAME;
    }

    @Override
    public void setJobContext(JobContext jobContext) {
        this.jobContext = jobContext;
    }

    @Override
    public Boundedness getBoundedness() {
        if (!JobMode.BATCH.equals(jobContext.getJobMode())) {
            throw new UnsupportedOperationException(
                    "PostHog source connector only supports batch mode");
        }
        return Boundedness.BOUNDED;
    }

    @Override
    public List<CatalogTable> getProducedCatalogTables() {
        return Collections.singletonList(catalogTable);
    }

    @Override
    public AbstractSingleSplitReader<SeaTunnelRow> createReader(
            SingleSplitReaderContext readerContext) {
        return new PostHogSourceReader(
                sourceParameter,
                readerContext,
                new JsonDeserializationSchema(catalogTable, false, false),
                catalogTable.getSeaTunnelRowType());

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Set job.mode = BATCH in the env block of the job config.
  2. Schedule the batch PostHog export job periodically (cron/airflow) instead of running it in streaming mode.
  3. Switch to a connector with genuine streaming support if continuous ingestion is required.

Example fix

// before
env {
  job.mode = "STREAMING"
}

// after
env {
  job.mode = "BATCH"
}
Defensive patterns

Strategy: validation

Validate before calling

String jobMode = config.getString("job.mode");
if (!"BATCH".equalsIgnoreCase(jobMode)) {
    throw new IllegalArgumentException("PostHog source requires job.mode = BATCH, got: " + jobMode);
}

Prevention

When it happens

Trigger: Submitting a SeaTunnel job with job.mode = STREAMING (or any non-BATCH mode) using the PostHog source; getBoundedness() is called at startup and throws immediately.

Common situations: Using a streaming template config with PostHog as source, or assuming the PostHog export API supports continuous polling.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/ed21c6b2d25beb56. Report an issue: GitHub.