You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2024/02/28 21:17:38 UTC

[I] Add ScalarUDFs in missing function hints [arrow-datafusion]

alamb opened a new issue, #9392:
URL: https://github.com/apache/arrow-datafusion/issues/9392

   ### Is your feature request related to a problem or challenge?
   
   Part of https://github.com/apache/arrow-datafusion/issues/8045
   
   Today there is a nice error message with a hint if a user issues an unknown function
   
   For example, tryng `cos2` will have datafusion suggest `cos`
   ```
   DataFusion CLI v36.0.0
   ❯ select cos2(1);
   Error during planning: Invalid function 'cos2'.
   Did you mean 'cos'?
   ```
   
   However, UDFs are never suggested
   
   
   For example, the function `abs` has been moved to a ScalarUDF, so now the error message does not suggest this.
   
   ```sql
   DataFusion CLI v36.0.0
   ❯ select abs2(1);
   Error during planning: Invalid function 'abs2'.
   Did you mean 'acos'?
   ```
   
   but in earlier versions of DataFusion where `abs` was a built in function, it is correctly suggested:
   
   ```sql
   DataFusion CLI v32.0.0
   ❯ select abs2(1);
   Error during planning: Invalid function 'abs2'.
   Did you mean 'abs'?
   ```
   
   
   ### Describe the solution you'd like
   
   I would like UDFs to be included in the suggestsed the error message
   
   ### Describe alternatives you've considered
   
   Here is where the suggestion is created: https://github.com/apache/arrow-datafusion/blob/cf69d38e80448ec7402f622d2adcfc6edf0b387e/datafusion/sql/src/expr/function.rs#L214-L215
   
   I think it will be a fairly straightforward exercise to extend the list in https://github.com/apache/arrow-datafusion/blob/cf69d38e80448ec7402f622d2adcfc6edf0b387e/datafusion/expr/src/function.rs#L80-L94 to 
   
   ### Additional context
   
   This came up in the context of https://github.com/apache/arrow-datafusion/pull/9388, https://github.com/apache/arrow-datafusion/pull/9388#discussion_r1506662726
   


-- 
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-unsubscribe@arrow.apache.org.apache.org

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


Re: [I] Add ScalarUDFs in missing function hints [arrow-datafusion]

Posted by "SteveLauC (via GitHub)" <gi...@apache.org>.
SteveLauC commented on issue #9392:
URL: https://github.com/apache/arrow-datafusion/issues/9392#issuecomment-1970048159

   take


-- 
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-unsubscribe@arrow.apache.org

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


Re: [I] Add ScalarUDFs in missing function hints / suggested errors [arrow-datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb closed issue #9392: Add ScalarUDFs in missing function hints / suggested errors
URL: https://github.com/apache/arrow-datafusion/issues/9392


-- 
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-unsubscribe@arrow.apache.org

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


Re: [I] Add ScalarUDFs in missing function hints [arrow-datafusion]

Posted by "SteveLauC (via GitHub)" <gi...@apache.org>.
SteveLauC commented on issue #9392:
URL: https://github.com/apache/arrow-datafusion/issues/9392#issuecomment-1970040274

   Nice feature, I would like to try this as I have never touched the sql crate😁
   
   take


-- 
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-unsubscribe@arrow.apache.org

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