Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions datafusion/common/src/dfschema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ impl Display for DFSchema {
///
/// Note that this trait is implemented for &[DFSchema] which is
/// widely used in the DataFusion codebase.
pub trait ExprSchema {
pub trait ExprSchema: std::fmt::Debug {
/// Is this column reference nullable?
fn nullable(&self, col: &Column) -> Result<bool>;

Expand All @@ -610,7 +610,7 @@ pub trait ExprSchema {
}

// Implement `ExprSchema` for `Arc<DFSchema>`
impl<P: AsRef<DFSchema>> ExprSchema for P {
impl<P: AsRef<DFSchema> + std::fmt::Debug> ExprSchema for P {
fn nullable(&self, col: &Column) -> Result<bool> {
self.as_ref().nullable(col)
}
Expand Down
1 change: 1 addition & 0 deletions datafusion/expr/src/expr_schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ mod tests {
);
}

#[derive(Debug)]
struct MockExprSchema {
nullable: bool,
data_type: DataType,
Expand Down
5 changes: 2 additions & 3 deletions datafusion/expr/src/field_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@ pub fn get_indexed_field(data_type: &DataType, key: &ScalarValue) -> Result<Fiel
(DataType::List(_), _) => Err(DataFusionError::Plan(
"Only ints are valid as an indexed field in a list".to_string(),
)),
_ => Err(DataFusionError::Plan(
"The expression to get an indexed field is only valid for `List` types"
.to_string(),
(other, _) => Err(DataFusionError::Plan(
format!("The expression to get an indexed field is only valid for `List` or `Struct` types, got {other}")
)),
}
}