use of org.apache.hyracks.algebricks.core.algebra.properties.IPartitioningProperty in project asterixdb by apache.
the class RangePartitionMergeExchangePOperator method computeDeliveredProperties.
@Override
public void computeDeliveredProperties(ILogicalOperator op, IOptimizationContext context) {
List<LogicalVariable> varList = new ArrayList<LogicalVariable>();
for (OrderColumn oc : partitioningFields) {
varList.add(oc.getColumn());
}
IPartitioningProperty p = new UnorderedPartitionedProperty(new ListSet<LogicalVariable>(varList), domain);
AbstractLogicalOperator op2 = (AbstractLogicalOperator) op.getInputs().get(0).getValue();
List<ILocalStructuralProperty> op2Locals = op2.getDeliveredPhysicalProperties().getLocalProperties();
List<ILocalStructuralProperty> locals = new ArrayList<ILocalStructuralProperty>();
for (ILocalStructuralProperty prop : op2Locals) {
if (prop.getPropertyType() == PropertyType.LOCAL_ORDER_PROPERTY) {
locals.add(prop);
} else {
break;
}
}
this.deliveredProperties = new StructuralPropertiesVector(p, locals);
}
use of org.apache.hyracks.algebricks.core.algebra.properties.IPartitioningProperty in project asterixdb by apache.
the class PreSortedDistinctByPOperator method getRequiredPropertiesForChildren.
@Override
public PhysicalRequirements getRequiredPropertiesForChildren(ILogicalOperator op, IPhysicalPropertiesVector reqdByParent, IOptimizationContext context) {
StructuralPropertiesVector[] pv = new StructuralPropertiesVector[1];
List<ILocalStructuralProperty> localProps = new ArrayList<ILocalStructuralProperty>();
List<OrderColumn> orderColumns = new ArrayList<OrderColumn>();
for (LogicalVariable column : columnList) {
orderColumns.add(new OrderColumn(column, OrderKind.ASC));
}
localProps.add(new LocalOrderProperty(orderColumns));
IPartitioningProperty pp = null;
AbstractLogicalOperator aop = (AbstractLogicalOperator) op;
if (aop.getExecutionMode() == ExecutionMode.PARTITIONED) {
pp = new UnorderedPartitionedProperty(new ListSet<LogicalVariable>(columnList), context.getComputationNodeDomain());
}
pv[0] = new StructuralPropertiesVector(pp, localProps);
return new PhysicalRequirements(pv, IPartitioningRequirementsCoordinator.NO_COORDINATION);
}
use of org.apache.hyracks.algebricks.core.algebra.properties.IPartitioningProperty in project asterixdb by apache.
the class PreSortedDistinctByPOperator method computeDeliveredProperties.
@Override
public void computeDeliveredProperties(ILogicalOperator op, IOptimizationContext context) {
AbstractLogicalOperator op2 = (AbstractLogicalOperator) op.getInputs().get(0).getValue();
IPartitioningProperty pp = op2.getDeliveredPhysicalProperties().getPartitioningProperty();
List<ILocalStructuralProperty> propsLocal = op2.getDeliveredPhysicalProperties().getLocalProperties();
deliveredProperties = new StructuralPropertiesVector(pp, propsLocal);
}
use of org.apache.hyracks.algebricks.core.algebra.properties.IPartitioningProperty in project asterixdb by apache.
the class SinkWritePOperator method getRequiredPropertiesForChildren.
@Override
public PhysicalRequirements getRequiredPropertiesForChildren(ILogicalOperator op, IPhysicalPropertiesVector reqdByParent, IOptimizationContext context) {
WriteOperator write = (WriteOperator) op;
IDataSink sink = write.getDataSink();
IPartitioningProperty pp = sink.getPartitioningProperty();
StructuralPropertiesVector[] r = new StructuralPropertiesVector[] { new StructuralPropertiesVector(pp, null) };
return new PhysicalRequirements(r, IPartitioningRequirementsCoordinator.NO_COORDINATION);
}
use of org.apache.hyracks.algebricks.core.algebra.properties.IPartitioningProperty in project asterixdb by apache.
the class DataSourcePartitioningProvider method getFeedPartitioningProperty.
public static IPartitioningProperty getFeedPartitioningProperty(DataSource ds, INodeDomain domain, List<LogicalVariable> scanVariables) {
IPartitioningProperty pp;
if (scanVariables.size() < 2) {
pp = new RandomPartitioningProperty(domain);
} else {
Set<LogicalVariable> pvars = new ListSet<>();
pvars.addAll(ds.getPrimaryKeyVariables(scanVariables));
pp = new UnorderedPartitionedProperty(pvars, domain);
}
return pp;
}
Aggregations