@Override public boolean satisfies(RelTrait trait) { if (trait == this) { return true; } switch (((RelDistribution)trait).getType()) { case HASH_DISTRIBUTED : return this.getKeys().equals(((RelDistribution)trait).getKeys()); default: throw new RuntimeException("Other distributions are not used yet."); } }
@Override public boolean satisfies(RelTrait trait) { if (trait == this) { return true; } switch (((RelDistribution)trait).getType()) { case HASH_DISTRIBUTED : return this.getKeys().equals(((RelDistribution)trait).getKeys()); default: throw new RuntimeException("Other distributions are not used yet."); } }
public boolean isBucketedInput() { return RelMetadataQuery.instance().distribution(this.getInput()).getKeys(). containsAll(groupSet.asList()); }
public boolean isBucketedInput() { final RelMetadataQuery mq = this.getInput().getCluster().getMetadataQuery(); return mq.distribution(this).getKeys(). containsAll(groupSet.asList()); }
@Override public int compareTo(RelMultipleTrait o) { final RelDistribution distribution = (RelDistribution) o; if (type == distribution.getType() && (type == Type.HASH_DISTRIBUTED || type == Type.RANGE_DISTRIBUTED)) { return ORDERING.compare(getKeys(), distribution.getKeys()); } return type.compareTo(distribution.getType()); }
return false; if (!distribution.getKeys().containsAll(joinKeysInChildren.get(i))) { return false;
return false; if (!distribution.getKeys().containsAll(joinKeysInChildren.get(i))) { return false;
return false; if (!distribution.getKeys().containsAll(joinKeysInChildren.get(i))) { return false;
return false; if (!distribution.getKeys().containsAll(joinKeysInChildren.get(i))) { return false;
@Override public boolean satisfies(RelTrait trait) { if (trait == this) { return true; } switch (((RelDistribution)trait).getType()) { case HASH_DISTRIBUTED : return this.getKeys().equals(((RelDistribution)trait).getKeys()); default: throw new RuntimeException("Other distributions are not used yet."); } }
public boolean isBucketedInput() { return RelMetadataQuery.distribution(this.getInput()).getKeys(). containsAll(groupSet.asList()); }
@Override public int compareTo(@Nonnull RelMultipleTrait o) { final RelDistribution distribution = (RelDistribution) o; if (type == distribution.getType() && (type == Type.HASH_DISTRIBUTED || type == Type.RANGE_DISTRIBUTED)) { return ORDERING.compare(getKeys(), distribution.getKeys()); } return type.compareTo(distribution.getType()); } }
@Override public int compareTo(@Nonnull RelMultipleTrait o) { final RelDistribution distribution = (RelDistribution) o; if (type == distribution.getType() && (type == Type.HASH_DISTRIBUTED || type == Type.RANGE_DISTRIBUTED)) { return ORDERING.compare(getKeys(), distribution.getKeys()); } return type.compareTo(distribution.getType()); } }
@Override public boolean isExecutable(HiveJoin join) { // Requirements: for SMB, sorted by their keys on both sides and bucketed. // Get key columns JoinPredicateInfo joinPredInfo = join.getJoinPredicateInfo(); List<ImmutableIntList> joinKeysInChildren = new ArrayList<ImmutableIntList>(); joinKeysInChildren.add( ImmutableIntList.copyOf( joinPredInfo.getProjsFromLeftPartOfJoinKeysInChildSchema())); joinKeysInChildren.add( ImmutableIntList.copyOf( joinPredInfo.getProjsFromRightPartOfJoinKeysInChildSchema())); for (int i=0; i<join.getInputs().size(); i++) { RelNode input = join.getInputs().get(i); // Is smbJoin possible? We need correct order boolean orderFound = join.getSortedInputs().get(i); if (!orderFound) { return false; } // Is smbJoin possible? We need correct bucketing RelDistribution distribution = RelMetadataQuery.distribution(input); if (distribution.getType() != Type.HASH_DISTRIBUTED) { return false; } if (!distribution.getKeys().containsAll(joinKeysInChildren.get(i))) { return false; } } return true; }
return false; if (!distribution.getKeys().containsAll(joinKeysInChildren.get(i))) { return false;