You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/01/31 11:59:42 UTC

[GitHub] [arrow] alamb commented on a change in pull request #9364: ARROW-11431: [Rust][DataFusion] Support the HAVING clause.

alamb commented on a change in pull request #9364:
URL: https://github.com/apache/arrow/pull/9364#discussion_r567415267



##########
File path: rust/datafusion/src/sql/utils.rs
##########
@@ -335,3 +336,35 @@ where
         },
     }
 }
+
+/// Returns mapping of each alias (`String`) to the expression (`Expr`) it is
+/// aliasing.
+pub(crate) fn extract_aliases(exprs: &Vec<Expr>) -> HashMap<String, Expr> {

Review comment:
       This can probably be something like the following if you wanted more idomatic rust style (I don't think it really matters in this case)
   
   ```suggestion
   pub(crate) fn extract_aliases(exprs: &[Expr]) -> HashMap<String, Expr> {
   ```
   
   Maybe even something fancier like anything that can become an iterator:
   
   ```
   pub(crate) fn extract_aliases(exprs: impl Iterator<Item=&Expr>) -> HashMap<String, Expr> {
   ```




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org