{"record":{"id":"987afdac80fc1f3a","repo":"apache/seatunnel","slug":"name-must-not-exceed-dryrunsampleconfig-max-l","errorCode":null,"errorMessage":"${name} must not exceed ${DryRunSampleConfig.MAX_LIMIT}.","messagePattern":"(.+?) must not exceed (.+?)\\.","errorType":"validation","errorClass":"ParameterException","httpStatus":null,"severity":"error","filePath":"seatunnel-core/seatunnel-starter/src/main/java/org/apache/seatunnel/core/starter/seatunnel/args/ClientCommandArgs.java","lineNumber":315,"sourceCode":"\n    private void validateSampleOptions() {\n        if (dryRun != DryRun.SAMPLE && (sampleLimit != null || samplePrintData)) {\n            throw new ParameterException(\n                    \"--sample-limit and --sample-print-data require --dry-run sample.\");\n        }\n    }\n\n    /** Validates that a sample limit is between 1 and {@link DryRunSampleConfig#MAX_LIMIT}. */\n    public static class PositiveIntegerValidator implements IParameterValidator {\n        @Override\n        public void validate(String name, String value) throws ParameterException {\n            try {\n                int limit = Integer.parseInt(value);\n                if (limit < 1) {\n                    throw new ParameterException(name + \" must be greater than zero.\");\n                }\n                if (limit > DryRunSampleConfig.MAX_LIMIT) {\n                    throw new ParameterException(\n                            name + \" must not exceed \" + DryRunSampleConfig.MAX_LIMIT + \".\");\n                }\n            } catch (NumberFormatException e) {\n                throw new ParameterException(name + \" must be an integer.\", e);\n            }\n        }\n    }\n\n    public static class SeaTunnelMasterTargetConverter implements IStringConverter<MasterType> {\n        private static final List<MasterType> MASTER_TYPE_LIST = new ArrayList<>();\n\n        static {\n            MASTER_TYPE_LIST.add(MasterType.LOCAL);\n            MASTER_TYPE_LIST.add(MasterType.CLUSTER);\n        }\n\n        @Override\n        public MasterType convert(String value) {","sourceCodeStart":297,"sourceCodeEnd":333,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-core/seatunnel-starter/src/main/java/org/apache/seatunnel/core/starter/seatunnel/args/ClientCommandArgs.java#L297-L333","documentation":"PositiveIntegerValidator throws this ParameterException when --sample-limit exceeds DryRunSampleConfig.MAX_LIMIT. The upper bound protects the local sample engine from fetching/printing an unbounded number of records.","triggerScenarios":"Running e.g. `--sample-limit 100000` where 100000 > DryRunSampleConfig.MAX_LIMIT.","commonSituations":"Assuming sample limit is unbounded; copying batch-size values (e.g. 10000) into --sample-limit without checking the cap.","solutions":["Reduce --sample-limit to a value <= DryRunSampleConfig.MAX_LIMIT (check the constant in DryRunSampleConfig for the exact cap)","If you need more data than the cap, run the job normally instead of a sample dry-run"],"exampleFix":"// before\n--sample-limit 1000000\n// after\n--sample-limit 100","handlingStrategy":"validation","validationCode":"const limit = Number.parseInt(value, 10);\nconst MAX_LIMIT = /* from DryRunSampleConfig.MAX_LIMIT */;\nif (Number.isInteger(limit) && limit > MAX_LIMIT) {\n  throw new Error(`--sample-limit must not exceed ${MAX_LIMIT}`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check DryRunSampleConfig.MAX_LIMIT before choosing a limit","Clamp computed limits to MAX_LIMIT programmatically","For large data volumes, run a normal job instead of a sample dry-run"],"tags":["cli","validation","out-of-range"],"backgroundTag":"value-out-of-range","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}