Skip to content

Commit ebcde3e

Browse files
committed
use string instead of float for decimal
1 parent 0216b42 commit ebcde3e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backend/src/core/avro/avro_to_json.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ fn parse_decimal(v: &apache_avro::Decimal, scale: &usize) -> AvroResult<JsonValu
8383
let value = BigInt::from_signed_bytes_be(&arr);
8484
let num = i64::try_from(value).map_err(|err| AvroError::InvalidNumber(err.to_string()))?;
8585
let decimal = Decimal::new(num, scale.to_owned() as u32);
86-
let float: f64 = decimal.to_string().parse().unwrap();
87-
Ok(json!(float))
86+
//let float: String = decimal.to_string().parse().unwrap();
87+
Ok(json!(decimal.to_string()))
8888
}
8989

9090
fn parse_record(

0 commit comments

Comments
 (0)