You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (JIRA)" <ji...@apache.org> on 2016/03/24 20:18:28 UTC
[jira] [Updated] (CALCITE-1165) VolcanoCost comparing floating
point numbers might cause problems in a few places
[ https://issues.apache.org/jira/browse/CALCITE-1165?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Julian Hyde updated CALCITE-1165:
---------------------------------
Summary: VolcanoCost comparing floating point numbers might cause problems in a few places (was: VocanoCost comparing floating point numbers might cause problems in a few places)
> VolcanoCost comparing floating point numbers might cause problems in a few places
> ---------------------------------------------------------------------------------
>
> Key: CALCITE-1165
> URL: https://issues.apache.org/jira/browse/CALCITE-1165
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.7.0
> Reporter: Maryann Xue
> Assignee: Julian Hyde
> Priority: Minor
>
> The floating number comparison can be inaccurate and can break some logic in VolcanoPlanner. For example,
> 1) VolcanoPlanner.validate():
> {code}
> for (RelNode rel : subset.getRels()) {
> RelOptCost relCost = getCost(rel, mq);
> if (relCost.isLt(subset.bestCost)) {
> throw new AssertionError(
> "rel [" + rel.getDescription()
> + "] has lower cost " + relCost
> + " than best cost " + subset.bestCost
> + " of subset [" + subset.getDescription() + "]");
> }
> }
> {code}
> 2) VolcanoPlanner.getCost(RelNode, RelMetadataQuery)
> {code}
> RelOptCost cost = mq.getNonCumulativeCost(rel);
> if (!zeroCost.isLt(cost)) {
> // cost must be positive, so nudge it
> cost = costFactory.makeTinyCost();
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)