Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/main/java/com/scienaptic/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -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://<host:port>/filepath for parameter inputPath while running the job
withMistExtras().
onSparkSession((path, extras, SparkSession) -> {
String filePath = "file://" + path;
onSparkSession((filePath, extras, SparkSession) -> {
Dataset<Row> 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;
Expand Down