### Question:
DetermineJoinDistributionType implements Rule<JoinNode> { public static double getSourceTablesSizeInBytes(PlanNode node, Context context) { return getSourceTablesSizeInBytes(node, context.getLookup(), context.getStatsProvider(), context.getSymbolAllocator().getTypes()); } DetermineJoinDistributionType(CostComparator costComparator, TaskCountEstimator taskCountEstimator); @Override Pattern<JoinNode> getPattern(); @Override Result apply(JoinNode joinNode, Captures captures, Context context); static boolean canReplicate(JoinNode joinNode, Context context); static double getSourceTablesSizeInBytes(PlanNode node, Context context);  }### Answer:
@Test public void testGetSourceTablesSizeInBytes() { PlanBuilder planBuilder = new PlanBuilder(new PlanNodeIdAllocator(), tester.getMetadata()); Symbol symbol = planBuilder.symbol("col"); Symbol sourceSymbol1 = planBuilder.symbol("source1"); Symbol sourceSymbol2 = planBuilder.symbol("soruce2"); assertEquals( getSourceTablesSizeInBytes( planBuilder.values(symbol), noLookup(), node -> PlanNodeStatsEstimate.unknown(), planBuilder.getTypes()), NaN); PlanNodeStatsEstimate sourceStatsEstimate1 = PlanNodeStatsEstimate.builder() .setOutputRowCount(10) .build(); PlanNodeStatsEstimate sourceStatsEstimate2 = PlanNodeStatsEstimate.builder() .setOutputRowCount(20) .build(); assertEquals( getSourceTablesSizeInBytes( planBuilder.union( ImmutableListMultimap.<Symbol, Symbol>builder() .put(symbol, sourceSymbol1) .put(symbol, sourceSymbol2) .build(), ImmutableList.of( planBuilder.tableScan( ImmutableList.of(sourceSymbol1), ImmutableMap.of(sourceSymbol1, new TestingColumnHandle("col"))), planBuilder.values(new PlanNodeId("valuesNode"), sourceSymbol2))), noLookup(), node -> { if (node instanceof TableScanNode) { return sourceStatsEstimate1; } if (node instanceof ValuesNode) { return sourceStatsEstimate2; } return PlanNodeStatsEstimate.unknown(); }, planBuilder.getTypes()), 270.0); assertEquals( getSourceTablesSizeInBytes( planBuilder.join( INNER, planBuilder.values(sourceSymbol1), planBuilder.values(sourceSymbol2)), noLookup(), node -> sourceStatsEstimate1, planBuilder.getTypes()), NaN); }