I need a rolling maximum where each row has a different window size based on some business logic — for example, rows 1 through 5 use growing windows, and rows 6+ use a fixed window. mmax only accepts a scalar for the window parameter, so passing a vector fails.
data = 1..10
windows = 1 2 3 4 5 5 5 5 5 5
// mmax only accepts a scalar window
result = mmax(data, windows, 1)
// Error: window must be a scalar
Is there a way to do variable-window rolling max in DolphinDB without looping through each row? I have about 100k rows and a loop would be too slow. The window sizes follow a pattern (growing then fixed), so maybe there's a way to split into segments with different fixed windows? Or is there a different function that supports per-row window specification?