{"record":{"id":"badebeeb560b1248","repo":"apache/shardingsphere","slug":"chunk-size-is-not-a-valid-number-chunksizete","errorCode":null,"errorMessage":"'chunk-size' is not a valid number: `${chunkSizeText}`","messagePattern":"'chunk-size' is not a valid number: `(.+?)`","errorType":"validation","errorClass":"PipelineInvalidParameterException","httpStatus":null,"severity":"error","filePath":"kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/consistencycheck/table/DataMatchTableDataConsistencyChecker.java","lineNumber":70,"sourceCode":"    \n    private StreamingRangeType streamingRangeType;\n    \n    @Override\n    public void init(final Properties props) {\n        chunkSize = getChunkSize(props);\n        streamingRangeType = getStreamingRangeType(props);\n    }\n    \n    private int getChunkSize(final Properties props) {\n        String chunkSizeText = props.getProperty(CHUNK_SIZE_KEY);\n        if (Strings.isNullOrEmpty(chunkSizeText)) {\n            return DEFAULT_CHUNK_SIZE;\n        }\n        int result;\n        try {\n            result = Integer.parseInt(chunkSizeText);\n        } catch (final NumberFormatException ignore) {\n            throw new PipelineInvalidParameterException(\"'chunk-size' is not a valid number: `\" + chunkSizeText + \"`\");\n        }\n        if (result <= 0) {\n            throw new PipelineInvalidParameterException(\"Invalid 'chunk-size' value: `\" + result + \"`, it should be a positive integer.\");\n        }\n        return result;\n    }\n    \n    private StreamingRangeType getStreamingRangeType(final Properties props) {\n        String streamingRangeTypeText = props.getProperty(STREAMING_RANGE_TYPE_KEY);\n        if (Strings.isNullOrEmpty(streamingRangeTypeText)) {\n            return DEFAULT_STREAMING_RANGE_TYPE;\n        }\n        try {\n            return StreamingRangeType.valueOf(streamingRangeTypeText.toUpperCase());\n        } catch (final IllegalArgumentException ex) {\n            throw new PipelineInvalidParameterException(\"Invalid 'streaming-range-type' value: `\" + streamingRangeTypeText\n                    + \"`, expected values are \" + Arrays.toString(StreamingRangeType.values()));\n        }","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/consistencycheck/table/DataMatchTableDataConsistencyChecker.java#L52-L88","documentation":"DataMatchTableDataConsistencyChecker parses the 'chunk-size' property of the DATA_MATCH consistency-check algorithm configuration. If the value is present but not parseable by Integer.parseInt, a PipelineInvalidParameterException with the offending text is thrown at checker construction time. This is fail-fast validation of algorithm props, not a runtime data error.","triggerScenarios":"Configuring the data consistency check algorithm with props like chunk-size: \"1000\" quoted oddly, chunk-size: 1e4, chunk-size containing whitespace, or a YAML value parsed as a non-integer string; then starting a migration/check job that instantiates the checker.","commonSituations":"Hand-edited distsql or YAML with a typo in chunk-size; environment-variable substitution injecting an empty-but-present or malformed value; upgrading from a version that silently ignored unknown props to one that validates.","solutions":["Set chunk-size to a plain positive integer literal, e.g. chunk-size: 1000 (unquoted in YAML so it stays numeric).","Remove the chunk-size key entirely to fall back to DEFAULT_CHUNK_SIZE if the default is acceptable.","Validate props with a preflight script or unit test that Integer.parseInt's each numeric pipeline prop before deploying."],"exampleFix":"# before (YAML)\nprops:\n  chunk-size: \"1,000\"\n\n# after\nprops:\n  chunk-size: 1000","handlingStrategy":"validation","validationCode":"String chunkSizeText = props.getProperty(\"chunk-size\");\nif (null != chunkSizeText && !chunkSizeText.matches(\"\\\\d+\")) {\n    throw new IllegalArgumentException(\"chunk-size must be numeric, got: \" + chunkSizeText);\n}","typeGuard":null,"tryCatchPattern":"try {\n    checker = new DataMatchTableDataConsistencyChecker(props);\n} catch (final PipelineInvalidParameterException ex) {\n    // surface config error to the operator with ex.getMessage()\n}","preventionTips":["Keep chunk-size unquoted and purely numeric in YAML/DISTSQL props.","Validate all pipeline algorithm props in a pre-deploy lint step.","Never carry commas, units, or expressions into numeric pipeline props."],"tags":["pipeline","consistency-check","configuration","validation"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}