use of org.apache.hyracks.algebricks.core.algebra.operators.logical.AbstractScanOperator in project asterixdb by apache.
the class ExternalDataLookupPOperator method computeDeliveredProperties.
@Override
public void computeDeliveredProperties(ILogicalOperator op, IOptimizationContext context) throws AlgebricksException {
DataSource ds = new DatasetDataSource(datasetId, dataset, recordType, null, /*external dataset doesn't have meta records.*/
Type.EXTERNAL_DATASET, dataset.getDatasetDetails(), context.getComputationNodeDomain());
IDataSourcePropertiesProvider dspp = ds.getPropertiesProvider();
AbstractScanOperator as = (AbstractScanOperator) op;
deliveredProperties = dspp.computePropertiesVector(as.getVariables());
}
use of org.apache.hyracks.algebricks.core.algebra.operators.logical.AbstractScanOperator in project asterixdb by apache.
the class IndexSearchPOperator method computeDeliveredProperties.
@Override
public void computeDeliveredProperties(ILogicalOperator op, IOptimizationContext context) {
IDataSource<?> ds = idx.getDataSource();
IDataSourcePropertiesProvider dspp = ds.getPropertiesProvider();
AbstractScanOperator as = (AbstractScanOperator) op;
deliveredProperties = dspp.computePropertiesVector(as.getVariables());
}
use of org.apache.hyracks.algebricks.core.algebra.operators.logical.AbstractScanOperator in project asterixdb by apache.
the class ComplexJoinInferenceRule method rewritePost.
@Override
public boolean rewritePost(Mutable<ILogicalOperator> opRef, IOptimizationContext context) throws AlgebricksException {
ILogicalOperator op = opRef.getValue();
if (!(op instanceof AbstractScanOperator)) {
return false;
}
Mutable<ILogicalOperator> opRef2 = op.getInputs().get(0);
AbstractLogicalOperator op2 = (AbstractLogicalOperator) opRef2.getValue();
if (op2.getOperatorTag() != LogicalOperatorTag.SUBPLAN) {
return false;
}
SubplanOperator subplan = (SubplanOperator) op2;
Mutable<ILogicalOperator> opRef3 = subplan.getInputs().get(0);
AbstractLogicalOperator op3 = (AbstractLogicalOperator) opRef3.getValue();
if (op3.getOperatorTag() == LogicalOperatorTag.EMPTYTUPLESOURCE || op3.getOperatorTag() == LogicalOperatorTag.NESTEDTUPLESOURCE) {
return false;
}
if (subplanHasFreeVariables(subplan)) {
return false;
}
HashSet<LogicalVariable> varsUsedInUnnest = new HashSet<LogicalVariable>();
VariableUtilities.getUsedVariables(op, varsUsedInUnnest);
HashSet<LogicalVariable> producedInSubplan = new HashSet<LogicalVariable>();
VariableUtilities.getProducedVariables(subplan, producedInSubplan);
if (!producedInSubplan.containsAll(varsUsedInUnnest)) {
return false;
}
ntsToEtsInSubplan(subplan, context);
cleanupJoins(subplan);
InnerJoinOperator join = new InnerJoinOperator(new MutableObject<ILogicalExpression>(ConstantExpression.TRUE));
join.getInputs().add(opRef3);
opRef2.setValue(OperatorManipulationUtil.eliminateSingleSubplanOverEts(subplan));
join.getInputs().add(new MutableObject<ILogicalOperator>(op));
opRef.setValue(join);
context.computeAndSetTypeEnvironmentForOperator(join);
return true;
}
Aggregations