public static TypeComparatorFactory<?> getShipComparator(Channel channel, ExecutionConfig executionConfig) { PlanNode source = channel.getSource(); Operator<?> javaOp = source.getProgramOperator(); TypeInformation<?> type = javaOp.getOperatorInfo().getOutputType(); return createComparator(type, channel.getShipStrategyKeys(), getSortOrders(channel.getShipStrategyKeys(), channel.getShipStrategySortOrder()), executionConfig); }
/** * Parametrizes the local strategy fields of a channel such that the channel produces the desired local properties. * * @param channel The channel to parametrize. */ public void parameterizeChannel(Channel channel) { LocalProperties current = channel.getLocalProperties(); if (isMetBy(current)) { // we are met, all is good channel.setLocalStrategy(LocalStrategy.NONE); } else if (this.ordering != null) { channel.setLocalStrategy(LocalStrategy.SORT, this.ordering.getInvolvedIndexes(), this.ordering.getFieldSortDirections()); } else if (this.groupedFields != null) { boolean[] dirs = new boolean[this.groupedFields.size()]; Arrays.fill(dirs, true); channel.setLocalStrategy(LocalStrategy.SORT, Utils.createOrderedFromSet(this.groupedFields), dirs); } else { channel.setLocalStrategy(LocalStrategy.NONE); } }
@Override protected List<LocalPropertiesPair> createPossibleLocalProperties() { RequestedLocalProperties sort1 = new RequestedLocalProperties(Utils.createOrdering(this.keys1)); RequestedLocalProperties sort2 = new RequestedLocalProperties(Utils.createOrdering(this.keys2)); return Collections.singletonList(new LocalPropertiesPair(sort1, sort2)); }
final int targetParallelism = targetNode.getParallelism(); final Costs defaultZeroCosts = new Costs(0, 0, 0); final TypeComparatorFactory<?> comparator = Utils.getShipComparator(channel, this.plan.getOriginalPlan().getExecutionConfig());
final int targetParallelism = targetNode.getParallelism(); final Costs defaultZeroCosts = new Costs(0, 0, 0); final TypeComparatorFactory<?> comparator = Utils.getShipComparator(channel, this.plan.getOriginalPlan().getExecutionConfig());
@Override protected List<LocalPropertiesPair> createPossibleLocalProperties() { RequestedLocalProperties sort = new RequestedLocalProperties(Utils.createOrdering(this.keys1)); RequestedLocalProperties none = new RequestedLocalProperties(); return Collections.singletonList(new LocalPropertiesPair(sort, none)); }
public static TypeComparatorFactory<?> getShipComparator(Channel channel, ExecutionConfig executionConfig) { PlanNode source = channel.getSource(); Operator<?> javaOp = source.getProgramOperator(); TypeInformation<?> type = javaOp.getOperatorInfo().getOutputType(); return createComparator(type, channel.getShipStrategyKeys(), getSortOrders(channel.getShipStrategyKeys(), channel.getShipStrategySortOrder()), executionConfig); }
case HASH_PARTITIONED: shipType = ShipStrategyType.PARTITION_HASH; partitionKeys = Utils.createOrderedFromSet(this.partitioningFields); sortDirection = null; partitioner = null;
final int targetParallelism = targetNode.getParallelism(); final Costs defaultZeroCosts = new Costs(0, 0, 0); final TypeComparatorFactory<?> comparator = Utils.getShipComparator(channel, this.plan.getOriginalPlan().getExecutionConfig());
@Override protected List<LocalPropertiesPair> createPossibleLocalProperties() { RequestedLocalProperties none = new RequestedLocalProperties(); RequestedLocalProperties sort = new RequestedLocalProperties(Utils.createOrdering(this.keys2)); return Collections.singletonList(new LocalPropertiesPair(none, sort)); }
public static TypeComparatorFactory<?> getShipComparator(Channel channel, ExecutionConfig executionConfig) { PlanNode source = channel.getSource(); Operator<?> javaOp = source.getProgramOperator(); TypeInformation<?> type = javaOp.getOperatorInfo().getOutputType(); return createComparator(type, channel.getShipStrategyKeys(), getSortOrders(channel.getShipStrategyKeys(), channel.getShipStrategySortOrder()), executionConfig); }
case HASH_PARTITIONED: shipType = ShipStrategyType.PARTITION_HASH; partitionKeys = Utils.createOrderedFromSet(this.partitioningFields); sortDirection = null; partitioner = null; partitionKeys = Utils.createOrderedFromSet(this.partitioningFields); sortDirection = null; partitioner = this.customPartitioner;
final int targetParallelism = targetNode.getParallelism(); final Costs defaultZeroCosts = new Costs(0, 0, 0); final TypeComparatorFactory<?> comparator = Utils.getShipComparator(channel, this.plan.getOriginalPlan().getExecutionConfig());
public LocalProperties getLocalProperties() { if (this.localProps == null) { computeLocalPropertiesAfterShippingOnly(); switch (this.localStrategy) { case NONE: break; case SORT: case COMBININGSORT: this.localProps = LocalProperties.forOrdering(Utils.createOrdering(this.localKeys, this.localSortOrder)); break; default: throw new CompilerException("Unsupported local strategy for channel."); } } return this.localProps; }
public static TypeComparatorFactory<?> getShipComparator(Channel channel, ExecutionConfig executionConfig) { PlanNode source = channel.getSource(); Operator<?> javaOp = source.getProgramOperator(); TypeInformation<?> type = javaOp.getOperatorInfo().getOutputType(); return createComparator(type, channel.getShipStrategyKeys(), getSortOrders(channel.getShipStrategyKeys(), channel.getShipStrategySortOrder()), executionConfig); }
/** * Parametrizes the local strategy fields of a channel such that the channel produces the desired local properties. * * @param channel The channel to parametrize. */ public void parameterizeChannel(Channel channel) { LocalProperties current = channel.getLocalProperties(); if (isMetBy(current)) { // we are met, all is good channel.setLocalStrategy(LocalStrategy.NONE); } else if (this.ordering != null) { channel.setLocalStrategy(LocalStrategy.SORT, this.ordering.getInvolvedIndexes(), this.ordering.getFieldSortDirections()); } else if (this.groupedFields != null) { boolean[] dirs = new boolean[this.groupedFields.size()]; Arrays.fill(dirs, true); channel.setLocalStrategy(LocalStrategy.SORT, Utils.createOrderedFromSet(this.groupedFields), dirs); } else { channel.setLocalStrategy(LocalStrategy.NONE); } }
final int targetParallelism = targetNode.getParallelism(); final Costs defaultZeroCosts = new Costs(0, 0, 0); final TypeComparatorFactory<?> comparator = Utils.getShipComparator(channel, this.plan.getOriginalPlan().getExecutionConfig());
this.ordering1 = Utils.createOrdering(this.keys1); this.ordering2 = Utils.createOrdering(this.keys2);
public static TypeComparatorFactory<?> getShipComparator(Channel channel, ExecutionConfig executionConfig) { PlanNode source = channel.getSource(); Operator<?> javaOp = source.getProgramOperator(); TypeInformation<?> type = javaOp.getOperatorInfo().getOutputType(); return createComparator(type, channel.getShipStrategyKeys(), getSortOrders(channel.getShipStrategyKeys(), channel.getShipStrategySortOrder()), executionConfig); }
/** * Parametrizes the local strategy fields of a channel such that the channel produces the desired local properties. * * @param channel The channel to parametrize. */ public void parameterizeChannel(Channel channel) { LocalProperties current = channel.getLocalProperties(); if (isMetBy(current)) { // we are met, all is good channel.setLocalStrategy(LocalStrategy.NONE); } else if (this.ordering != null) { channel.setLocalStrategy(LocalStrategy.SORT, this.ordering.getInvolvedIndexes(), this.ordering.getFieldSortDirections()); } else if (this.groupedFields != null) { boolean[] dirs = new boolean[this.groupedFields.size()]; Arrays.fill(dirs, true); channel.setLocalStrategy(LocalStrategy.SORT, Utils.createOrderedFromSet(this.groupedFields), dirs); } else { channel.setLocalStrategy(LocalStrategy.NONE); } }