Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgecarleitao committed Dec 20, 2021
1 parent 568c902 commit db80c4c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion examples/parquet_read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ fn main() -> Result<()> {
let row_group = args[3].parse::<usize>().unwrap();

let array = read_field(file_path, row_group, field)?;
println!("{}", array);
println!("{:?}", array);
Ok(())
}
3 changes: 1 addition & 2 deletions src/io/avro/write/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,9 @@ pub fn compress(
compressed_block: &mut CompressedBlock,
compression: Compression,
) -> Result<()> {
compressed_block.number_of_rows = block.number_of_rows;
match compression {
Compression::Deflate => todo!(),
Compression::Snappy => todo!(),
}
compressed_block.number_of_rows = block.number_of_rows;
Ok(())
}
8 changes: 2 additions & 6 deletions src/io/avro/write/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@ use avro_schema::{
use crate::datatypes::*;
use crate::error::{ArrowError, Result};

/// Converts a [`Schema`] to an avro [`AvroSchema::Record`] with it.
/// Converts a [`Schema`] to a vector of [`AvroField`] with it.
pub fn to_avro_schema(schema: &Schema) -> Result<Vec<AvroField>> {
schema
.fields
.iter()
.map(|field| field_to_field(field))
.collect()
schema.fields.iter().map(field_to_field).collect()
}

fn field_to_field(field: &Field) -> Result<AvroField> {
Expand Down
2 changes: 1 addition & 1 deletion tests/it/io/avro/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ pub(super) fn data() -> RecordBatch {
}

pub(super) fn write_avro(codec: Codec) -> std::result::Result<Vec<u8>, avro_rs::Error> {
let (avro, schema) = schema();
let (avro, _) = schema();
// a writer needs a schema and something to write to
let mut writer = Writer::with_codec(&avro, Vec::new(), codec);

Expand Down

0 comments on commit db80c4c

Please sign in to comment.