pub fn print_rows(
    file: File,
    num_records: Option<i64>,
    json: bool,
) -> Result<(), PQRSError> {
    let parquet_reader = SerializedFileReader::new(file)?;
    // get_row_iter allows us to iterate the parquet file one record at a time
    let mut iter = parquet_reader.get_row_iter(None)?;

    let mut start: i64 = 0;
    let end: i64 = num_records.unwrap_or(0);
    // if num_records is None, print all the files
    let all_records = num_records.is_none();

    // print either all records, or the requested number of records
    while all_records || start < end {
        match iter.next() {
            Some(row) => {
                println!("CurrentRow {} {}", start, end);
                print_row(&row, json);
            }
            None => break,
        }
        start += 1;
    }

    Ok(())
}
/// Print the given number of records in either json or json-like format
Print the given number of records in either json or json-like format
Print the given number of records in either json or json - like format
pub fn print_rows(
    file: File,
    num_records: Option<i64>,
    json: bool,
) -> Result<(), PQRSError> {
    let parquet_reader = SerializedFileReader::new(file)?;
    // get_row_iter allows us to iterate the parquet file one record at a time
    let mut iter = parquet_reader.get_row_iter(None)?;
    let mut start: i64 = 0;
    let end: i64 = num_records.unwrap_or(0);
    // if num_records is None, print all the files
    let all_records = num_records.is_none();
    // print either all records, or the requested number of records
    while all_records || start < end {
        match iter.next() {
            Some(row) => {
                println!("CurrentRow {} {}", start, end);
                print_row(&row, json);
            }
            None => break,
        }
        start += 1;
    }
    Ok(())
}
pub fn print_rows ( file : File , num_records : Option < i64 > , json : bool , ) -> Result < ( ) , PQRSError > { let parquet_reader = SerializedFileReader :: new ( file ) ? ; // get_row_iter allows us to iterate the parquet file one record at a time let mut iter = parquet_reader . get_row_iter ( None ) ? ; let mut start : i64 = 0 ; let end : i64 = num_records . unwrap_or ( 0 ) ; // if num_records is None, print all the files let all_records = num_records . is_none ( ) ; // print either all records, or the requested number of records while all_records || start < end { match iter . next ( ) { Some ( row ) => { println ! ( " " start end ) ; print_row ( & row , json ) ; } None => break , } start += 1 ; } Ok ( ( ) ) }
Print the given number of records in either json or json-like format
Print the given number of records in either json or json - like format
file
File
num_records
Option<i64>
json
bool
file
File
num_records
Option<i64>
json
bool