@Override
    public ASTNode visitOver(RexOver over) {
      if (!deep) {
        return null;
      }

      // 1. Translate the UDAF
      final ASTNode wUDAFAst = visitCall(over);

      // 2. Add TOK_WINDOW as child of UDAF
      ASTNode wSpec = ASTBuilder.createAST(HiveParser.TOK_WINDOWSPEC, "TOK_WINDOWSPEC");
      wUDAFAst.addChild(wSpec);

      // 3. Add Part Spec & Range Spec as child of TOK_WINDOW
      final RexWindow window = over.getWindow();
      final ASTNode wPSpecAst = getPSpecAST(window);
      final ASTNode wRangeAst = getWindowRangeAST(window);
      if (wPSpecAst != null) {
        wSpec.addChild(wPSpecAst);
      }
      if (wRangeAst != null) {
        wSpec.addChild(wRangeAst);
      }
      if (over.ignoreNulls()) {
        ASTNode ignoreNulls = ASTBuilder.createAST(HiveParser.TOK_IGNORE_NULLS, "TOK_IGNORE_NULLS");
        wSpec.addChild(ignoreNulls);
      }

      return wUDAFAst;
    }
Add PK-FK join information to the AST as a query hint
@param ast
@param join
@param swapSides whether the left and right input of the join is swapped
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/translator/ASTConverter.java