Error when trying to Create a Hive External Table


#1

I am trying to create an external hive table from a CSV file residing within my personal directory inside HDFS. I am getting an error as listed below. Please provide assistance. The abc_xyz is just to make it abstract for the post. The real directory path is specified and has been verified.

hive> CREATE EXTERNAL TABLE IF NOT EXISTS Ext_Movies(
> movieId INT, title STRING, genres STRING)
> COMMENT ‘Movie names and Genre’
> ROW FORMAT DELIMITED
> FIELDS TERMINATED BY ‘,’
> STORED AS TEXTFILE
> LOCATION ‘/user/abc_xyz/movies.csv’;
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:hdfs://ip-172-31-35-141.ec2.internal:8020/u
ser/abc_xyz/movies.csv is not a directory or unable to create one)
hive>


#2

The location should be a folder not file.