Skip to content

Commit

Permalink
fix hash
Browse files Browse the repository at this point in the history
Signed-off-by: jayzhan211 <jayzhan211@gmail.com>
  • Loading branch information
jayzhan211 committed Jan 7, 2024
1 parent 386b167 commit a74c3b5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
11 changes: 7 additions & 4 deletions datafusion/common/src/scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2722,7 +2722,9 @@ impl From<(Fields, Vec<ArrayRef>)> for ScalarValue {

// Wrapper for ScalarValue::Struct that checks the length of the arrays
impl From<(Fields, Vec<ArrayRef>, Option<NullBuffer>)> for ScalarValue {
fn from((fields, arrays, nulls): (Fields, Vec<ArrayRef>, Option<NullBuffer>)) -> Self {
fn from(
(fields, arrays, nulls): (Fields, Vec<ArrayRef>, Option<NullBuffer>),
) -> Self {
for arr in arrays.iter() {
assert_eq!(arr.len(), 1);
}
Expand Down Expand Up @@ -3251,10 +3253,11 @@ mod tests {
]);

let arrays = vec![
Arc::new(BooleanArray::from(vec![false, true, false, false])) as ArrayRef,
Arc::new(Int32Array::from(vec![42, 28, 19, 31]))];
Arc::new(BooleanArray::from(vec![false, true, false, false])) as ArrayRef,
Arc::new(Int32Array::from(vec![42, 28, 19, 31])),
];

let _ = ScalarValue::from((fields, arrays));
let _ = ScalarValue::from((fields, arrays));
}

#[test]
Expand Down
3 changes: 2 additions & 1 deletion datafusion/proto/tests/cases/roundtrip_logical_plan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,8 @@ fn round_trip_scalar_values() {
vec![
Field::new("a", DataType::Int32, true),
Field::new("b", DataType::Boolean, false),
].into(),
]
.into(),
vec![
Arc::new(Int32Array::from(vec![Some(23)])) as ArrayRef,
Arc::new(BooleanArray::from(vec![Some(false)])) as ArrayRef,
Expand Down

0 comments on commit a74c3b5

Please sign in to comment.