[ 
https://issues.apache.org/jira/browse/DRILL-4952?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Khurram Faraaz updated DRILL-4952:
----------------------------------
    Attachment: durations.csv

> AVG(<INTERVAL type>) returns SchemaChangeException
> --------------------------------------------------
>
>                 Key: DRILL-4952
>                 URL: https://issues.apache.org/jira/browse/DRILL-4952
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Execution - Flow
>    Affects Versions: 1.9.0
>            Reporter: Khurram Faraaz
>         Attachments: durations.csv
>
>
> We need to fix the documentation if this is not supported, otherwise we need 
> to fix the AVG function to accept INTERVAL type input.
> As per Drill's documentation we say that AVG aggregate function accepts 
> INTERVAL type as input
> https://drill.apache.org/docs/aggregate-and-aggregate-statistical/
> However, the below query fails when INTERVAL type value is passed as input to 
> AVG function
> {noformat}
> 0: jdbc:drill:schema=dfs.tmp> SELECT AVG(CAST(columns[0] AS INTERVAL YEAR)) 
> from `durations.csv`;
> Error: SYSTEM ERROR: SchemaChangeException: Failure while materializing 
> expression.
> Error in expression at index -1.  Error: Missing function implementation: 
> [$sum0(INTERVALYEAR-OPTIONAL)].  Full expression: --UNKNOWN EXPRESSION--.
> Fragment 0:0
> [Error Id: 522f55c7-809a-4cf1-a926-3281f9837636 on centos-01.qa.lab:31010] 
> (state=,code=0)
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to