Skip to content

Commit d201ec7

Browse files
authored
Minor: Return InternalError rather than panic for NamedStructField should be rewritten in OperatorToFunction (#9968)
* Minor: Return InternalError rather than panic for 'NamedStructField should be rewritten in OperatorToFunction' * clippy
1 parent 6d81c41 commit d201ec7

File tree

1 file changed

+17
-19
lines changed

1 file changed

+17
-19
lines changed

datafusion/physical-expr/src/planner.rs

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -283,25 +283,23 @@ pub fn create_physical_expr(
283283
input_dfschema,
284284
execution_props,
285285
)?),
286-
Expr::GetIndexedField(GetIndexedField { expr: _, field }) => {
287-
match field {
288-
GetFieldAccess::NamedStructField { name: _ } => {
289-
unreachable!(
290-
"NamedStructField should be rewritten in OperatorToFunction"
291-
)
292-
}
293-
GetFieldAccess::ListIndex { key: _ } => {
294-
unreachable!("ListIndex should be rewritten in OperatorToFunction")
295-
}
296-
GetFieldAccess::ListRange {
297-
start: _,
298-
stop: _,
299-
stride: _,
300-
} => {
301-
unreachable!("ListRange should be rewritten in OperatorToFunction")
302-
}
303-
};
304-
}
286+
Expr::GetIndexedField(GetIndexedField { expr: _, field }) => match field {
287+
GetFieldAccess::NamedStructField { name: _ } => {
288+
internal_err!(
289+
"NamedStructField should be rewritten in OperatorToFunction"
290+
)
291+
}
292+
GetFieldAccess::ListIndex { key: _ } => {
293+
internal_err!("ListIndex should be rewritten in OperatorToFunction")
294+
}
295+
GetFieldAccess::ListRange {
296+
start: _,
297+
stop: _,
298+
stride: _,
299+
} => {
300+
internal_err!("ListRange should be rewritten in OperatorToFunction")
301+
}
302+
},
305303

306304
Expr::ScalarFunction(ScalarFunction { func_def, args }) => {
307305
let physical_args =

0 commit comments

Comments
 (0)