@Override
    public Object process(Node nd, Stack<Node> stack, NodeProcessorCtx procCtx,
                          Object... nodeOutputs) throws SemanticException {
      final LateralViewJoinOperator lop = (LateralViewJoinOperator) nd;
      final AnnotateStatsProcCtx aspCtx = (AnnotateStatsProcCtx) procCtx;
      final HiveConf conf = aspCtx.getConf();

      if (!isAllParentsContainStatistics(lop)) {
        return null;
      }

      final List<Operator<? extends OperatorDesc>> parents = lop.getParentOperators();
      if (parents.size() != 2) {
        LOG.warn("LateralViewJoinOperator should have just two parents but actually has "
                + parents.size() + " parents.");
        return null;
      }

      final Statistics selectStats = parents.get(LateralViewJoinOperator.SELECT_TAG).getStatistics();
      final Statistics udtfStats = parents.get(LateralViewJoinOperator.UDTF_TAG).getStatistics();

      final long udtfNumRows = Math.max(udtfStats.getNumRows(), 1);
      final double factor = (double) udtfNumRows / (double) Math.max(selectStats.getNumRows(), 1);
      final long selectDataSize = StatsUtils.safeMult(selectStats.getDataSize(), factor);
      final long dataSize = StatsUtils.safeAdd(selectDataSize, udtfStats.getDataSize());
      Statistics joinedStats = new Statistics(udtfNumRows, dataSize, 0, 0);

      if (satisfyPrecondition(selectStats) && satisfyPrecondition(udtfStats)) {
        final Map<String, ExprNodeDesc> columnExprMap = lop.getColumnExprMap();
        final RowSchema schema = lop.getSchema();

        joinedStats.updateColumnStatsState(selectStats.getColumnStatsState());
        final List<ColStatistics> selectColStats = StatsUtils
                .getColStatisticsFromExprMap(conf, selectStats, columnExprMap, schema);
        StatsUtils.scaleColStatistics(selectColStats, factor);
        joinedStats.addToColumnStats(selectColStats);

        joinedStats.updateColumnStatsState(udtfStats.getColumnStatsState());
        final List<ColStatistics> udtfColStats = StatsUtils
                .getColStatisticsFromExprMap(conf, udtfStats, columnExprMap, schema);
        joinedStats.addToColumnStats(udtfColStats);
      }

      joinedStats = applyRuntimeStats(aspCtx.getParseContext().getContext(), joinedStats, lop);
      lop.setStatistics(joinedStats);

      if (LOG.isDebugEnabled()) {
        LOG.debug("[0] STATS-" + lop.toString() + ": " + joinedStats.extendedToString());
      }

      return null;
    }
LateralViewJoinOperator changes the data size and column level statistics.

A diagram of LATERAL VIEW.

  [Lateral View Forward]
         /     \
   [Select]  [Select]
       |        |
       |     [UDTF]
       \       /
  [Lateral View Join]

For each row of the source, the left branch just picks columns and the right branch processes UDTF.
And then LVJ joins a row from the left branch with rows from the right branch.
The join has one-to-many relationship since UDTF can generate multiple rows.

This rule multiplies the stats from the left branch by T(right) / T(left) and sums up the both sides.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/stats/annotation/StatsRulesProcFactory.java