Revert "Revert [SPARK-2715]"

This reverts commit dbecd4981f242f47f69c29b471782924261ca69a.
Revert