add max but in the spark master branch, it exists.