alamb commented on code in PR #22069:
URL: https://github.com/apache/datafusion/pull/22069#discussion_r3212975654


##########
datafusion/expr/src/utils.rs:
##########
@@ -339,7 +339,38 @@ fn get_excluded_columns(
         idents.push(&excepts.first_element);
         idents.extend(&excepts.additional_elements);
     }
+    // Declared outside the `if let` so `idents.extend(exclude_owned.iter())`
+    // below can borrow references that outlive the inner scope.
+    #[cfg(feature = "sql")]
+    let exclude_owned: Vec<sqlparser::ast::Ident>;
     if let Some(exclude) = opt_exclude {
+        #[cfg(feature = "sql")]

Review Comment:
   I suggest we should update the fallback copy in DataFusion to match the sql 
parser one. 
   
   For example 
   
https://github.com/apache/datafusion/blob/658827d3537e3b9f2f6132ce775a17a7350b1d55/datafusion/expr/src/expr.rs#L1452-L1457
   
   That will avoid the need to have two copies
   
   Looks like this copy came in via #17332 from @timsaucer 
   
   Maybe we can add some comments explaining the rationale for the second copy 
better (any isolate the cfg sql somewhere to make it clearer)



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to