use of io.trino.sql.planner.OptimizerConfig.JoinDistributionType in project trino by trinodb.
the class DetermineJoinDistributionType method canReplicate.
public static boolean canReplicate(JoinNode joinNode, Context context) {
JoinDistributionType joinDistributionType = getJoinDistributionType(context.getSession());
if (!joinDistributionType.canReplicate()) {
return false;
}
DataSize joinMaxBroadcastTableSize = getJoinMaxBroadcastTableSize(context.getSession());
PlanNode buildSide = joinNode.getRight();
PlanNodeStatsEstimate buildSideStatsEstimate = context.getStatsProvider().getStats(buildSide);
double buildSideSizeInBytes = buildSideStatsEstimate.getOutputSizeInBytes(buildSide.getOutputSymbols(), context.getSymbolAllocator().getTypes());
return buildSideSizeInBytes <= joinMaxBroadcastTableSize.toBytes() || getSourceTablesSizeInBytes(buildSide, context) <= joinMaxBroadcastTableSize.toBytes();
}
Aggregations