Skip to content

Commit

Permalink
inlist: remove check path for UTF8::(None) for NULL value
Browse files Browse the repository at this point in the history
  • Loading branch information
liukun4515 committed Jun 27, 2022
1 parent 7afd437 commit 68566b0
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions datafusion/physical-expr/src/expressions/in_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ macro_rules! make_contains {
ColumnarValue::Scalar(s) => match s {
ScalarValue::$SCALAR_VALUE(Some(v)) => Some(*v),
ScalarValue::$SCALAR_VALUE(None) => None,
ScalarValue::Utf8(None) => None,
datatype => unimplemented!("Unexpected type {} for InList", datatype),
datatype => unreachable!("InList can't reach other data type {} for {}.", datatype, s),
},
ColumnarValue::Array(_) => {
unimplemented!("InList does not yet support nested columns.")
Expand Down Expand Up @@ -163,9 +162,7 @@ macro_rules! make_contains_primitive {
ColumnarValue::Scalar(s) => match s {
ScalarValue::$SCALAR_VALUE(Some(v)) => Some(*v),
ScalarValue::$SCALAR_VALUE(None) => None,
// TODO this is bug, for primitive the expr list should be cast to the same data type
ScalarValue::Utf8(None) => None,
datatype => unimplemented!("Unexpected type {} for InList", datatype),
datatype => unreachable!("InList can't reach other data type {} for {}.", datatype, s),
},
ColumnarValue::Array(_) => {
unimplemented!("InList does not yet support nested columns.")
Expand Down Expand Up @@ -317,11 +314,7 @@ fn make_list_contains_decimal(
.flat_map(|v| match v {
ColumnarValue::Scalar(s) => match s {
Decimal128(v128op, _, _) => *v128op,
_ => {
unreachable!(
"InList can't reach other data type for decimal data type."
)
}
datatype => unreachable!("InList can't reach other data type {} for {}.", datatype, s),
},
ColumnarValue::Array(_) => {
unimplemented!("InList does not yet support nested columns.")
Expand Down Expand Up @@ -360,9 +353,7 @@ fn make_set_contains_decimal(
.iter()
.flat_map(|v| match v {
Decimal128(v128op, _, _) => *v128op,
_ => {
unreachable!("InList can't reach other data type for decimal data type.")
}
datatype => unreachable!("InList can't reach other data type {} for {}.", datatype, v),
})
.collect::<Vec<_>>();
let native_set: HashSet<i128> = HashSet::from_iter(native_array);
Expand Down

0 comments on commit 68566b0

Please sign in to comment.