Skip to content

Commit 28426ff

Browse files
committed
update
1 parent 2944acd commit 28426ff

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

datafusion/physical-expr-common/src/binary_view_map.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,7 @@ use datafusion_common::utils::proxy::{RawTableAllocExt, VecAllocExt};
2828
use std::fmt::Debug;
2929
use std::sync::Arc;
3030

31-
/// Should the output be a String or Binary?
32-
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
33-
pub enum OutputType {
34-
/// `StringViewArray`
35-
Utf8View,
36-
/// `BinaryViewArray`
37-
BinaryView,
38-
}
31+
use crate::binary_map::OutputType;
3932

4033
/// HashSet optimized for storing string or binary values that can produce that
4134
/// the final set as a `GenericBinaryViewArray` with minimal copies.
@@ -55,6 +48,14 @@ impl ArrowBytesViewSet {
5548
.insert_if_new(values, make_payload_fn, observe_payload_fn);
5649
}
5750

51+
/// Return the contents of this map and replace it with a new empty map with
52+
/// the same output type
53+
pub fn take(&mut self) -> Self {
54+
let mut new_self = Self::new(self.0.output_type);
55+
std::mem::swap(self, &mut new_self);
56+
new_self
57+
}
58+
5859
/// Converts this set into a `StringViewArray` or `BinaryViewArray`
5960
/// containing each distinct value that was interned.
6061
/// This is done without copying the values.

0 commit comments

Comments
 (0)