Skip to content

Commit

Permalink
Minor: Return InternalError rather than panic for `NamedStructField s…
Browse files Browse the repository at this point in the history
…hould be rewritten in OperatorToFunction` (apache#9968)

* Minor: Return InternalError rather than panic for 'NamedStructField should be rewritten in OperatorToFunction'

* clippy
  • Loading branch information
alamb authored Apr 6, 2024
1 parent 6d81c41 commit d201ec7
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions datafusion/physical-expr/src/planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,25 +283,23 @@ pub fn create_physical_expr(
input_dfschema,
execution_props,
)?),
Expr::GetIndexedField(GetIndexedField { expr: _, field }) => {
match field {
GetFieldAccess::NamedStructField { name: _ } => {
unreachable!(
"NamedStructField should be rewritten in OperatorToFunction"
)
}
GetFieldAccess::ListIndex { key: _ } => {
unreachable!("ListIndex should be rewritten in OperatorToFunction")
}
GetFieldAccess::ListRange {
start: _,
stop: _,
stride: _,
} => {
unreachable!("ListRange should be rewritten in OperatorToFunction")
}
};
}
Expr::GetIndexedField(GetIndexedField { expr: _, field }) => match field {
GetFieldAccess::NamedStructField { name: _ } => {
internal_err!(
"NamedStructField should be rewritten in OperatorToFunction"
)
}
GetFieldAccess::ListIndex { key: _ } => {
internal_err!("ListIndex should be rewritten in OperatorToFunction")
}
GetFieldAccess::ListRange {
start: _,
stop: _,
stride: _,
} => {
internal_err!("ListRange should be rewritten in OperatorToFunction")
}
},

Expr::ScalarFunction(ScalarFunction { func_def, args }) => {
let physical_args =
Expand Down

0 comments on commit d201ec7

Please sign in to comment.