Skip to content
Permalink
Browse files
Fix generate_decimal128_case (#1440)
  • Loading branch information
viirya committed Mar 14, 2022
1 parent bbcba7b commit 717216f2a296566b10d786a113ceea937e95a459
Showing 1 changed file with 16 additions and 0 deletions.
@@ -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

0 comments on commit 717216f

Please sign in to comment.