You can do 

pruningFnOpt.map(_(tableRdd, tableStats)).getOrElse(tableRdd)