public Integer splitCount(RelNode rel, RelMetadataQuery mq) { Boolean newPhase = mq.isPhaseTransition(rel); if (newPhase == null) { return null; } if (newPhase) { // We repartition: new number of splits return splitCountRepartition(rel, mq); } // We do not repartition: take number of splits from children Integer splitCount = 0; for (RelNode input : rel.getInputs()) { splitCount += mq.splitCount(input); } return splitCount; }
public Integer splitCount(RelNode rel, RelMetadataQuery mq) { Boolean newPhase = mq.isPhaseTransition(rel); if (newPhase == null) { return null; } if (newPhase) { // We repartition: new number of splits return splitCountRepartition(rel, mq); } // We do not repartition: take number of splits from children Integer splitCount = 0; for (RelNode input : rel.getInputs()) { splitCount += mq.splitCount(input); } return splitCount; }
public Integer splitCount(RelNode rel) { Boolean newPhase = RelMetadataQuery.isPhaseTransition(rel); if (newPhase == null) { return null; } if (newPhase) { // We repartition: new number of splits return splitCountRepartition(rel); } // We do not repartition: take number of splits from children Integer splitCount = 0; for (RelNode input : rel.getInputs()) { splitCount += RelMetadataQuery.splitCount(input); } return splitCount; }
/** Catch-all implementation for * {@link BuiltInMetadata.Memory#cumulativeMemoryWithinPhase()}, * invoked using reflection. * * @see org.apache.calcite.rel.metadata.RelMetadataQuery#memory */ public Double cumulativeMemoryWithinPhase(RelNode rel, RelMetadataQuery mq) { Double nullable = mq.memory(rel); if (nullable == null) { return null; } Boolean isPhaseTransition = mq.isPhaseTransition(rel); if (isPhaseTransition == null) { return null; } double d = nullable; if (!isPhaseTransition) { for (RelNode input : rel.getInputs()) { nullable = mq.cumulativeMemoryWithinPhase(input); if (nullable == null) { return null; } d += nullable; } } return d; }
/** Catch-all implementation for * {@link BuiltInMetadata.Memory#cumulativeMemoryWithinPhase()}, * invoked using reflection. * * @see org.apache.calcite.rel.metadata.RelMetadataQuery#memory */ public Double cumulativeMemoryWithinPhase(RelNode rel, RelMetadataQuery mq) { Double nullable = mq.memory(rel); if (nullable == null) { return null; } Boolean isPhaseTransition = mq.isPhaseTransition(rel); if (isPhaseTransition == null) { return null; } double d = nullable; if (!isPhaseTransition) { for (RelNode input : rel.getInputs()) { nullable = mq.cumulativeMemoryWithinPhase(input); if (nullable == null) { return null; } d += nullable; } } return d; }
assertThat(mq.cumulativeMemoryWithinPhaseSplit(aggregate), nullValue()); assertThat(mq.isPhaseTransition(aggregate), is(false)); assertThat(mq.splitCount(aggregate), is(1));
assertThat(mq.cumulativeMemoryWithinPhaseSplit(aggregate), nullValue()); assertThat(mq.isPhaseTransition(aggregate), is(false)); assertThat(mq.splitCount(aggregate), is(1));