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

ASF subversion and git services commented on QPID-8717:
-------------------------------------------------------

Commit 89273e94dd36874a42225ee4dea63238cf40b6a2 in qpid-broker-j's branch 
refs/heads/main from Daniil Kirilyuk
[ https://gitbox.apache.org/repos/asf?p=qpid-broker-j.git;h=89273e94dd ]

QPID-8717: [Broker-J] Broker query engine may produce ClassCastException when 
using AVG function (#340)



> [Broker-J] Broker query engine may produce ClassCastException when using AVG 
> function
> -------------------------------------------------------------------------------------
>
>                 Key: QPID-8717
>                 URL: https://issues.apache.org/jira/browse/QPID-8717
>             Project: Qpid
>          Issue Type: Bug
>          Components: Broker-J
>    Affects Versions: qpid-java-broker-10.0.0
>            Reporter: Daniil Kirilyuk
>            Priority: Minor
>             Fix For: qpid-java-broker-10.0.1
>
>         Attachments: ClassCastException.txt
>
>
> REST API request using AVG aggregate function sometimes returns http 500 
> server error to client and broker.log records ClassCastException.
> {code:java}
> curl -i -X POST -H "Content-Type: application/json" -H "Accept: 
> application/json" -d \
> '{
>   "sql": "SELECT AVG(queueDepthMessages) AS AverageDepth FROM queue"
> }' \
> http://localhost:8080/api/latest/querybroker/broker {code}
> Error stacktrace: [^ClassCastException.txt]
> *Analysis*
> The issue appears when an avg value is calculated on queues having same depth 
> and therefore returning an integer average value instead of double, e.g. when 
> all queues have zero depth.
> *Implementation*
> The casting to double was added to the calculation of avg value.
>  



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to