org.apache.calcite.rel.logical.LogicalSnapshot Java Examples

The following examples show how to use org.apache.calcite.rel.logical.LogicalSnapshot. 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: FlinkAggregateJoinTransposeRule.java    From flink with Apache License 2.0 6 votes vote down vote up
private boolean containsSnapshot(RelNode relNode) {
	RelNode original = null;
	if (relNode instanceof RelSubset) {
		original = ((RelSubset) relNode).getOriginal();
	} else if (relNode instanceof HepRelVertex) {
		original = ((HepRelVertex) relNode).getCurrentRel();
	} else {
		original = relNode;
	}
	if (original instanceof LogicalSnapshot) {
		return true;
	} else if (original instanceof SingleRel) {
		return containsSnapshot(((SingleRel) original).getInput());
	} else {
		return false;
	}
}
 
Example #2
Source File: FlinkAggregateJoinTransposeRule.java    From flink with Apache License 2.0 6 votes vote down vote up
private boolean containsSnapshot(RelNode relNode) {
	RelNode original = null;
	if (relNode instanceof RelSubset) {
		original = ((RelSubset) relNode).getOriginal();
	} else if (relNode instanceof HepRelVertex) {
		original = ((HepRelVertex) relNode).getCurrentRel();
	} else {
		original = relNode;
	}
	if (original instanceof LogicalSnapshot) {
		return true;
	} else if (original instanceof SingleRel) {
		return containsSnapshot(((SingleRel) original).getInput());
	} else {
		return false;
	}
}
 
Example #3
Source File: RelDecorrelator.java    From flink with Apache License 2.0 5 votes vote down vote up
/**
 * Rewrite LogicalSnapshot.
 *
 * @param rel the snapshot rel to rewrite
 */
public Frame decorrelateRel(LogicalSnapshot rel) {
  if (RexUtil.containsCorrelation(rel.getPeriod())) {
    return null;
  }
  return decorrelateRel((RelNode) rel);
}
 
Example #4
Source File: RelDecorrelator.java    From flink with Apache License 2.0 5 votes vote down vote up
/**
 * Rewrite LogicalSnapshot.
 *
 * @param rel the snapshot rel to rewrite
 */
public Frame decorrelateRel(LogicalSnapshot rel) {
  if (RexUtil.containsCorrelation(rel.getPeriod())) {
    return null;
  }
  return decorrelateRel((RelNode) rel);
}
 
Example #5
Source File: RelStructuredTypeFlattener.java    From calcite with Apache License 2.0 5 votes vote down vote up
public void rewriteRel(LogicalSnapshot rel) {
  RelNode newRel =
      rel.copy(rel.getTraitSet(),
          getNewForOldRel(rel.getInput()),
          rel.getPeriod().accept(new RewriteRexShuttle()));
  setNewForOldRel(rel, newRel);
}
 
Example #6
Source File: RelFactories.java    From Bats with Apache License 2.0 4 votes vote down vote up
public RelNode createSnapshot(RelNode input, RexNode period) {
  return LogicalSnapshot.create(input, period);
}
 
Example #7
Source File: RelStructuredTypeFlattener.java    From Bats with Apache License 2.0 4 votes vote down vote up
public void rewriteRel(LogicalSnapshot rel) {
    RelNode newRel = rel.copy(rel.getTraitSet(), getNewForOldRel(rel.getInput()),
            rel.getPeriod().accept(new RewriteRexShuttle()));
    setNewForOldRel(rel, newRel);
}
 
Example #8
Source File: RelFactories.java    From calcite with Apache License 2.0 4 votes vote down vote up
public RelNode createSnapshot(RelNode input, RexNode period) {
  return LogicalSnapshot.create(input, period);
}
 
Example #9
Source File: RelDecorrelator.java    From calcite with Apache License 2.0 4 votes vote down vote up
public Frame decorrelateRel(LogicalSnapshot rel) {
  if (RexUtil.containsCorrelation(rel.getPeriod())) {
    return null;
  }
  return decorrelateRel((RelNode) rel);
}