From 9758645fd6e51d71c25b42766a582ee909ae3f9a Mon Sep 17 00:00:00 2001 From: priyankab122 Date: Sat, 15 Aug 2020 01:15:17 +0530 Subject: [PATCH] removed file protocol from the filepath --- src/main/java/com/scienaptic/Application.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/scienaptic/Application.java b/src/main/java/com/scienaptic/Application.java index 6908556..fb930b8 100644 --- a/src/main/java/com/scienaptic/Application.java +++ b/src/main/java/com/scienaptic/Application.java @@ -11,15 +11,14 @@ public class Application extends MistFn { @Override public Handle handle() { - return withArgs(stringArg("inputPath")). + return withArgs(stringArg("inputPath")). //Give complete hdfs path hdfs:///filepath for parameter inputPath while running the job withMistExtras(). - onSparkSession((path, extras, SparkSession) -> { - String filePath = "file://" + path; + onSparkSession((filePath, extras, SparkSession) -> { Dataset df = SparkSession.read() .format("csv") .option("header",true) .load(filePath); - String fileName = filePath.substring(0,path.lastIndexOf('.')); + String fileName = filePath.substring(0,filePath.lastIndexOf('.')); String outputPath = fileName + ".parquet"; df.write().mode("overwrite").parquet(outputPath); return outputPath;