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

The following examples show how to use org.apache.calcite.rel.core.Intersect#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: RelMdMaxRowCount.java    From Bats with Apache License 2.0 5 votes vote down vote up
public Double getMaxRowCount(Intersect rel, RelMetadataQuery mq) {
  // max row count is the smallest of the inputs
  Double rowCount = null;
  for (RelNode input : rel.getInputs()) {
    Double partialRowCount = mq.getMaxRowCount(input);
    if (rowCount == null
        || partialRowCount != null && partialRowCount < rowCount) {
      rowCount = partialRowCount;
    }
  }
  return rowCount;
}
 
Example 2
Source File: RelMdColumnUniqueness.java    From Bats with Apache License 2.0 5 votes vote down vote up
public Boolean areColumnsUnique(Intersect rel, RelMetadataQuery mq,
    ImmutableBitSet columns, boolean ignoreNulls) {
  if (areColumnsUnique((SetOp) rel, mq, columns, ignoreNulls)) {
    return true;
  }
  for (RelNode input : rel.getInputs()) {
    Boolean b = mq.areColumnsUnique(input, columns, ignoreNulls);
    if (b != null && b) {
      return true;
    }
  }
  return false;
}
 
Example 3
Source File: RelMdRowCount.java    From Bats with Apache License 2.0 5 votes vote down vote up
public Double getRowCount(Intersect 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 4
Source File: RelMdMaxRowCount.java    From calcite with Apache License 2.0 5 votes vote down vote up
public Double getMaxRowCount(Intersect rel, RelMetadataQuery mq) {
  // max row count is the smallest of the inputs
  Double rowCount = null;
  for (RelNode input : rel.getInputs()) {
    Double partialRowCount = mq.getMaxRowCount(input);
    if (rowCount == null
        || partialRowCount != null && partialRowCount < rowCount) {
      rowCount = partialRowCount;
    }
  }
  return rowCount;
}
 
Example 5
Source File: RelMdColumnUniqueness.java    From calcite with Apache License 2.0 5 votes vote down vote up
public Boolean areColumnsUnique(Intersect rel, RelMetadataQuery mq,
    ImmutableBitSet columns, boolean ignoreNulls) {
  columns = decorateWithConstantColumnsFromPredicates(columns, rel, mq);
  if (areColumnsUnique((SetOp) rel, mq, columns, ignoreNulls)) {
    return true;
  }
  for (RelNode input : rel.getInputs()) {
    Boolean b = mq.areColumnsUnique(input, columns, ignoreNulls);
    if (b != null && b) {
      return true;
    }
  }
  return false;
}
 
Example 6
Source File: RelMdRowCount.java    From calcite with Apache License 2.0 5 votes vote down vote up
public Double getRowCount(Intersect 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;
    }
  }
  if (rowCount == null || !rel.all) {
    return rowCount;
  } else {
    return rowCount * 2;
  }
}