Flink's SQL interface currently doesn't support Count Windows. Add a transformer that should be able to do generic Count Window Aggregations.