I would like to see the contents of an HDFS directory from within Hive Beeline, using an "ls" command. Similarly, I'd like to see what the default HDFS directory is set to, perhaps with a "pwd" command.
Is there any way to do this in Beeline, or am I stuck going to linux prompt and using hadoop instead?
You can enter !sh
at the beeline prompt followed by shell commands, for example:
!sh pwd
This shows you the working directory in the host filesystem, of course. You can use the same mechanism to issue HDFS commands:
!sh hdfs dfs -ls /
I'm not aware of any mechanism that gives a default HDFS directory. Are you thinking of Hive databases?
For more info say help
at the beeline prompt.