{"record":{"id":"68b47c0bfb1d4419","repo":"influxdata/influxdb","slug":"expected-i64-got","errorCode":null,"errorMessage":"expected i64 got {}","messagePattern":"expected i64 got (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/partition/src/traits/mutable_batch.rs","lineNumber":58,"sourceCode":"impl Batch for MutableBatch {\n    type Column = MutableBatchColumn;\n\n    fn num_rows(&self) -> usize {\n        self.rows()\n    }\n\n    fn column(&self, column: &str) -> Option<&Self::Column> {\n        self.column(column).ok()\n    }\n\n    fn time_column(&self) -> Result<&[i64], TimeColumnError> {\n        let time_column = self\n            .column(TIME_COLUMN_NAME)\n            .map_err(|_| TimeColumnError::NotFound)?;\n\n        match &time_column.data() {\n            ColumnData::I64(col_data) => Ok(col_data),\n            x => unreachable!(\"expected i64 got {}\", x),\n        }\n    }\n}\n","sourceCodeStart":40,"sourceCodeEnd":62,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/core/partition/src/traits/mutable_batch.rs#L40-L62","documentation":"unreachable!(\"expected i64 got {}\") panic in MutableBatch::time_column: after locating the TIME_COLUMN_NAME column, the method pattern-matches its ColumnData and expects ColumnData::I64. Any other column data type (Float, String, Timestamp, etc.) triggers an unreachable! panic because the time column must always hold i64 nanosecond timestamps in this data model.","triggerScenarios":"Calling time_column() on a MutableBatch whose 'time' column was created with a non-I64 ColumnData variant — e.g. a batch constructed with a Timestamp-typed or String-typed time column, or a column inserted under the wrong name/type by upstream write-path code.","commonSituations":"Writing rows where the time column was ingested with an unexpected type, schema drift between writer and partition reader, or test fixtures that build the time column with the wrong arrow type.","solutions":["Ensure the batch's time column is built as ColumnData::I64 (nanosecond i64 values) at ingestion time","Replace unreachable! with a proper Result/TimeColumnError::InvalidType for graceful handling","Validate column types before calling time_column() by inspecting column(TIME_COLUMN_NAME).data()","Check the write path that constructs the batch for a regression in time-column typing"],"exampleFix":"// before\nx => unreachable!(\"expected i64 got {}\", x),\n// after\nx => Err(TimeColumnError::InvalidType(x.to_string())),","handlingStrategy":"type-guard","validationCode":"// rust\nfn is_i64_time_column(batch: &MutableBatch, name: &str) -> bool {\n    matches!(batch.column(name).map(|c| c.data()), Ok(ColumnData::I64(_)))\n}","typeGuard":"// rust\nif let ColumnData::I64(col) = &time_column.data() { /* use col */ } else { return Err(...); }","tryCatchPattern":"match batch.time_column() {\n    Ok(c) => c,\n    Err(TimeColumnError::NotFound) => return Err(\"no time column\".into()),\n}","preventionTips":["Always build time columns as ColumnData::I64 at ingestion","Validate column types when constructing batches instead of relying on unreachable!","Prefer Result-returning accessors over unreachable! for cross-schema data"],"tags":["rust","panic","type-mismatch","column-data"],"backgroundTag":"type-mismatch","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}