jayzhan211 opened a new issue, #11629:
URL: https://github.com/apache/datafusion/issues/11629

                 I think it would be good to eventually move this to a method 
in `https://github.com/apache/datafusion/pull/11611` though I agree this is 
good for now. Maybe we can file a ticket to track
   
   _Originally posted by @alamb in 
https://github.com/apache/datafusion/pull/11611#discussion_r1688699754_
   
   I think we could extend to rewrite the whole expression name, and it could 
be more straightforward what the name is rewritten
   
   ```rust
   let mut name = self.name().to_string();
                   // If the function is changed, we need to reverse order_by 
clause as well
                   // i.e. First(a order by b asc null first) -> Last(a order 
by b desc null last)
                   if self.fun().name() == reverse_udf.name() {
                   } else {
                       replace_order_by_clause(&mut name);
                   }
                   replace_fn_name_clause(&mut name, self.fun.name(), 
reverse_udf.name());
   ```
   
   Something like
   ```rust
   let mut name = self.name().to_string();
   name = self.fun.reverse_name(name)
   ```
               


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