Commits


Fabio B. Silva authored and Chao Sun committed 271599ee6d8
ARROW-5189: [Rust] [Parquet] Format / display individual fields within a parquet row Hi, I'm working on a simple cli app to sample and analyze parquet files. And couldn't find simple way to get a simple string representation of each column within a `Row`. All `Field`s in a row already implement `fmt::Display` but there is now way to format individual fields. Since the `Row#fields` is not exposed by the api. Which i assume is by design. Having a way to format individual fields seems like a common problem, so I came up with a `RowFormatter` which provides a way to access the field as a `fmt::Display`. ```rust use parquet::record::RowFormatter; // ... let row = make_row(vec![ ("id".to_string(), Field::Int(5)), ("name".to_string(), Field::Str("abc".to_string())) ]); println!("row id : {}", row.fmt(0).unwrap()); println!("row name : {}", row.fmt(1).unwrap()); ``` I'm just getting started with Rust so please let me know if i can do anything better here.. Author: Fabio B. Silva <fabio.bat.silva@gmail.com> Closes #4174 from FabioBatSilva/row-fmt and squashes the following commits: 2cae53af <Fabio B. Silva> fmt fixes ef94b5de <Fabio B. Silva> Simplify RowFormatter#fmt by removing Result ceb91194 <Fabio B. Silva> Add RowFormatter to pub api df522752 <Fabio B. Silva> format / display fields within a Row