presto-main/src/main/java/io/prestosql/cost/SpatialJoinStatsRule.java/SpatialJoinStatsRule/doCalculate
class SpatialJoinStatsRule:    @Override
    protected Optional<PlanNodeStatsEstimate> doCalculate(SpatialJoinNode node, StatsProvider sourceStats, Lookup lookup, Session session, TypeProvider types)
    {
        PlanNodeStatsEstimate leftStats = sourceStats.getStats(node.getLeft());
        PlanNodeStatsEstimate rightStats = sourceStats.getStats(node.getRight());
        PlanNodeStatsEstimate crossJoinStats = crossJoinStats(node, leftStats, rightStats);

        switch (node.getType()) {
            case INNER:
                return Optional.of(statsCalculator.filterStats(crossJoinStats, node.getFilter(), session, types));
            case LEFT:
                return Optional.of(PlanNodeStatsEstimate.unknown());
            default:
                throw new IllegalArgumentException("Unknown spatial join type: " + node.getType());
        }
    }