[FLINK-1020] Introduce minBy and maxBy. Issue #1020.