You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mahout.apache.org by "0lai0 (via GitHub)" <gi...@apache.org> on 2026/05/26 05:54:08 UTC

[I] [Refactor] Add FloatElem trait and DataReader [mahout]

0lai0 opened a new issue, #1339:
URL: https://github.com/apache/mahout/issues/1339

   ### What
   
   Generalize `DataReader` from `Vec<f64>` to `Vec<T>` by introducing a `FloatElem` trait, so that `dtype=f32` data from file sources can stay as `f32` through the entire read path.
   
   ### Why
   
   `DataReader::read_batch` returns `Vec<f64>` only (`qdp-core/src/reader.rs`; the comment at line 100 marks this as structural debt). Until this is fixed, `dtype=f32` file sources are silently cast to f64, preventing a true f32 pipeline.
   
   ### How
   
   - Add `FloatElem` marker trait with `f32` / `f64` impls (or reuse existing `Dtype` mapping) in `qdp-core/src/types.rs` or a new `qdp-core/src/float_elem.rs`
   - Change `DataReader` → `DataReader<T: FloatElem>`, `read_batch -> Result<(Vec<T>, usize, usize)>`
   - Update `StreamingDataReader<T>` the same way
   - Fix call sites that no longer compile (minimal — non-Parquet readers may still produce `f64` for now)
   - No behavior change on existing `f64` paths; trait docs explain the f32 end-to-end goal
   
   **Out of scope:** Parquet schema/cast logic, pipeline_runner wiring
   **Acceptance criteria:**
   - [ ] `cargo test -p qdp-core` passes on Linux
   - [ ] Trait docs explain f32 end-to-end goal
   - [ ] No behavior change on existing f64 paths
   
   


-- 
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: issues-unsubscribe@mahout.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Refactor] Add FloatElem trait and DataReader [mahout]

Posted by "guan404ming (via GitHub)" <gi...@apache.org>.
guan404ming closed issue #1339: [Refactor] Add FloatElem trait and DataReader<T>
URL: https://github.com/apache/mahout/issues/1339


-- 
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: issues-unsubscribe@mahout.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org