[
https://issues.apache.org/jira/browse/FLINK-6817?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16036428#comment-16036428
]
ASF GitHub Bot commented on FLINK-6817:
---------------------------------------
Github user sunjincheng121 commented on a diff in the pull request:
https://github.com/apache/flink/pull/4055#discussion_r120023733
--- Diff:
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/api/java/windows.scala
---
@@ -98,7 +98,7 @@ object Over {
*/
def orderBy(orderBy: String): OverWindowWithOrderBy = {
val orderByExpr = ExpressionParser.parseExpression(orderBy)
- new OverWindowWithOrderBy(Seq[Expression](), orderByExpr)
+ new OverWindowWithOrderBy(Array[Expression](), orderByExpr)
--- End diff --
Good catch!
And suggest to change the `java/windows.scala` as well. What do you think?
> Fix NPE when preceding is not set in OVER window
> ------------------------------------------------
>
> Key: FLINK-6817
> URL: https://issues.apache.org/jira/browse/FLINK-6817
> Project: Flink
> Issue Type: Bug
> Components: Table API & SQL
> Reporter: Jark Wu
> Assignee: Jark Wu
> Priority: Minor
> Fix For: 1.4.0
>
>
> When preceding is not set in over window , a NPE will be thrown:
> {code}
> val result = table
> .window(Over orderBy 'rowtime as 'w)
> .select('c, 'a.count over 'w)
> {code}
> {code}
> java.lang.NullPointerException
> at org.apache.flink.table.api.OverWindowWithOrderBy.as(windows.scala:97)
> {code}
> Preceding must be set in OVER window, so should throw a more explicit
> exception not a NPE
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)