Changed to using groupBy instead of custom-crafted method.

Hi.

I tried again using sortBy and groupBy.

In this work, there are some problems.
For example, When use the .groupBy as partition-By, the .flatMap should be used like below, too.

  val windowFunctionColumn =
    Query(a, b).
      sortBy { case (a: Students, b: ExamScores) => (b.score.desc, a.name.asc)}.
      groupBy { case (a: Students, b: ExamScores) => b.subject}.
      flatMap { case (_, t) => t}.map { case (a: Students, b: ExamScores) => ()}.
      windowFunction(rank)

Currently, You can't use inner map like below.
      flatMap { case (_, t) => t.map { case (a: Students, b: ExamScores) => ()}}.

And, the way to pass parametes into window function is some verbose.
In order to pass parameters, the .map should be used like below.

  val windowFunctionColumn3 =
    Query(a, b).
      sortBy { case (a: Students, b: ExamScores) => (b.score.asc)}.
      map { case (a: Students, b: ExamScores) => (b.score, LiteralColumn(1), LiteralColumn[Option[Int]](None))}.
      windowFunctionParams(lag)

In this work, window function's parameter types are distinguished.
So, In order to use no parameter window functions like rank or row_number,
the .map should be used like '.map( ... => ()).windowFunction(...)'
For example, you can't use this feature like below.
  .map(t => (t.id, t.name)).windowFunctionParams(someThreeParametersFunction)

By the way, I'm glad to heard that tminglei's work is almost done.
I hope that this work is useful.

Thanks.