From ac102ca101685bf43f1338223946715463f66448 Mon Sep 17 00:00:00 2001 From: Liang-Chi Hsieh Date: Sun, 13 Mar 2022 19:36:58 -0700 Subject: [PATCH] Fix generate_decimal128_case --- integration-testing/src/lib.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/integration-testing/src/lib.rs b/integration-testing/src/lib.rs index cb57ffc2d0dc..e59cce2ab900 100644 --- a/integration-testing/src/lib.rs +++ b/integration-testing/src/lib.rs @@ -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::().unwrap()), + _ => b.append_null(), + }?; + } + Ok(Arc::new(b.finish())) + } t => Err(ArrowError::JsonError(format!( "data type {:?} not supported", t