Skip to content

Commit c5a3382

Browse files
committed
PartitionIterator should gracefully handle case if resetIndex is outside
range
1 parent 21a6df0 commit c5a3382

File tree

1 file changed

+4
-0
lines changed
  • windowing/src/main/java/com/sap/hadoop/windowing/runtime2

1 file changed

+4
-0
lines changed

windowing/src/main/java/com/sap/hadoop/windowing/runtime2/Partition.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,10 @@ public Object lag(int amt)
225225
@Override
226226
public Object resetToIndex(int idx)
227227
{
228+
if ( idx < start || idx >= end )
229+
{
230+
return null;
231+
}
228232
Object o = getAt(idx);
229233
this.idx = idx + 1;
230234
return o;

0 commit comments

Comments
 (0)