Skip to content

Commit

Permalink
Fix generate_decimal128_case (#1440)
Browse files Browse the repository at this point in the history
  • Loading branch information
viirya authored Mar 14, 2022
1 parent bbcba7b commit 717216f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions integration-testing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,22 @@ fn array_from_json(
))),
}
}
DataType::Decimal(precision, scale) => {
let mut b = DecimalBuilder::new(json_col.count, *precision, *scale);
for (is_valid, value) in json_col
.validity
.as_ref()
.unwrap()
.iter()
.zip(json_col.data.unwrap())
{
match is_valid {
1 => b.append_value(value.as_str().unwrap().parse::<i128>().unwrap()),
_ => b.append_null(),
}?;
}
Ok(Arc::new(b.finish()))
}
t => Err(ArrowError::JsonError(format!(
"data type {:?} not supported",
t
Expand Down

0 comments on commit 717216f

Please sign in to comment.