Skip to content

Commit

Permalink
use fixed size space
Browse files Browse the repository at this point in the history
Signed-off-by: fan <[email protected]>
  • Loading branch information
fansehep committed Nov 21, 2023
1 parent b64b053 commit 7ef4634
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions arrow-json/src/reader/string_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,14 @@ impl<O: OffsetSizeTrait> ArrayDecoder for StringArrayDecoder<O> {
TapeElement::Number(idx) if coerce_primitive => {
data_capacity += tape.get_string(idx).len();
}
TapeElement::I64(n) | TapeElement::I32(n) if coerce_primitive => {
data_capacity += n.to_string().len();
}
TapeElement::F32(n) | TapeElement::F64(n) if coerce_primitive => {
data_capacity += n.to_string().len();
TapeElement::I64(_)
| TapeElement::I32(_)
| TapeElement::F64(_)
| TapeElement::F32(_)
if coerce_primitive =>
{
// An arbitrary estimate
data_capacity += 10;
}
_ => {
return Err(tape.error(*p, "string"));
Expand Down

0 comments on commit 7ef4634

Please sign in to comment.