[SPARK-2871] [PySpark] Add missing API

Try to bring all Java/Scala API to PySpark.
In the Scala API, this is marked as a private API used only for tests.  Is there a non-test usecase for this?