Copy from Local to Hive table


#1

How to copy the data from local to hive table in cloudx lab?
I am getting invalid path error while doing so .


#2

++Query which i have used is

LOAD DATA LOCAL INPATH ‘/user/myusername/sample.txt’ OVERWRITE INTO TABLE tab01;

Error::

  • Error while compiling statement: FAILED: SemanticException line 1:23 Invalid path ‘’/user/myusername/sample.txt’’: No files matching path file:/user/myusername/sample.txt

PS:I do have a file in local which i have verified through jupyter and linux (-ls) commands.


#3

Local home directory is in /home not /user. You can find that out from pwd as soon as you log in.

You should try:
LOAD DATA LOCAL INPATH ‘/home/myusername/sample.txt’ OVERWRITE INTO TABLE tab01;