0
votes

While running the following commands:

CREATE EXTERNAL TABLE zips (zip int, city String) 
ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' LOCATION ’/tutorial/input';

I got an exception:

mismatched input '/' expecting StringLiteral near 'LOCATION' in table location specification

I searched about the issue and I tried to use OCT code like this:

CREATE EXTERNAL TABLE zips (zip int, city String) 
ROW FORMAT DELIMITED FIELDS TERMINATED BY '\054' LOCATION ’/tutorial/input';

I am new to Hive. How to resolve this issue?

1
maybe stupid question but is the quote between location and /tutorial correct? - Mark
ROW FORMAT DELIMITED FIELDS TERMINATED BY '\054' LOCATION ’/tutorial/input'; Did you intend to use different quotes after location? - Magisch
describe formatted any other existing table and you will see the correct location format - leftjoin

1 Answers

1
votes

You should change to ':

CREATE EXTERNAL TABLE zips (zip int, city String) 
ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' LOCATION '/tutorial/input';

You should avoid copying code and instead type it. It allows to better understand how it works and develop muscle memory.