alamb commented on code in PR #3838:
URL: https://github.com/apache/arrow-datafusion/pull/3838#discussion_r996290913


##########
datafusion/core/src/physical_plan/planner.rs:
##########
@@ -174,9 +174,9 @@ fn create_physical_name(e: &Expr, is_first_expr: bool) -> 
Result<String> {
             let expr = create_physical_name(expr, false)?;
             Ok(format!("{} IS NOT UNKNOWN", expr))
         }
-        Expr::GetIndexedField { expr, key } => {
-            let expr = create_physical_name(expr, false)?;
-            Ok(format!("{}[{}]", expr, key))
+        Expr::GetIndexedField(get_indexed_field) => {
+            let expr = create_physical_name(&get_indexed_field.expr, false)?;
+            Ok(format!("{}[{}]", expr, get_indexed_field.key))

Review Comment:
   I recommend this style so that if we ever change `GetIndexedField` the 
compiler will tell us all the places where a new field may be needed
   
   
   ```suggestion
           Expr::GetIndexedField(GetIndexedField { expr, key }) => {
               let expr = create_physical_name(expr, false)?;
               Ok(format!("{}[{}]", expr, key))
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to