private final RexNode processCall(RexNode expr) {
        if (expr instanceof RexOver) {
          RexOver over = (RexOver) expr;
          if (isApplicable(over)) {
            return rewrite(over);
          }
        }
        return expr;
      }
Generic support for rewriting Windowing expression into a different form usually using joins.
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveRewriteToDataSketchesRules.java