[
https://issues.apache.org/jira/browse/DRILL-5872?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16203827#comment-16203827
]
ASF GitHub Bot commented on DRILL-5872:
---------------------------------------
Github user arina-ielchiieva commented on a diff in the pull request:
https://github.com/apache/drill/pull/990#discussion_r144603055
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/physical/PhysicalPlan.java
---
@@ -94,6 +94,14 @@ public double totalCost() {
for (final PhysicalOperator ops : getSortedOperators()) {
totalCost += ops.getCost();
}
+
+ // As it turns out, sometimes the total cost can be out of range.
+ // This throws off other code, so clamp the cost at the maximum
+ // double value.
+
+ if (Double.isNaN(totalCost)) {
+ totalCost = Double.MAX_VALUE;
--- End diff --
May be better to replace with 0 or negative number, like -1 (like the
second option better). Won't be max double value confusing in this case? It's
just nan is not a number and replace it with double max value.
> Deserialization of profile JSON fails due to totalCost being reported as "NaN"
> ------------------------------------------------------------------------------
>
> Key: DRILL-5872
> URL: https://issues.apache.org/jira/browse/DRILL-5872
> Project: Apache Drill
> Issue Type: Bug
> Affects Versions: 1.12.0
> Reporter: Kunal Khatua
> Assignee: Paul Rogers
> Priority: Blocker
> Fix For: 1.12.0
>
>
> With DRILL-5716 , there is a change in the protobuf that introduces a new
> attribute in the JSON document that Drill uses to interpret and render the
> profile's details.
> The totalCost attribute, used as a part of showing the query cost (to
> understand how it was assign to small/large queue), sometimes returns a
> non-numeric text value {{"NaN"}}.
> This breaks the UI with the messages:
> {code}
> Failed to get profiles:
> unable to deserialize value at key 2620698f-295e-f8d3-3ab7-01792b0f2669
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)