[
https://issues.apache.org/jira/browse/CALCITE-6543?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jie Cheng updated CALCITE-6543:
-------------------------------
Description:
Hello everyone, I am a calcite novice, recently learning calcite source code,
in the process of learning, found that RelOptCostImpl toString method is
inconsistent with the VolcanoCost method, I think we should revise them to be
similar
before modification:
@Override public String toString() {
if (value == Double.MAX_VALUE) {
return "huge";
} else {
return Double.toString(value);
}
}
after modification:
@Override public String toString() {
if (value == Double.MAX_VALUE) {
return "huge";
} else if (value == Double.POSITIVE_INFINITY) {
return "inf";
} else if (value == 1.0) {
return "tiny";
} else if (value == 0.0) {
return "0";
} else {
return Double.toString(value);
}
}
was:
Hello everyone, I am a calcite novice, recently learning calcite source code,
in the process of learning, found that RelOptCostImpl toString method is
inconsistent with the VolcanoCost method, I think we should revise them to be
similar
before modification:
{quote}@Override public String toString() {
if (value == Double.MAX_VALUE) {
return "huge";
} else {
return Double.toString(value);
}
}
{quote}
after modification:
{quote}@Override public String toString() {
if (value == Double.MAX_VALUE) {
return "huge";
} else if (value == Double.POSITIVE_INFINITY) {
return "inf";
} else if (value == 1.0) {
return "tiny";
} else if (value == 0.0) {
return "0";
} else {
return Double.toString(value);
}
}
{quote}
> Change the RelOptCostImpl toString method to be consistent with VolcanoCost
> ---------------------------------------------------------------------------
>
> Key: CALCITE-6543
> URL: https://issues.apache.org/jira/browse/CALCITE-6543
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Affects Versions: 1.37.0
> Reporter: Jie Cheng
> Priority: Trivial
> Fix For: 1.37.0
>
>
> Hello everyone, I am a calcite novice, recently learning calcite source code,
> in the process of learning, found that RelOptCostImpl toString method is
> inconsistent with the VolcanoCost method, I think we should revise them to be
> similar
> before modification:
> @Override public String toString() {
> if (value == Double.MAX_VALUE) {
> return "huge";
> } else {
> return Double.toString(value);
> }
> }
> after modification:
> @Override public String toString() {
> if (value == Double.MAX_VALUE) {
> return "huge";
> } else if (value == Double.POSITIVE_INFINITY) {
> return "inf";
> } else if (value == 1.0) {
> return "tiny";
> } else if (value == 0.0) {
> return "0";
> } else {
> return Double.toString(value);
> }
> }
--
This message was sent by Atlassian Jira
(v8.20.10#820010)