Added more functions for spark mock