你看一下这样可以满足吗?
t = table(1 2 3 4 5 3 8 4 2 3 9 9 as volume)
tt = select volume, iif(cumrank(volume) = (cumcount(volume)-1), cumrank(volume), 0) as newcount from t
tmp = select volume, newcount , bfill(iif(deltas(volume)>=0, rowNo(volume), NULL)) as flag from tt
aa = select volume, newcount,cumrank(volume) as cumrank from tmp context by flag
aa.update!(`cumrank,<newcount>,<(cumrank = 0)>).dropColumns!(`newcount)
aa