本文整理汇总了Java中org.apache.calcite.plan.RelOptUtil.EPSILON属性的典型用法代码示例。如果您正苦于以下问题:Java RelOptUtil.EPSILON属性的具体用法?Java RelOptUtil.EPSILON怎么用?Java RelOptUtil.EPSILON使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.calcite.plan.RelOptUtil
的用法示例。
在下文中一共展示了RelOptUtil.EPSILON属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isEqWithEpsilon
@Override
public boolean isEqWithEpsilon(RelOptCost other) {
if (!(other instanceof DrillCostBase)) {
return false;
}
DrillCostBase that = (DrillCostBase) other;
return (this == that)
|| ((Math.abs(this.cpu - that.cpu) < RelOptUtil.EPSILON)
&& (Math.abs(this.io - that.io) < RelOptUtil.EPSILON)
&& (Math.abs(this.network - that.network) < RelOptUtil.EPSILON)
&& (Math.abs(this.rowCount - that.rowCount) < RelOptUtil.EPSILON)
&& (Math.abs(this.memory - that.memory) < RelOptUtil.EPSILON));
}
示例2: isEqWithEpsilon
@Override
public boolean isEqWithEpsilon(org.apache.calcite.plan.RelOptCost other) {
if (!(other instanceof DremioCost)) {
return false;
}
DremioCost that = (DremioCost) other;
return (this == that)
|| ((Math.abs(this.cpu - that.cpu) < RelOptUtil.EPSILON)
&& (Math.abs(this.io - that.io) < RelOptUtil.EPSILON)
&& (Math.abs(this.network - that.network) < RelOptUtil.EPSILON)
&& (Math.abs(this.rowCount - that.rowCount) < RelOptUtil.EPSILON)
&& (Math.abs(this.memory - that.memory) < RelOptUtil.EPSILON));
}
示例3: swapInputs
/**
* Swaps the operands to a join, so the smaller input is on the right. Or,
* if this is a removable self-join, swap so the factor that should be
* preserved when the self-join is removed is put on the left.
*
* @param multiJoin join factors being optimized
* @param left left side of join tree
* @param right right hand side of join tree
* @param selfJoin true if the join is a removable self-join
*
* @return true if swapping should be done
*/
private boolean swapInputs(
RelMetadataQuery mq,
LoptMultiJoin multiJoin,
LoptJoinTree left,
LoptJoinTree right,
boolean selfJoin) {
boolean swap = false;
if (selfJoin) {
return !multiJoin.isLeftFactorInRemovableSelfJoin(
((LoptJoinTree.Leaf) left.getFactorTree()).getId());
}
final Double leftRowCount = mq.getRowCount(left.getJoinTree());
final Double rightRowCount = mq.getRowCount(right.getJoinTree());
// The left side is smaller than the right if it has fewer rows,
// or if it has the same number of rows as the right (excluding
// roundoff), but fewer columns.
if ((leftRowCount != null)
&& (rightRowCount != null)
&& ((leftRowCount < rightRowCount)
|| ((Math.abs(leftRowCount - rightRowCount)
< RelOptUtil.EPSILON)
&& (rowWidthCost(left.getJoinTree())
< rowWidthCost(right.getJoinTree()))))) {
swap = true;
}
return swap;
}
示例4: isEqWithEpsilon
public boolean isEqWithEpsilon(RelOptCost other) {
if (!(other instanceof VolcanoCost)) {
return false;
}
VolcanoCost that = (VolcanoCost) other;
return (this == that)
|| ((Math.abs(this.rowCount - that.rowCount) < RelOptUtil.EPSILON)
&& (Math.abs(this.cpu - that.cpu) < RelOptUtil.EPSILON)
&& (Math.abs(this.io - that.io) < RelOptUtil.EPSILON));
}