For a test I removed the if condition and compiled spark for myself. It worked and I was able to define a sampling window where slideDuration > windowDuration with correct results. My question: Why is it not allowed to define a sampling window? It would be really nice to have this feature included in spark. Then others are able to compile my application from source without compiling spark before. Would it be the correct way, when I do a pull request for this?