0lai0 opened a new pull request, #1343: URL: https://github.com/apache/mahout/pull/1343
### Related Issues Closes #1339 Part of #1338 ### Changes - [ ] Bug fix - [ ] New feature - [x] Refactoring - [ ] Documentation - [ ] Test - [ ] CI/CD pipeline - [ ] Other ### Why <!-- Why is this change needed? --> DataReader::read_batch was hard-coded to Vec<f64>, so dtype=f32 file sources were silently promoted to f64 before encoding. That blocks a true f32 read path into encode_batch_f32. This PR parameterizes the reader traits so f32 can be added per format without another breaking API change. ### How <!-- What was done? --> - Introduce FloatElem as a sealed-by-usage marker trait (Copy + Send + Sync + 'static) with impls only for f32 and f64. - Parameterize DataReader / StreamingDataReader with T: FloatElem, defaulting to f64 so existing impl DataReader for … and call sites (io::read_*_batch, tests, pipeline_runner) compile with no behavior change. - Keep null handling and Arrow helpers on f64 for now (handle_float64_nulls). Follow-up: impl DataReader<f32> for Parquet (and other formats as needed), plus pipeline wiring to consume Vec<f32> without casting. ## Checklist - [ ] Added or updated unit tests for all changes - [x] Added or updated documentation for all changes -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
