{"record":{"id":"34ae1c6306cc19a6","repo":"risingwavelabs/risingwave","slug":"event-offset-is-too-big-offset","errorCode":null,"errorMessage":"event offset is too big, offset: {}","messagePattern":"event offset is too big, offset: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/common/src/field_generator/numeric.rs","lineNumber":134,"sourceCode":"    {\n        let mut start = T::zero();\n        let mut end = T::from(i16::MAX);\n\n        if let Some(star_optiont) = star_option {\n            start = star_optiont.parse::<T>()?;\n        }\n        if let Some(end_option) = end_option {\n            end = end_option.parse::<T>()?;\n        }\n\n        assert!(start <= end);\n        Ok(Self {\n            start,\n            end,\n            offset,\n            step,\n            cur: T::try_from(event_offset).map_err(|_| {\n                anyhow::anyhow!(\"event offset is too big, offset: {}\", event_offset,)\n            })?,\n        })\n    }\n\n    fn generate(&mut self) -> serde_json::Value {\n        let partition_result = self.start\n            + T::try_from(self.offset).unwrap()\n            + T::try_from(self.step).unwrap() * self.cur;\n        let partition_result = if partition_result > self.end {\n            None\n        } else {\n            Some(partition_result)\n        };\n        self.cur += T::one();\n        json!(partition_result)\n    }\n\n    fn generate_datum(&mut self) -> Datum {","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/common/src/field_generator/numeric.rs#L116-L152","documentation":"When constructing a numeric sequence field generator, the event offset (a u64 row counter) must be convertible into the target numeric type `T`. If the offset exceeds what `T` can represent (e.g. offset > 127 for TINYINT), the conversion fails and this error is raised instead of silently wrapping.","triggerScenarios":"Creating a sequence-based numeric field generator via `NumericFieldGenerator`'s constructor with an `event_offset` larger than `T::try_from(event_offset)` can represent — e.g. datagen row counts beyond i8/i16 range for small integer columns.","commonSituations":"Long-running datagen sources on TINYINT/SMALLINT sequence columns where generated row count exceeds the type's max; explicit large `start`/`end` bounds; testing with very high offsets.","solutions":["Use a larger integer type (INT64) for sequence columns expected to see many rows.","Constrain the datagen sequence with `max` so offsets stay within the type's range.","Restart or recreate the source to reset the event offset if appropriate.","If you own the code, widen `T` bounds or pre-clamp the offset before `try_from`."],"exampleFix":"-- before\nCREATE TABLE t (v TINYINT, ...) WITH (connector='datagen', fields='v', sequence.min='-128', sequence.max='127')  -- long runs overflow offset\n-- after\nCREATE TABLE t (v BIGINT, ...) WITH (connector='datagen', fields='v', sequence.max='1000000000')","handlingStrategy":"validation","validationCode":"if event_offset > T::max_value_as_u64() { return Err(\"offset exceeds type range\".into()); }","typeGuard":null,"tryCatchPattern":"match T::try_from(event_offset) {\n    Ok(v) => ...,\n    Err(_) => return Err(anyhow!(\"choose a wider column type; offset {} overflows {:?}\", event_offset, std::mem::size_of::<T>())),\n}","preventionTips":["Use INT64 for long-running datagen sequence columns","Set sequence.max within the column type's range","Monitor datagen row counts against type bounds"],"tags":["rust","datagen","numeric","overflow"],"backgroundTag":"value-out-of-range","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}