Styne J
Styne J

Reputation: 195

Create table exception

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?

Upvotes: 0

Views: 113

Answers (1)

Lukasz Szozda
Lukasz Szozda

Reputation: 176034

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.

Upvotes: 1

Related Questions