goldmedal commented on PR #13018:
URL: https://github.com/apache/datafusion/pull/13018#issuecomment-2440038947

   > However, then for each expr it builds up the same hash table:
   > 
   > 
https://github.com/apache/datafusion/blob/ac827abe1b66b1dfa02ce65ae857477f68667843/datafusion/expr/src/utils.rs#L879-L883
   
   It doesn't work for this case because the hash tables are different. The 
case is 
   ```
   SELECT max(a1), max(a2), ... max(a200) from t
   ```
   
   I think sharing the hash map may work in some cases like
   ```
   SELECT max(a1), max(a1) + 1, max(a1) +2, ... from t
   ```
   We only need to hash `max(a1)` once, and then look up the column reference 
many times. In `physical_select_aggregates_from_200` case, we still need to 
hash every expression.


-- 
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: github-unsubscr...@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to