diff --git a/rust/arrow/src/datatypes.rs b/rust/arrow/src/datatypes.rs index e4502b770e378..00ad1790962c6 100644 --- a/rust/arrow/src/datatypes.rs +++ b/rust/arrow/src/datatypes.rs @@ -184,7 +184,7 @@ impl ArrowNativeType for u64 { impl ArrowNativeType for f32 { fn into_json_value(self) -> Option { - Number::from_f64(self as f64).map(|num| VNumber(num)) + Number::from_f64(f64::round(self as f64 * 1000.0) / 1000.0).map(|num| VNumber(num)) } } diff --git a/rust/arrow/src/util/integration_util.rs b/rust/arrow/src/util/integration_util.rs index 3652708e4a285..56feab7d34bc4 100644 --- a/rust/arrow/src/util/integration_util.rs +++ b/rust/arrow/src/util/integration_util.rs @@ -95,7 +95,7 @@ impl ArrowJsonSchema { } impl ArrowJsonBatch { - /// Comapre the Arrow JSON record batch with a `RecordBatch` + /// Compare the Arrow JSON record batch with a `RecordBatch` fn equals_batch(&self, batch: &RecordBatch) -> bool { if self.count != batch.num_rows() { return false;