@Override
    public RelOptCost getCost(HiveJoin join) {
      final RelMetadataQuery mq = join.getCluster().getMetadataQuery();
      double leftRCount = mq.getRowCount(join.getLeft());
      double rightRCount = mq.getRowCount(join.getRight());
      return HiveCost.FACTORY.makeCost(leftRCount + rightRCount, 0.0, 0.0);
    }
Default join algorithm. Cost is based on cardinality.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/cost/HiveDefaultCostModel.java