@Override
    public String toString() {
      StringBuilder buf = new StringBuilder();
      buf.append(name).append("(");
      if (isStar) {
        buf.append("*");
      } else {
        if (isDistinct) {
          buf.append("distinct ");
        }
        if (args != null) {
          boolean first = true;
          for (ASTNode arg : args) {
            if (first) {
              first = false;
            } else {
              buf.append(", ");
            }
            buf.append(arg.toStringTree());
          }
        }
      }

      buf.append(")");

      if (!respectNulls) {
        buf.append(" ignore nulls ");
      }

      if ( windowSpec != null ){
        buf.append(" ").append(windowSpec.toString());
      }

      if (alias != null) {
        buf.append(" as ").append(alias);
      }

      return buf.toString();
    }
Add default order spec if there is no order and validate order spec for valued based
windowing since only one sort key is allowed.
@param wFn Window function spec
@throws SemanticException
ql/src/java/org/apache/hadoop/hive/ql/parse/WindowingSpec.java