apache/shardingsphere · error · UnsupportedOperationException

Build data consistency checker is not supported.

Error message

Build data consistency checker is not supported.

What it means

PipelineJobType is a SPI interface for pipeline job types (migration, cluster migration, etc.). Its default buildDataConsistencyChecker(...) implementation throws UnsupportedOperationException, meaning the installed job type does not support data consistency checking. Only job types that can construct a PipelineDataConsistencyChecker override the method.

Source

Thrown at kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/job/type/PipelineJobType.java:67

     * Get pipeline job target.
     *
     * @param jobConfig pipeline job configuration
     * @return pipeline job target
     */
    PipelineJobTarget getJobTarget(T jobConfig);
    
    /**
     * Build pipeline data consistency checker.
     *
     * @param jobConfig pipeline job configuration
     * @param processContext process context
     * @param progressContext consistency check job item progress context
     * @return all logic tables check result
     * @throws UnsupportedOperationException unsupported operation exception
     */
    default PipelineDataConsistencyChecker buildDataConsistencyChecker(final T jobConfig,
                                                                       final TransmissionProcessContext processContext, final ConsistencyCheckJobItemProgressContext progressContext) {
        throw new UnsupportedOperationException("Build data consistency checker is not supported.");
    }
    
    @Override
    String getType();
    
    @Override
    default Collection<Object> getTypeAliases() {
        return Collections.singleton(getOption().getCode());
    }
}

View on GitHub (pinned to e952770a21)

Solutions

  1. Run the consistency check with a job type that supports it (the standard migration job type), not the unsupported one.
  2. If you own the SPI implementation, override buildDataConsistencyChecker to return a PipelineDataConsistencyChecker.
  3. Disable/skip the consistency-check step for job types that legitimately lack it, and validate data by another means.

Example fix

// before (custom PipelineJobType without the method)
public final class MyJobType implements PipelineJobType<MyJobConfig> { ... }

// after
@Override
public PipelineDataConsistencyChecker buildDataConsistencyChecker(final MyJobConfig config,
        final TransmissionProcessContext processContext, final ConsistencyCheckJobItemProgressContext progressContext) {
    return new PipelineDataConsistencyChecker(...); // real checker wiring
}
Defensive patterns

Strategy: validation

Validate before calling

PipelineJobType<?> jobType = /* resolved SPI */;
// inspect before invoking check flow
Method m = jobType.getClass().getMethod("buildDataConsistencyChecker",
        PipelineJobConfig.class, TransmissionProcessContext.class, ConsistencyCheckJobItemProgressContext.class);
boolean supported = m.getDeclaringClass() != PipelineJobType.class;

Try / catch

try {
    checker = jobType.buildDataConsistencyChecker(config, processContext, progressContext);
} catch (final UnsupportedOperationException ex) {
    // job type has no checker: fall back to external comparison or skip check
}

Prevention

When it happens

Trigger: Invoking a consistency-check flow (e.g. MIGRATE ... WITH (DATA_CONSISTENCY_CHECK...) or the check API) on a job type whose PipelineJobType implementation did not override buildDataConsistencyChecker.

Common situations: Using a third-party or custom PipelineJobType SPI implementation that omits the method; triggering consistency check on a job type that by design has no checker (e.g. an import/export-only type); version upgrade where the default method was added and old SPI impls never overrode it.

Related errors


AI-assisted analysis of apache/shardingsphere@e952770a21 (2026-08-14). Data as JSON: /api/errors/8a2c9c10d7388794. Report an issue: GitHub.