Skip to content

Commit

Permalink
Validate decimal IPC read (#2387) (#2880)
Browse files Browse the repository at this point in the history
  • Loading branch information
tustvold committed Oct 15, 2022
1 parent c7f7606 commit f055f51
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions arrow/src/ipc/reader.rs
Expand Up @@ -486,16 +486,12 @@ fn create_primitive_array(
.unwrap(),
Decimal128(_, _) | Decimal256(_, _) => {
// read 2 buffers: null buffer (optional) and data buffer
let builder = ArrayData::builder(data_type.clone())
ArrayData::builder(data_type.clone())
.len(length)
.add_buffer(buffers[1].clone())
.null_bit_buffer(null_buffer);

// Don't validate the decimal array so far,
// becasue validating decimal is some what complicated
// and there is no conclusion on whether we should do it.
// For more infomation, please look at https://github.com/apache/arrow-rs/issues/2387
unsafe { builder.build_unchecked() }
.null_bit_buffer(null_buffer)
.build()
.unwrap()
}
t => unreachable!("Data type {:?} either unsupported or not primitive", t),
};
Expand Down

0 comments on commit f055f51

Please sign in to comment.