Skip to content

Commit

Permalink
Fix binary de
Browse files Browse the repository at this point in the history
  • Loading branch information
sundy-li authored and zhyass committed Sep 2, 2021
1 parent f115bb7 commit 4cccbaf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions common/datavalues/src/arrays/string/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use std::io::Read;

use common_arrow::arrow::array::*;
use common_exception::Result;
use common_io::prelude::BinaryRead;

use crate::prelude::*;
use crate::utils::get_iter_capacity;
Expand Down Expand Up @@ -54,6 +57,9 @@ impl StringArrayBuilder {

impl ArrayDeserializer for StringArrayBuilder {
fn de(&mut self, reader: &mut &[u8]) -> Result<()> {
let offset: u64 = reader.read_uvarint()?;
let mut values: Vec<u8> = Vec::with_capacity(offset as usize);
reader.read_exact(&mut values)?;
self.append_value(reader.clone());
Ok(())
}
Expand Down

0 comments on commit 4cccbaf

Please sign in to comment.