use of io.prestosql.sql.analyzer.FeaturesConfig.JoinDistributionType in project hetu-core by openlookeng.
the class DetermineJoinDistributionType method canReplicate.
public static boolean canReplicate(JoinNode joinNode, Context context) {
JoinDistributionType joinDistributionType = getJoinDistributionType(context.getSession());
if (!joinDistributionType.canReplicate()) {
return false;
}
Optional<DataSize> joinMaxBroadcastTableSize = getJoinMaxBroadcastTableSize(context.getSession());
if (!joinMaxBroadcastTableSize.isPresent()) {
return true;
}
PlanNode buildSide = joinNode.getRight();
PlanNodeStatsEstimate buildSideStatsEstimate = context.getStatsProvider().getStats(buildSide);
double buildSideSizeInBytes = buildSideStatsEstimate.getOutputSizeInBytes(buildSide.getOutputSymbols(), context.getSymbolAllocator().getTypes());
return buildSideSizeInBytes <= joinMaxBroadcastTableSize.get().toBytes() || getSourceTablesSizeInBytes(buildSide, context) <= joinMaxBroadcastTableSize.get().toBytes();
}
Aggregations