Skip to content

Commit

Permalink
fix: allow placeholders to be substited when coercible
Browse files Browse the repository at this point in the history
  • Loading branch information
erratic-pattern committed Jan 24, 2024
1 parent ee7ab0b commit 81f8078
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions datafusion/common/src/param_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl ParamValues {
pub fn get_placeholders_with_values(
&self,
id: &str,
data_type: Option<&DataType>,
_data_type: Option<&DataType>,
) -> Result<ScalarValue> {
match self {
ParamValues::List(list) => {
Expand All @@ -90,14 +90,6 @@ impl ParamValues {
"No value found for placeholder with id {id}"
))
})?;
// check if the data type of the value matches the data type of the placeholder
if Some(&value.data_type()) != data_type {
return _internal_err!(
"Placeholder value type mismatch: expected {:?}, got {:?}",
data_type,
value.data_type()
);
}
Ok(value.clone())
}
ParamValues::Map(map) => {
Expand All @@ -109,14 +101,6 @@ impl ParamValues {
"No value found for placeholder with name {id}"
))
})?;
// check if the data type of the value matches the data type of the placeholder
if Some(&value.data_type()) != data_type {
return _internal_err!(
"Placeholder value type mismatch: expected {:?}, got {:?}",
data_type,
value.data_type()
);
}
Ok(value.clone())
}
}
Expand Down

0 comments on commit 81f8078

Please sign in to comment.