MarketAnalysis | Market Analysis Course with Interactive RTutor Problemsets | Learning library
kandi X-RAY | MarketAnalysis Summary
kandi X-RAY | MarketAnalysis Summary
This repository contains the material for my course.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of MarketAnalysis
MarketAnalysis Key Features
MarketAnalysis Examples and Code Snippets
Community Discussions
Trending Discussions on MarketAnalysis
QUESTION
I do not know why I cannot move a file from one directory to another. I can view the content of the file but I cannot move the same file into another directory.
WORKS FINE:
hadoop fs -cat /user/hadoopusr/project-data.txt
DOES NOT WORK:
hadoop fs -put /user/hadoopusr/project-data.txt /user/hadoopusr/Projects/MarketAnalysis
I got a No such file or directory
error message. What is wrong? Please help. Thank you!
ANSWER
Answered 2020-Oct-29 at 20:58As we can read from here about the -put
command:
This command is used to copy files from the local file system to the HDFS filesystem. This command is similar to –copyFromLocal command. This command will not work if the file already exists unless the –f flag is given to the command. This overwrites the destination if the file already exists before the copy
Which makes it clear why it doesn't work and throws the No such file or directory
message. It's because it can't find any file with the name project-data.txt
on your current directory of your local filesystem.
You plan on moving a file between directories inside the HDFS, so instead of using the -put
parameter for moving, we can simply use the -mv
parameter as we would in our local filesystem!
Tested it out on my own HDFS as follows:
- Create the source and destination directories in HDFS
hadoop fs -mkdir source_dir dest_dir
- Create an empty (for the sake of the test) file under the source directory
hadoop fs -touch source_dir/test.txt
- Move the empty file to the destination directory
hadoop fs -mv source_dir/test.txt dest_dir/test.txt
(Notice how the /user/username/
part of the path for the file and the destination directory is not needed, because HDFS is by default on this directory where you are working. You also should note that you have to write the full path of the destination with name of the file included.)
You can see below with the HDFS browser that the empty text file has been moved to the destination directory:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install MarketAnalysis
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page