public boolean isEqWithEpsilon(RelOptCost other) { return (this == other) || ((Math.abs(this.io - other.getIo()) < RelOptUtil.EPSILON) && (Math.abs(this.cpu - other.getCpu()) < RelOptUtil.EPSILON) && (Math .abs(this.rowCount - other.getRows()) < RelOptUtil.EPSILON)); }
public boolean isEqWithEpsilon(RelOptCost other) { return (this == other) || ((Math.abs(this.io - other.getIo()) < RelOptUtil.EPSILON) && (Math.abs(this.cpu - other.getCpu()) < RelOptUtil.EPSILON) && (Math .abs(this.rowCount - other.getRows()) < RelOptUtil.EPSILON)); }
public boolean equals(RelOptCost other) { return (this == other) || ((this.cpu + this.io == other.getCpu() + other.getIo()) && (this.rowCount == other.getRows())); }
public double divideBy(RelOptCost cost) { // Compute the geometric average of the ratios of all of the factors // which are non-zero and finite. double d = 1; double n = 0; if ((this.rowCount != 0) && !Double.isInfinite(this.rowCount) && (cost.getRows() != 0) && !Double.isInfinite(cost.getRows())) { d *= this.rowCount / cost.getRows(); ++n; } if ((this.cpu != 0) && !Double.isInfinite(this.cpu) && (cost.getCpu() != 0) && !Double.isInfinite(cost.getCpu())) { d *= this.cpu / cost.getCpu(); ++n; } if ((this.io != 0) && !Double.isInfinite(this.io) && (cost.getIo() != 0) && !Double.isInfinite(cost.getIo())) { d *= this.io / cost.getIo(); ++n; } if (n == 0) { return 1.0; } return Math.pow(d, 1 / n); }
public boolean equals(RelOptCost other) { return (this == other) || ((this.cpu + this.io == other.getCpu() + other.getIo()) && (this.rowCount == other.getRows())); }
public double divideBy(RelOptCost cost) { // Compute the geometric average of the ratios of all of the factors // which are non-zero and finite. double d = 1; double n = 0; if ((this.rowCount != 0) && !Double.isInfinite(this.rowCount) && (cost.getRows() != 0) && !Double.isInfinite(cost.getRows())) { d *= this.rowCount / cost.getRows(); ++n; } if ((this.cpu != 0) && !Double.isInfinite(this.cpu) && (cost.getCpu() != 0) && !Double.isInfinite(cost.getCpu())) { d *= this.cpu / cost.getCpu(); ++n; } if ((this.io != 0) && !Double.isInfinite(this.io) && (cost.getIo() != 0) && !Double.isInfinite(cost.getIo())) { d *= this.io / cost.getIo(); ++n; } if (n == 0) { return 1.0; } return Math.pow(d, 1 / n); }
public RelOptCost minus(RelOptCost other) { if (this == INFINITY) { return this; } return new HiveCost(this.rowCount - other.getRows(), this.cpu - other.getCpu(), this.io - other.getIo()); }
public RelOptCost minus(RelOptCost other) { if (this == INFINITY) { return this; } return new HiveCost(this.rowCount - other.getRows(), this.cpu - other.getCpu(), this.io - other.getIo()); }
public RelOptCost plus(RelOptCost other) { if ((this == INFINITY) || (other.isInfinite())) { return INFINITY; } return new HiveCost(this.rowCount + other.getRows(), this.cpu + other.getCpu(), this.io + other.getIo()); }
public RelOptCost plus(RelOptCost other) { if ((this == INFINITY) || (other.isInfinite())) { return INFINITY; } return new HiveCost(this.rowCount + other.getRows(), this.cpu + other.getCpu(), this.io + other.getIo()); }
public boolean isEqWithEpsilon(RelOptCost other) { return (this == other) || ((Math.abs(this.io - other.getIo()) < RelOptUtil.EPSILON) && (Math.abs(this.cpu - other.getCpu()) < RelOptUtil.EPSILON) && (Math .abs(this.rowCount - other.getRows()) < RelOptUtil.EPSILON)); }
public boolean equals(RelOptCost other) { return (this == other) || ((this.cpu + this.io == other.getCpu() + other.getIo()) && (this.rowCount == other.getRows())); }
/** * Returns the aggregate cost from given {@link org.apache.calcite.plan.RelOptCost} cost. * */ public static double aggregateCost(final org.apache.calcite.plan.RelOptCost cost) { final double aggCost = DremioCost.BASE_CPU_COST * cost.getCpu() + DremioCost.BYTE_DISK_READ_COST * cost.getIo(); if (cost instanceof DremioCost) { final DremioCost dremioCost = (DremioCost) cost; return aggCost + DremioCost.BYTE_NETWORK_COST * dremioCost.getNetwork() + dremioCost.getMemory() * DremioCost.BASE_CPU_COST / DremioCost.MEMORY_TO_CPU_RATIO; } return aggCost; }
/** * Converts a cost to a scalar quantity. */ private double toDouble(RelOptCost cost) { if (cost.isInfinite()) { return 1e+30; } else { return cost.getCpu() + cost.getRows() + cost.getIo(); } }
/** * Converts a cost to a scalar quantity. */ private double toDouble(RelOptCost cost) { if (cost.isInfinite()) { return 1e+30; } else { return cost.getCpu() + cost.getRows() + cost.getIo(); } }
public RelOptCost minus(RelOptCost other) { if (this == INFINITY) { return this; } return new HiveCost(this.rowCount - other.getRows(), this.cpu - other.getCpu(), this.io - other.getIo()); }
public RelOptCost plus(RelOptCost other) { if ((this == INFINITY) || (other.isInfinite())) { return INFINITY; } return new HiveCost(this.rowCount + other.getRows(), this.cpu + other.getCpu(), this.io + other.getIo()); }