[ 
https://issues.apache.org/jira/browse/DRILL-8406?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17694439#comment-17694439
 ] 

ASF GitHub Bot commented on DRILL-8406:
---------------------------------------

jnturton opened a new pull request, #2768:
URL: https://github.com/apache/drill/pull/2768

   # [DRILL-8406](https://issues.apache.org/jira/browse/DRILL-8406): Enable 
implicit casting of VARCHAR and BIT args in aggregate functions
   
   ## Description
   
   Default function implementations that that throw unsupported operation 
exceptions in the class AggregateErrorFunctions prevent the implicit casting of 
VARCHAR and BIT arguments to neighbouring types. E.g.
   ```
   apache drill> select sum('1');
   Error: UNSUPPORTED_OPERATION ERROR: Only COUNT, MIN and MAX aggregate 
functions supported for VarChar type
   ```
   This PR removes AggregateErrorFunctions so that implicit casting works, the 
example above changing as follows.
   ```
   apache drill> select sum('1');
   EXPR$0  1
   1 row selected (2.346 seconds)
   ```
   
   ## Documentation
   N/A
   
   ## Testing
   New unit test.
   




> Enable implicit casting of VARCHAR and BIT args in aggregate functions
> ----------------------------------------------------------------------
>
>                 Key: DRILL-8406
>                 URL: https://issues.apache.org/jira/browse/DRILL-8406
>             Project: Apache Drill
>          Issue Type: Improvement
>          Components: Functions - Drill
>    Affects Versions: 1.21.0
>            Reporter: James Turton
>            Assignee: James Turton
>            Priority: Minor
>             Fix For: 1.21.1
>
>
> Default function implementations that that throw unsupported operation 
> exceptions in the class AggregateErrorFunctions prevent the implicit casting 
> of VARCHAR and BIT arguments to neighbouring types. E.g. 
> {code:java}
> apache drill> select sum('1');
> Error: UNSUPPORTED_OPERATION ERROR: Only COUNT, MIN and MAX aggregate 
> functions supported for VarChar type{code}
> This issue proposes to remove AggregateErrorFunctions so that implicit 
> casting works, the example above changing as follows.
> {code:java}
> apache drill> select sum('1');
> EXPR$0  1
> 1 row selected (2.346 seconds)
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to