Skip to content

Commit

Permalink
Optimize code
Browse files Browse the repository at this point in the history
  • Loading branch information
beliefer committed Oct 28, 2020
1 parent 9c35ddd commit 1c0e82b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ import org.apache.spark.sql.types.{CalendarIntervalType, DateType, IntegerType,
* 1. [[FrameLessOffsetWindowFunction]] returns the value of the input column offset by a number
* of rows according to the current row.
* 2. [[UnboundedOffsetWindowFunctionFrame]] and [[UnboundedPrecedingOffsetWindowFunctionFrame]]
* returns the value of the input column offset by a number of rows within the partition.
* returns the value of the input column offset by a number of rows within the frame.
*
* Different frame boundaries can be used in Growing, Shrinking and Moving frames. A frame
* boundary can be either Row or Range based:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class FrameLessOffsetWindowFunctionFrame(
/**
* The unbounded offset window frame is an internal window frame just used to optimize the
* performance for the window function that returns the value of the input column offset
* by a number of rows within the partition and has specified ROWS BETWEEN UNBOUNDED PRECEDING
* by a number of rows within the frame and has specified ROWS BETWEEN UNBOUNDED PRECEDING
* AND UNBOUNDED FOLLOWING. The internal window frame is not a popular window frame cannot be
* specified and used directly by the users.
* The unbounded offset window frame calculates frames containing NTH_VALUE statements.
Expand Down Expand Up @@ -220,7 +220,7 @@ class UnboundedOffsetWindowFunctionFrame(
/**
* The unbounded preceding offset window frame is an internal window frame just used to optimize
* the performance for the window function that returns the value of the input column offset
* by a number of rows within the partition and has specified ROWS BETWEEN UNBOUNDED PRECEDING
* by a number of rows within the frame and has specified ROWS BETWEEN UNBOUNDED PRECEDING
* AND CURRENT ROW. The internal window frame is not a popular window frame cannot be specified
* and used directly by the users.
* The unbounded preceding offset window frame calculates frames containing NTH_VALUE statements.
Expand Down Expand Up @@ -248,7 +248,7 @@ class UnboundedPrecedingOffsetWindowFunctionFrame(
if (inputIterator.hasNext) inputIterator.next()
inputIndex += 1
}
if (inputIndex >= 0 && inputIndex < input.length) {
if (inputIndex < input.length) {
selectedRow = WindowFunctionFrame.getNextOrNull(inputIterator)
}
}
Expand Down

0 comments on commit 1c0e82b

Please sign in to comment.