[ 
https://issues.apache.org/jira/browse/FLINK-17625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17113296#comment-17113296
 ] 

dalongliu edited comment on FLINK-17625 at 5/21/20, 3:48 PM:
-------------------------------------------------------------

Hi, [~danny0405], sorry, I haven't start the work because of something else 
recently, I was just going to do it. if you have time you can also help do this.

Hi, [~jark] , when I debug 
AppendOnlyTopNFunction#processElementWithoutRowNumber method, I find 
TopBuffer.currentTopNum always increase, it will not decrease even we call 
TopBuffer#removeAll(sortKey) because of list is empty, is it bug?

Besides, can you help provide some hints about what might lead to the 
ArrayIndexOutOfBoundsException, I have not idea about reproduce this problem, 
so I don’t know how to code the IT case now, tks.


was (Author: lsy):
Hi, [~danny0405], sorry, I haven't done because of something else recently, I 
was just going to do it. if you have time you can also help do this.

Hi, [~jark] , when I debug 
AppendOnlyTopNFunction#processElementWithoutRowNumber method, I find 
TopBuffer.currentTopNum always increase, it will not decrease even we call 
TopBuffer#removeAll(sortKey) because of list is empty, is it bug?

Besides, can you help provide some hints about what might lead to the 
ArrayIndexOutOfBoundsException, I have not idea about reproduce this problem, 
so I don’t know how to code the IT case now, tks.

> Fix ArrayIndexOutOfBoundsException in AppendOnlyTopNFunction
> ------------------------------------------------------------
>
>                 Key: FLINK-17625
>                 URL: https://issues.apache.org/jira/browse/FLINK-17625
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / Planner
>            Reporter: Jark Wu
>            Assignee: dalongliu
>            Priority: Major
>             Fix For: 1.11.0, 1.10.2
>
>
> This is reported in user mailing list: 
> http://apache-flink.147419.n8.nabble.com/sql-topN-ArrayIndexOutOfBoundsException-td3008.html
> We should check list is not empty before removing the last element in 
> {{AppendOnlyTopNFunction#processElementWithoutRowNumber}}.
> {code:java}
> ava.lang.ArrayIndexOutOfBoundsException: -1
> at java.util.ArrayList.elementData(ArrayList.java:422)
> at java.util.ArrayList.remove(ArrayList.java:499)
> at 
> org.apache.flink.table.runtime.operators.rank.AppendOnlyTopNFunction.processElementWithoutRowNumber(AppendOnlyTopNFunction.java:205)
> at 
> org.apache.flink.table.runtime.operators.rank.AppendOnlyTopNFunction.processElement(AppendOnlyTopNFunction.java:120)
> at 
> org.apache.flink.table.runtime.operators.rank.AppendOnlyTopNFunction.processElement(AppendOnlyTopNFunction.java:46)
> at 
> org.apache.flink.streaming.api.operators.KeyedProcessOperator.processElement(KeyedProcessOperator.java:85)
> at 
> org.apache.flink.streaming.runtime.tasks.OneInputStreamTask$StreamTaskNetworkOutput.emitRecord(OneInputStreamTask.java:173)
> at 
> org.apache.flink.streaming.runtime.io.StreamTaskNetworkInput.processElement(StreamTaskNetworkInput.java:151)
> at 
> org.apache.flink.streaming.runtime.io.StreamTaskNetworkInput.emitNext(StreamTaskNetworkInput.java:128)
> at 
> org.apache.flink.streaming.runtime.io.StreamOneInputProcessor.processInput(StreamOneInputProcessor.java:69)
> at 
> org.apache.flink.streaming.runtime.tasks.StreamTask.processInput(StreamTask.java:311)
> at 
> org.apache.flink.streaming.runtime.tasks.mailbox.MailboxProcessor.runMailboxLoop(MailboxProcessor.java:187)
> at 
> org.apache.flink.streaming.runtime.tasks.StreamTask.runMailboxLoop(StreamTask.java:487)
> at 
> org.apache.flink.streaming.runtime.tasks.StreamTask.invoke(StreamTask.java:470)
> at org.apache.flink.runtime.taskmanager.Task.doRun(Task.java:707)
> at org.apache.flink.runtime.taskmanager.Task.run(Task.java:532)
> at java.lang.Thread.run(Thread.java:748)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to