diff --git a/spark-plugins/src/main/java/io/cdap/plugin/spark/DataCacher.java b/spark-plugins/src/main/java/io/cdap/plugin/spark/DataCacher.java index 4a349561f..0e0e76408 100644 --- a/spark-plugins/src/main/java/io/cdap/plugin/spark/DataCacher.java +++ b/spark-plugins/src/main/java/io/cdap/plugin/spark/DataCacher.java @@ -58,17 +58,8 @@ public void configurePipeline(PipelineConfigurer pipelineConfigurer) { @Override public JavaRDD transform(SparkExecutionPluginContext sparkExecutionPluginContext, - JavaRDD javaRDD) throws Exception { - - StorageLevel storageLevel = StorageLevel.MEMORY_AND_DISK(); - if (config.storageLevel.isEmpty()) { - StorageLevel.fromString(config.storageLevel); - } - if (storageLevel == StorageLevel.NONE()) { - throw new RuntimeException( - String.format("Invalid storage level '%s'. Please select a valid value", config.storageLevel)); - } - + JavaRDD javaRDD) { + StorageLevel storageLevel = StorageLevel.fromString(config.storageLevel); javaRDD.persist(storageLevel); return javaRDD; }