We could encapsulate this into a method in SparkHadoopUtil ? And use that everywhere (and possibly extend that method for future uses).