This is an automated email from the ASF dual-hosted git repository.

jayzhan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git


The following commit(s) were added to refs/heads/main by this push:
     new d201ec742b Minor: Return InternalError rather than panic for 
`NamedStructField should be rewritten in OperatorToFunction` (#9968)
d201ec742b is described below

commit d201ec742b08fa2a0549fc27f0b39622d67391ab
Author: Andrew Lamb <[email protected]>
AuthorDate: Sat Apr 6 01:39:02 2024 -0400

    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
---
 datafusion/physical-expr/src/planner.rs | 36 ++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 19 deletions(-)

diff --git a/datafusion/physical-expr/src/planner.rs 
b/datafusion/physical-expr/src/planner.rs
index 44c9d33d60..aefbd54f8e 100644
--- a/datafusion/physical-expr/src/planner.rs
+++ b/datafusion/physical-expr/src/planner.rs
@@ -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 =

Reply via email to