Skip to content

Commit

Permalink
fix(source): base64 decode bytes from JSON string
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangjinwu committed Dec 13, 2024
1 parent f1ac766 commit 417a1c5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/connector/src/parser/unified/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -408,9 +408,11 @@ impl JsonParseOptions {
.get("value")
.ok_or_else(create_error)?
.as_str()
.unwrap()
.as_bytes();
let unscaled = BigInt::from_signed_bytes_be(value);
.unwrap();
let value = base64::engine::general_purpose::STANDARD
.decode(value)
.map_err(|_| create_error())?;
let unscaled = BigInt::from_signed_bytes_be(&value);
let decimal = scaled_bigint_to_rust_decimal(unscaled, scale as _)?;
ScalarImpl::Decimal(Decimal::Normalized(decimal))
}
Expand Down

0 comments on commit 417a1c5

Please sign in to comment.