apache/shardingsphere · error · PipelineInvalidParameterException

Invalid 'streaming-range-type' value: `%s`, expected values

Error message

Invalid 'streaming-range-type' value: `%s`, expected values are %s

What it means

DataMatchTableDataConsistencyChecker maps the 'streaming-range-type' property to the StreamingRangeType enum via valueOf after upper-casing. Any value not matching an enum constant (e.g. the documented values listed in the exception via Arrays.toString(StreamingRangeType.values())) throws PipelineInvalidParameterException with the invalid text and the accepted set. Like chunk-size, this fails at checker construction, before any data is compared.

Source

Thrown at kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/consistencycheck/table/DataMatchTableDataConsistencyChecker.java:86

            result = Integer.parseInt(chunkSizeText);
        } catch (final NumberFormatException ignore) {
            throw new PipelineInvalidParameterException("'chunk-size' is not a valid number: `" + chunkSizeText + "`");
        }
        if (result <= 0) {
            throw new PipelineInvalidParameterException("Invalid 'chunk-size' value: `" + result + "`, it should be a positive integer.");
        }
        return result;
    }
    
    private StreamingRangeType getStreamingRangeType(final Properties props) {
        String streamingRangeTypeText = props.getProperty(STREAMING_RANGE_TYPE_KEY);
        if (Strings.isNullOrEmpty(streamingRangeTypeText)) {
            return DEFAULT_STREAMING_RANGE_TYPE;
        }
        try {
            return StreamingRangeType.valueOf(streamingRangeTypeText.toUpperCase());
        } catch (final IllegalArgumentException ex) {
            throw new PipelineInvalidParameterException("Invalid 'streaming-range-type' value: `" + streamingRangeTypeText
                    + "`, expected values are " + Arrays.toString(StreamingRangeType.values()));
        }
    }
    
    @Override
    public TableInventoryChecker buildTableInventoryChecker(final TableInventoryCheckParameter param) {
        return new DataMatchTableInventoryChecker(param, chunkSize, streamingRangeType);
    }
    
    @Override
    public Collection<DatabaseType> getSupportedDatabaseTypes() {
        return ShardingSphereServiceLoader.getServiceInstances(DatabaseType.class);
    }
    
    @Override
    public void close() {
    }
    

View on GitHub (pinned to e952770a21)

Solutions

  1. Read the exception text — it prints the exact accepted values — and set streaming-range-type to one of them (e.g. the default).
  2. Remove the key to use DEFAULT_STREAMING_RANGE_TYPE.
  3. After upgrading ShardingSphere, re-verify pipeline algorithm prop names/values against the release's StreamingRangeType enum.

Example fix

# before
props:
  streaming-range-type: primary_key

# after
props:
  streaming-range-type: ID  # use a value from StreamingRangeType.values()
Defensive patterns

Strategy: validation

Validate before calling

Set<String> valid = Arrays.stream(StreamingRangeType.values()).map(Enum::name).collect(Collectors.toSet());
String value = props.getProperty("streaming-range-type");
if (null != value && !valid.contains(value.toUpperCase())) {
    throw new IllegalArgumentException("streaming-range-type must be one of " + valid);
}

Try / catch

try {
    new DataMatchTableDataConsistencyChecker(props);
} catch (final PipelineInvalidParameterException ex) {
    // message lists accepted values; correct prop and resubmit
}

Prevention

When it happens

Trigger: Setting streaming-range-type: id / random / unknown-token in the DATA_MATCH algorithm props where the enum only accepts its defined constants (compare the message's expected-values list); or a casing/typo variant that does not match even after toUpperCase.

Common situations: Copying streaming-range-type from an older/newer ShardingSphere doc where the enum constants differ across versions; renaming of enum values breaking existing configs after upgrade; guessing a plausible value instead of checking the enum.

Related errors


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