I have a file on HDFS into which I have written ints in my code using FSDataOutputStream.writeInt()
How do I read it from command line hadoop tool? hadoop dfs -cat returns me binary garbage.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Straight from the command line using some concoction of
hadoop fs– unlikely unless you want to delve into piping the output via an awk script.You could just write a simple java class to read the file, i’m guessing something like:
Then you can bundle in a jar and execute: