Skip to content

Commit 73e78c0

Browse files
committed
fix array agg distinct
Signed-off-by: jayzhan211 <[email protected]>
1 parent d28d944 commit 73e78c0

File tree

2 files changed

+149
-141
lines changed

2 files changed

+149
-141
lines changed

datafusion/common/src/scalar.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2198,6 +2198,15 @@ impl ScalarValue {
21982198
Ok(scalars)
21992199
}
22002200

2201+
// TODO: Support more types after other ScalarValue is wrapped with ArrayRef
2202+
/// Get raw data (inner array) inside ScalarValue
2203+
pub fn raw_data(&self) -> Result<ArrayRef> {
2204+
match self {
2205+
ScalarValue::ListArr(arr) => Ok(arr.to_owned()),
2206+
_ => _internal_err!("ScalarValue is not a list"),
2207+
}
2208+
}
2209+
22012210
/// Converts a value in `array` at `index` into a ScalarValue
22022211
pub fn try_from_array(array: &dyn Array, index: usize) -> Result<Self> {
22032212
// handle NULL value

0 commit comments

Comments
 (0)