Java Code Examples for org.apache.calcite.rel.core.Minus#getInputs()

The following examples show how to use org.apache.calcite.rel.core.Minus#getInputs() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RelMdUtil.java    From Bats with Apache License 2.0 5 votes vote down vote up
/** Returns an estimate of the number of rows returned by a {@link Minus}. */
public static double getMinusRowCount(RelMetadataQuery mq, Minus minus) {
  // REVIEW jvs 30-May-2005:  I just pulled this out of a hat.
  final List<RelNode> inputs = minus.getInputs();
  double dRows = mq.getRowCount(inputs.get(0));
  for (int i = 1; i < inputs.size(); i++) {
    dRows -= 0.5 * mq.getRowCount(inputs.get(i));
  }
  if (dRows < 0) {
    dRows = 0;
  }
  return dRows;
}
 
Example 2
Source File: RelMdRowCount.java    From Bats with Apache License 2.0 5 votes vote down vote up
public Double getRowCount(Minus rel, RelMetadataQuery mq) {
  Double rowCount = null;
  for (RelNode input : rel.getInputs()) {
    Double partialRowCount = mq.getRowCount(input);
    if (rowCount == null
        || partialRowCount != null && partialRowCount < rowCount) {
      rowCount = partialRowCount;
    }
  }
  return rowCount;
}
 
Example 3
Source File: RelMdUtil.java    From calcite with Apache License 2.0 5 votes vote down vote up
/** Returns an estimate of the number of rows returned by a {@link Minus}. */
public static double getMinusRowCount(RelMetadataQuery mq, Minus minus) {
  // REVIEW jvs 30-May-2005:  I just pulled this out of a hat.
  final List<RelNode> inputs = minus.getInputs();
  double dRows = mq.getRowCount(inputs.get(0));
  for (int i = 1; i < inputs.size(); i++) {
    dRows -= 0.5 * mq.getRowCount(inputs.get(i));
  }
  if (dRows < 0) {
    dRows = 0;
  }
  return dRows;
}
 
Example 4
Source File: RelMdRowCount.java    From calcite with Apache License 2.0 5 votes vote down vote up
public Double getRowCount(Minus rel, RelMetadataQuery mq) {
  Double rowCount = null;
  for (RelNode input : rel.getInputs()) {
    Double partialRowCount = mq.getRowCount(input);
    if (rowCount == null
        || partialRowCount != null && partialRowCount < rowCount) {
      rowCount = partialRowCount;
    }
  }
  return rowCount;
}