I need to run following command 'hdfs dfs -cat /user/username/data/20220815/EDHSB.CSV', which shows the contents of the CSV file (present in remote HDFS).
To implement the above I have used below code:
try{
String shpath="hdfs dfs -cat /user/username/data/20220815/EDHSB.CSV";
Process ps = Runtime.getRuntime().exec(shpath);
ps.waitFor();
}
catch (Exception e) {
e.printStackTrace();
}
Next step is to read the CSV file from above code. Is the first step good enough or is there any other way for the entire flow...